config

package
v0.0.0-...-720803e Latest Latest
Warning

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

Go to latest
Published: May 23, 2013 License: Zlib Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteDefaultConfig

func WriteDefaultConfig(configPath string) error

Types

type Config

type Config struct {
	ConfigFilePath string `json:"-"`
	InstanceName   string
	Control        ControlConfig
	Ssh            SshConfig
	VcsCmd         string
	VcsRoot        string
}

func LoadConfig

func LoadConfig(configPath string) (c *Config, foundConfig bool, err error)

func LoadOrWriteDefaultConfig

func LoadOrWriteDefaultConfig(configPath string) (*Config, error)

func (*Config) GetUsers

func (c *Config) GetUsers() ([]byte, error)

Returns the Users section of the config as a JSON string for editing.

func (*Config) Save

func (c *Config) Save() error

Save the current config to ConfigFilePath

func (*Config) SetUsers

func (c *Config) SetUsers(jsonUsers []byte) error

Saves the Users section of the config back to memory and disk.

func (*Config) SshHostPrivateKeyByte

func (c *Config) SshHostPrivateKeyByte() []byte

type ControlConfig

type ControlConfig struct {
	BindNetwork string
	TlsCertFile string
	TlsKeyFile  string
	Username    string
	Password    string
	// contains filtered or unexported fields
}

type Path

type Path struct {
	Path string
	RO   bool
}

type SshConfig

type SshConfig struct {
	BindNetwork        string
	HostPrivateKeyPath string

	Users map[string]*UserConfig //key = username
	// contains filtered or unexported fields
}

type UserConfig

type UserConfig struct {
	PublicKey []string

	AllowPaths []Path
	DenyPaths  []string
	// contains filtered or unexported fields
}

func (*UserConfig) AllowPath

func (uc *UserConfig) AllowPath(p string) (inAllow, readOnly bool)

func (*UserConfig) Auth

func (uc *UserConfig) Auth(pubkey []byte) bool

Jump to

Keyboard shortcuts

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