hosts

package
v2.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2020 License: MIT Imports: 1 Imported by: 4

Documentation

Overview

Package hosts is responsible for holding the state of which hosts the goquery shell is currently connected to. The state should only be mutated via the .connect or .switch commands, but can be looked up anywhere.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddQueryToHost

func AddQueryToHost(uuid string, newQuery Query)

func Disconnect

func Disconnect(uuid string) error

Disconnect is responsible for removing a host from the list Can be called with a specific host uuid or an empty "" to denote the current host the cursor is on

func Register

func Register(newHost Host) error

Register is responsible for adding a host to the list of established connected hosts in the host list. Also update the cursor of the current connected host. If a given host is already in the list, return the index

func SetCurrentHost

func SetCurrentHost(targetIndex int) (string, error)

SetCurrentHost updates the current index used to fetch the uuid of GetCurrentHost's call, returns the uuid

func SetCurrentHostDirectory

func SetCurrentHostDirectory(newDirectory string) error

func SetHostTables

func SetHostTables(uuid string, tables []string)

Types

type Host

type Host struct {
	UUID             string
	ComputerName     string
	Platform         string
	Version          string
	QueryHistory     []Query
	CurrentDirectory string
	Username         string
	Tables           []string
}

func GetCurrentHost

func GetCurrentHost() (Host, error)

GetCurrentHost is a public API that returns a point to the current host structure.

func GetCurrentHosts

func GetCurrentHosts() []Host

GetCurrentHosts is a public API that returns a the current state of the connectedHosts array

func (*Host) SetCurrentDirectory

func (host *Host) SetCurrentDirectory(newDirectory string) error

type Query

type Query struct {
	Name string
	SQL  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL