sault

package
v0.0.0-...-504a021 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2017 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BuildVersion is the build version
	BuildVersion = "v0.0"
	// BuildDate is the build date
	BuildDate = "0000-00-00T00:00:00+0000"
	// BuildCommit is the commit id of source
	BuildCommit = "XXXX"
	// BuildBranch is the branch name
	BuildBranch = "XXXX"
	// BuildRepo is the repository url
	BuildRepo = "XXXX"
	// BuildEnv is the build environment information
	BuildEnv = "XXXX"
)
View Source
var Commands = map[string]Command{}

Commands is the collection of sault commands

View Source
var ConfigFileExt = ".conf"

ConfigFileExt is the file extension of config file

View Source
var DefaultClientKey = "./sault-client.key"

DefaultClientKey is the default internal client key file path

View Source
var DefaultHostKey = "./sault-host.key"

DefaultHostKey is the default host key file path

View Source
var DefaultSaultHostID = "sault-host"

DefaultSaultHostID is the default host name, which is running the sault server

View Source
var DefaultSaultServerName = "sault"

DefaultSaultServerName is the name of sault server, it will be use to connect to the sault server directly.

View Source
var DefaultServerPort = uint64(2222)

DefaultServerPort is the default bind address of sault server

Functions

func SetupLog

func SetupLog(level logrus.Level, out io.Writer, formatter logrus.Formatter)

SetupLog will set up the logging

Types

type Command

type Command interface {
	Request(allFlags []*saultflags.Flags, thisFlags *saultflags.Flags) error
	Response(user saultregistry.UserRegistry, channel saultssh.Channel, msg saultcommon.CommandMsg, registry *saultregistry.Registry, config *Config) error
}

Command is the command interface for sault server

type Config

type Config struct {
	Server   configServer
	Registry configRegistry
	// contains filtered or unexported fields
}

Config contains configurations

func LoadConfigs

func LoadConfigs(envDirs []string) (config *Config, err error)

LoadConfigs loads configs

func NewConfig

func NewConfig() *Config

NewConfig makes config

func (*Config) Bytes

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

Bytes makes the config to []byte

func (*Config) GetBaseDirectory

func (c *Config) GetBaseDirectory() string

GetBaseDirectory returns base directory

func (*Config) SetBaseDirectory

func (c *Config) SetBaseDirectory(p string)

SetBaseDirectory set the base directory

func (*Config) Validate

func (c *Config) Validate() (err error)

Validate validates config

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the main server of sault

func NewServer

func NewServer(
	registry *saultregistry.Registry,
	config *Config,
	hostKeySigner saultssh.Signer,
	clientKeySigner saultssh.Signer,
	saultServerName string,
) (*Server, error)

NewServer makes server

func (*Server) Run

func (p *Server) Run(bind string) (err error)

Run runs sault server

Jump to

Keyboard shortcuts

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