diff options
-rw-r--r-- | c_init.go | 5 | ||||
-rw-r--r-- | c_josh.go | 16 | ||||
-rw-r--r-- | c_lhosts.go | 25 |
3 files changed, 26 insertions, 20 deletions
@@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * josh: src/c_init.go - * Fri, 15 Dec 2023 11:43:39 +0100 + * Fri, 15 Dec 2023 17:27:13 +0100 * Joe * * init functions @@ -97,7 +97,8 @@ func c_recurse_data_dir(dir string, root string, lhost *HostList) { if len(host.Name) == 0 { return } - host.Path = dir + file.Name() + host.Filename = file.Name() + host.Folder = dir lhost.add_back(host) } } @@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * josh: src/c_josh.go - * Thu, 14 Dec 2023 16:55:28 +0100 + * Fri, 15 Dec 2023 12:45:58 +0100 * Joe * * the main @@ -49,14 +49,18 @@ package main import "fmt" +func display_servers(lhost *HostList) { + curr := lhost.head + for curr != nil { + fmt.Println(curr.ID, curr.Folder + curr.Name) + curr = curr.next + } +} + func main() { var data_dir string data_dir = c_get_data_dir() lhost := c_load_data_dir(data_dir) - curr := lhost.head - for curr != nil { - fmt.Println(*curr) - curr = curr.next - } + display_servers(lhost) } diff --git a/c_lhosts.go b/c_lhosts.go index 67a2944..cbe1f71 100644 --- a/c_lhosts.go +++ b/c_lhosts.go @@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * josh: src/c_lhosts.go - * Fri, 15 Dec 2023 12:22:05 +0100 + * Fri, 15 Dec 2023 17:26:58 +0100 * Joe * * the hosts linked list @@ -50,17 +50,18 @@ package main // 0: ssh // 1: rdp type HostNode struct { - ID uint64 - Type int8 `yaml:"type"` - Name string `yaml:"name"` - Host string `yaml:"host"` - Port uint16 `yaml:"port"` - User string `yaml:"user"` - Pass string `yaml:"pass"` - Jump string `yaml:"jump"` - Priv string `yaml:"priv"` - Note string `yaml:"note"` - Path string + ID uint64 + Type int8 `yaml:"type"` + Name string `yaml:"name"` + Host string `yaml:"host"` + Port uint16 `yaml:"port"` + User string `yaml:"user"` + Pass string `yaml:"pass"` + Jump string `yaml:"jump"` + Priv string `yaml:"priv"` + Note string `yaml:"note"` + Filename string + Folder string next *HostNode } |