mmh

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyServers              = "servers"
	KeyBasic                = "basic"
	KeyTags                 = "tags"
	KeyContext              = "context"
	KeyContextUse           = "context_use"
	KeyContextUseTime       = "context_use_time"
	KeyContextTimeout       = "context_timeout"
	KeyContextAutoDowngrade = "context_auto_downgrade"
)

Variables

View Source
var (
	MainViper   = viper.New()
	CtxViper    = viper.New()
	AllContexts Contexts
)

Functions

func ContextList added in v1.3.0

func ContextList()

func ContextUse added in v1.3.0

func ContextUse(ctxName string)

func Copy

func Copy(args []string, singleServer bool)

func Exec

func Exec(tagOrName, cmd string, singleServer bool)

func InitConfig added in v1.2.3

func InitConfig()

func InteractiveLogin

func InteractiveLogin()

func ServerAdd added in v1.3.0

func ServerAdd()

func ServerDelete added in v1.3.0

func ServerDelete(serverNames []string)

func ServerDetail added in v1.3.0

func ServerDetail(serverName string)

func ServerList added in v1.3.0

func ServerList()

func SingleLogin

func SingleLogin(name string)

func UpdateContextTimestamp added in v1.3.0

func UpdateContextTimestamp(_ *cobra.Command, _ []string)

func UpdateContextTimestampTask added in v1.3.1

func UpdateContextTimestampTask(_ *cobra.Command, _ []string)

Types

type Basic added in v1.2.3

type Basic struct {
	User               string `yaml:"user" mapstructure:"user"`
	Password           string `yaml:"password" mapstructure:"password"`
	PrivateKey         string `yaml:"privatekey" mapstructure:"privatekey"`
	PrivateKeyPassword string `yaml:"privatekey_password" mapstructure:"privatekey_password"`
	Port               int    `yaml:"port" mapstructure:"port"`
	Proxy              string `yaml:"proxy" mapstructure:"proxy"`
}

type Context added in v1.3.0

type Context struct {
	ConfigPath string `yaml:"config_path" mapstructure:"config_path"`
}

type Contexts added in v1.3.0

type Contexts map[string]Context

type Server

type Server struct {
	Name                string        `yaml:"name" mapstructure:"name"`
	Tags                []string      `yaml:"tags" mapstructure:"tags"`
	User                string        `yaml:"user" mapstructure:"user"`
	Password            string        `yaml:"password" mapstructure:"password"`
	PrivateKey          string        `yaml:"privatekey" mapstructure:"privatekey"`
	PrivateKeyPassword  string        `yaml:"privatekey_password" mapstructure:"privatekey_password"`
	Address             string        `yaml:"address" mapstructure:"address"`
	Port                int           `yaml:"port" mapstructure:"port"`
	Proxy               string        `yaml:"proxy" mapstructure:"proxy"`
	ServerAliveInterval time.Duration `yaml:"server_alive_interval" mapstructure:"server_alive_interval"`
	// contains filtered or unexported fields
}

func (*Server) Connect

func (s *Server) Connect() error

type Servers

type Servers []*Server

func (Servers) Len

func (servers Servers) Len() int

func (Servers) Less

func (servers Servers) Less(i, j int) bool

func (Servers) Swap

func (servers Servers) Swap(i, j int)

Jump to

Keyboard shortcuts

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