Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) AddServer(name string, host string, port int) (string, *Server)
- func (c *Config) AddServerSSHUser(serverKey string, username string, identityFile string, allowUsers *[]string) (string, *SSHUser)
- func (c *Config) AddUser(username string, password string, IsAdmin bool, pubKey string) (string, *User)
- func (c *Config) GetServerByName(name string) *Server
- func (c *Config) GetServerSSHUsers(user *User, server *Server) map[string]*SSHUser
- func (c *Config) GetUserByUsername(username string) *User
- func (c *Config) GetUserServers(user *User) map[string]*Server
- func (c *Config) ReIndexServer()
- func (c *Config) ReIndexUser()
- func (c *Config) ReadFrom(path string) error
- func (c *Config) SaveTo(path string) error
- type SSHUser
- type Server
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfPath *string
ConfPath config file path
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Users *map[string]*User `yaml:"users"` Servers *map[string]*Server `yaml:"servers"` }
Config config
var Conf *Config
Conf config obj
func (*Config) AddServerSSHUser ¶
func (c *Config) AddServerSSHUser(serverKey string, username string, identityFile string, allowUsers *[]string) (string, *SSHUser)
AddServerSSHUser add server ssh user to config
func (*Config) AddUser ¶
func (c *Config) AddUser(username string, password string, IsAdmin bool, pubKey string) (string, *User)
AddUser add user to config
func (*Config) GetServerByName ¶ added in v1.2.6
GetServerByName GetServerByName
func (*Config) GetServerSSHUsers ¶
GetServerSSHUsers get all allow server' s ssh users
func (*Config) GetUserByUsername ¶
GetUserByUsername GetUserByUsername
func (*Config) GetUserServers ¶
GetUserServers get user servers list
type SSHUser ¶
type SSHUser struct { SSHUsername string `yaml:"sshUsername"` IdentityFile string `yaml:"identityFile"` AllowUsers *[]string `yaml:"allowUsers,omitempty"` }
SSHUser ssh user
Click to show internal directories.
Click to hide internal directories.