Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) Add() (string, error)
- func (c *Config) AddPlain(configPlain string) (string, error)
- func (c *Config) Edit(envName string) (string, error)
- func (c *Config) EditAll() (string, error)
- func (c *Config) EditAllPlain(configPlain string) (string, error)
- func (c *Config) EditPlain(envName, configPlain string) (string, error)
- func (c *Config) FindProxy(env string) (*Proxy, error)
- func (c *Config) String() (string, error)
- type Forwarding
- type ForwardingNode
- type Item
- type Node
- type Proxy
- type ProxySetter
- type ProxySetterStation
- type ProxyStatus
- type SetAddressStation
- type SetAuthModeStation
- type SetEnvStation
- type SetTwoFAStation
- type SetUserNameStation
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Dir is the path where tpot store the configuration & cache // Dir will be overridden by flag -D Dir = os.Getenv("HOME") + "/.tpot/" // ErrValidateConfig is an error to indicate config is invalid ErrValidateConfig = errors.New("config is invalid") )
View Source
var ErrEnvNotFound = fmt.Errorf("env not found")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Editor is the editor to edit configuration // the default editor is nano Editor string `json:"editor" yaml:"editor"` // Proxies is list of proxy configuration Proxies []*Proxy `json:"proxies" yaml:"proxies"` }
Config is a config for tpot
func (*Config) AddPlain ¶ added in v0.0.2
AddPlain adds a new proxy configuration by plain configuration
func (*Config) EditAllPlain ¶ added in v0.0.2
func (*Config) EditPlain ¶ added in v0.0.2
EditPlain edit specific proxy configuration by config plain
type Forwarding ¶ added in v0.0.3
type Forwarding struct { Interval int `yaml:"interval"` Nodes []*ForwardingNode `yaml:"nodes"` }
type ForwardingNode ¶ added in v0.0.3
type ForwardingNode struct { Host string `yaml:"host"` ListenPort string `yaml:"listen_port"` RemotePort string `yaml:"remote_port"` RemoteHost string `yaml:"remote_host"` UserLogin string `yaml:"user_login"` Status bool `yaml:"-"` Error string `yaml:"-"` }
func (*ForwardingNode) Address ¶ added in v0.0.3
func (b *ForwardingNode) Address() string
func (*ForwardingNode) ViewName ¶ added in v0.0.3
func (b *ForwardingNode) ViewName() string
type Node ¶
type Node struct { Status *ProxyStatus `json:"status"` Items []Item `json:"items"` }
func (*Node) ListHostname ¶ added in v0.0.2
ListHostname return the list of hostname
type Proxy ¶
type Proxy struct { Address string `yaml:"address" json:"address"` UserName string `yaml:"user_name" json:"user_name"` Env string `yaml:"env" json:"env"` TwoFA bool `yaml:"two_fa" json:"two_fa"` // For using OAUTH like GMAIL, Facebook etc // empty means using username & password AuthConnector string `yaml:"auth_connector" json:"auth_connector"` // TSHPath is the location of TSH binary // by default it'll use your PATH location TSHPath string `yaml:"tsh_path" json:"tsh_path"` // Node contains the node information from teleport server Node Node `yaml:"node,omitempty" json:"node"` Forwarding Forwarding `yaml:"forwarding"` }
func (*Proxy) AppendNode ¶
AppendNode append the n to the proxy node list
func (*Proxy) ToEditString ¶ added in v0.0.4
ToEditString generate the string for edit
func (*Proxy) UpdateNode ¶
UpdateNode update the cache node
type ProxySetter ¶
type ProxySetter struct{}
func NewProxySetterStations ¶
func NewProxySetterStations() *ProxySetter
func (*ProxySetter) Execute ¶
func (ps *ProxySetter) Execute(p *Proxy) error
type ProxySetterStation ¶
type ProxyStatus ¶ added in v0.0.2
type ProxyStatus struct { // LoginAs is the username logged LoginAs string `json:"login_as"` // Roles is a list of teleport role Roles []string `json:"roles"` // UserLogins is a list of user login UserLogins []string `json:"user_logins"` }
ProxyStatus contains data about proxy status
type SetAddressStation ¶
type SetAddressStation struct {
// contains filtered or unexported fields
}
func NewSetAddressStation ¶
func NewSetAddressStation(next ProxySetterStation) *SetAddressStation
func (*SetAddressStation) Execute ¶
func (s *SetAddressStation) Execute(p *Proxy) error
type SetAuthModeStation ¶ added in v0.0.2
type SetAuthModeStation struct {
// contains filtered or unexported fields
}
func NewSetAuthConnectorStation ¶ added in v0.0.2
func NewSetAuthConnectorStation(next ProxySetterStation) *SetAuthModeStation
func (*SetAuthModeStation) Execute ¶ added in v0.0.2
func (s *SetAuthModeStation) Execute(p *Proxy) error
type SetEnvStation ¶
type SetEnvStation struct {
// contains filtered or unexported fields
}
func NewSetEnvStation ¶
func NewSetEnvStation(next ProxySetterStation) *SetEnvStation
func (*SetEnvStation) Execute ¶
func (s *SetEnvStation) Execute(p *Proxy) error
type SetTwoFAStation ¶
type SetTwoFAStation struct {
// contains filtered or unexported fields
}
func NewSetTwoFAStation ¶
func NewSetTwoFAStation(next ProxySetterStation) *SetTwoFAStation
func (*SetTwoFAStation) Execute ¶
func (s *SetTwoFAStation) Execute(p *Proxy) error
type SetUserNameStation ¶
type SetUserNameStation struct {
// contains filtered or unexported fields
}
func NewSetUserNameStation ¶
func NewSetUserNameStation(next ProxySetterStation) *SetUserNameStation
func (*SetUserNameStation) Execute ¶
func (s *SetUserNameStation) Execute(p *Proxy) error
Click to show internal directories.
Click to hide internal directories.