utils

package
v0.0.0-...-0c87395 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaoConfigStr = ``

BaoConfigStr is used to hardcode a config file

Functions

func DieMaybe

func DieMaybe(m string, err error)

DieMaybe dies if errs

func DummyEventListener

func DummyEventListener(c *BaoConfig)

DummyEventListener spins a dummy event listener if not used (e.g. cli mode)

func OpenBrowser

func OpenBrowser(url string)

OpenBrowser pops browser at url

func PrintMaybe

func PrintMaybe(m string, err error)

PrintMaybe prints if errs

func ReadConfigs

func ReadConfigs() *[]*BaoConfig

ReadConfigs Read all configs either in base dir or embedded

func WriteConfig

func WriteConfig(path string, w BaoConfig)

WriteConfig writes config

Types

type BaoConfig

type BaoConfig struct {
	Event       chan (bool)
	MightBeDead bool
	Connected   bool
	Wanted      bool
	SSHConfig   *ssh.ClientConfig
	SSHConn     *ssh.Client
	LocalConns  []net.Listener
	Nickname    string   `json:"nickname"`
	Username    string   `json:"username"`
	Addr        string   `json:"addr"`
	Forwards    []string `json:"forwards"`
	Privkey     string   `json:"privkey"`
	Checksums   []string `json:"checksums"`
}

BaoConfig is the main type for all things config

Jump to

Keyboard shortcuts

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