models

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Path  = "~/.shellz"
	Paths = map[string]string(nil)
)

Functions

func Init

func Init() (err error)

func Load

func Load() (error, Identities, Shells, Groups)

Types

type Address

type Address struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
}

func (Address) Empty

func (t Address) Empty() bool

func (Address) String

func (t Address) String() string

type Groups

type Groups map[string]Shells

type Identities

type Identities map[string]Identity

type Identity

type Identity struct {
	Name     string `json:"name"`
	Username string `json:"username"`
	KeyFile  string `json:"key"`
	Password string `json:"password"`
	Path     string `json:"-"`
}

func LoadIdent

func LoadIdent(path string) (err error, ident Identity)

type Proxy

type Proxy struct {
	Address  string `json:"address"`
	Port     int    `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
}

func (Proxy) Empty

func (p Proxy) Empty() bool

func (Proxy) String

func (p Proxy) String() string

type Shell

type Shell struct {
	Name         string    `json:"name"`
	Host         string    `json:"host"`
	Port         int       `json:"port"`
	IdentityName string    `json:"identity"`
	Type         string    `json:"type"`
	Ciphers      []string  `json:"ciphers"`
	HTTPS        bool      `json:"https"`
	Insecure     bool      `json:"insecure"`
	Enabled      bool      `json:"enabled"`
	Groups       []string  `json:"groups"`
	Proxy        Proxy     `json:"proxy"`
	Tunnel       Tunnel    `json:"tunnel"`
	Namespace    string    `json:"namespace"`
	Container    string    `json:"container"`
	Pod          string    `json:"pod"`
	Identity     *Identity `json:"-"`
	Path         string    `json:"-"`
}

func LoadShell

func LoadShell(path string, idents Identities) (err error, shell Shell)

func (Shell) Save

func (sh Shell) Save() error

type Shells

type Shells map[string]Shell

type Tunnel

type Tunnel struct {
	Local  Address `json:"local"`
	Remote Address `json:"remote"`
}

func (Tunnel) Empty

func (t Tunnel) Empty() bool

func (Tunnel) String

func (t Tunnel) String() string

Jump to

Keyboard shortcuts

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