Documentation ¶
Index ¶
- func AddOneToLastOctet(ipStr string) (string, error)
- func AllDone()
- func AuthPeer(nwid string, status bool, delNet string, todo string, isWeb bool) ([]byte, string)
- func ChkIfNet(nwid string) bool
- func ChkNetworkID(nwid string) bool
- func ChkPeer(nwid string, peer string) bool
- func ClearScreen()
- func ControllerHeader() string
- func ControllerID() string
- func CopyFile(srcFile, dstFile string) bool
- func DoAuthPeer(nwid string, peerAuth string, thePeer string) []byte
- func GetCIDRForNet() string
- func GetIPRangeFromCIDR(cidr string) (string, string, error)
- func GetNet() (bool, string)
- func GetZTInfo(httpMethod string, jsonBody []byte, action string, newNetData string) []byte
- func MenuPrompt(msg string) string
- func MenuSelection(theSelectionValue map[int]string, userInput int) string
- func NetworksToManage() string
- func OpenFile(filename string) string
- func ParseAddressFromJSON(jsonData []byte, value string) (string, error)
- func PtermErr(err error)
- func PtermErrMsg(msg string)
- func PtermGenInfo(msg string)
- func PtermGenWarn(msg string)
- func PtermInfo(msg string, val string)
- func PtermInputPrompt(msg string) string
- func PtermMenuPrompt(msg string)
- func PtermSuccess(msg string)
- func PtermWithErr(msg string, err error)
- func RulesDir() string
- func SubtractOneFromLastOctet(ipStr string) (string, error)
- func WebStatus(w http.ResponseWriter, r *http.Request, status bool, msg string)
- func WriteLogs(msg string)
- type NetworkInfo
- type Nwid
- type PeerInfo
- type TheNets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOneToLastOctet ¶
* Get the first usable IP in the network.
func AllDone ¶
func AllDone()
* Common AllDone for the CLI to prompt for messages (succes, error, etc.)
func ChkNetworkID ¶
* Function to Validate the network ID is valid.
func ClearScreen ¶
func ClearScreen()
* Clear the screen based on the operating system. TODO: Update the menus to use tview and get rid of this
func ControllerID ¶
func ControllerID() string
func DoAuthPeer ¶
* Function to authorize the peer.
func GetCIDRForNet ¶
func GetCIDRForNet() string
************************** GENERATING A RANDOM CIDR ****************************** Gemini helped with this one. *
func GetIPRangeFromCIDR ¶
* Function is used to get the network id and broadcast address of the network
func GetZTInfo ¶
* Get ZT Info. I need to consolidate some of these. The original idea was to have a case statement for each operation.
func MenuSelection ¶
* This is the menu that processes the selected network to manage.
func NetworksToManage ¶
func NetworksToManage() string
func ParseAddressFromJSON ¶
* Function to retrieve some values
func PtermErrMsg ¶
func PtermErrMsg(msg string)
func PtermGenInfo ¶
func PtermGenInfo(msg string)
func PtermGenWarn ¶
func PtermGenWarn(msg string)
func PtermInputPrompt ¶
func PtermMenuPrompt ¶
func PtermMenuPrompt(msg string)
func PtermSuccess ¶
func PtermSuccess(msg string)
func PtermWithErr ¶
func SubtractOneFromLastOctet ¶
* Get the last usable IP in the network.
Types ¶
type NetworkInfo ¶
type NetworkInfo struct { CreationTime int64 `json:"creationTime"` Name string `json:"name"` Nwid string `json:"nwid"` Authorized bool `json:"authorized"` // "ipAssignmentPools":[{"ipRangeEnd":"192.168.39.254","ipRangeStart":"192.168.39.1"}] IpAssignmentPools []struct { IPRangeEnd string `json:"ipRangeEnd"` IPRangeStart string `json:"ipRangeStart"` } `json:"ipAssignmentPools"` }
* Struct for the network controller data.
type TheNets ¶
type TheNets struct { Nwid string `json:"nwid"` Name string `json:"name"` IPRangeStart string `json:"ipRangeStart"` IPRangeEnd string `json:"ipRangeEnd"` CreationTime string `json:"creationTime"` }
Used to create the slice of structs that will return the peers for the respective network controller.