Documentation
¶
Index ¶
- func ClientConfigDir(baseDir string) string
- func ClientConfigFile(baseDir, user string) string
- func ClientPwdDir(baseDir string) string
- func ClientPwdFile(baseDir, user string) string
- func Dial(configPath string) (*tls.Conn, error)
- func GenerateKeyAndCert(baseDir, host string) error
- func LoadKeyAndCert(baseDir string) ([]byte, []byte, error)
- func RpcServeForever(baseDir string, obj interface{}) error
- func ServerCertPath(baseDir string) string
- func ServerConfigPath(baseDir string) string
- func ServerKeyPath(baseDir string) string
- type ClientConfig
- type PwdFile
- type PwdHandler
- type RpcClient
- type ServerConfig
- type TtListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientConfigDir ¶
func ClientConfigFile ¶
func ClientPwdDir ¶
func ClientPwdFile ¶
func Dial ¶
Dial is a wrapper for tls.Dial. It uses a configuration file containing the remote address, username, password, and certificate.
func GenerateKeyAndCert ¶
Function that generates certificates. Mostly coppied from http://golang.org/src/pkg/crypto/tls/generate_cert.go.
func LoadKeyAndCert ¶
LoadKeyAndCert reads the key and certificate files into memory and returns them in that order.
func RpcServeForever ¶
func ServerCertPath ¶
func ServerConfigPath ¶
func ServerKeyPath ¶
Types ¶
type ClientConfig ¶
type ClientConfig struct { Host string // The host address: <address>:<port>. User string // The username for the client. Pwd []byte // The user's password. CaCert []byte // The CA certificate. }
ClientConfig: A configuration file for a client.
func LoadClientConfig ¶
func LoadClientConfig(path string) (*ClientConfig, error)
Load: Load the client's configuration from the given path.
func (ClientConfig) Save ¶
func (cc ClientConfig) Save(path string) error
Save: Save the client's configuration to the given path.
type PwdFile ¶
type PwdFile struct {
PwdHash []byte
}
PwdFile: A password file (on the server) for a client.
func LoadPwdFile ¶
LoadPwdFile: Load a password file for the given user.
type PwdHandler ¶
type PwdHandler struct {
// contains filtered or unexported fields
}
PwdHandler provides an interface for requesting user's passwords.
func NewPwdHandler ¶
func NewPwdHandler(baseDir string) *PwdHandler
func (*PwdHandler) GetPwdHash ¶
func (ph *PwdHandler) GetPwdHash(user string) ([]byte, error)
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
Client: A wrapper for rpc.Client that performs automatic reconnects.
type ServerConfig ¶
type ServerConfig struct { ListenAddr string // The address to pass to Listen. PublicAddr string // The address to use to connect to the server. }
ServerConfig: A configuration file for a server.
func LoadServerConfig ¶
func LoadServerConfig(baseDir string) (*ServerConfig, error)
LoadServerConfig: Load the server's configuration from the given baseDir.
func (ServerConfig) Save ¶
func (sc ServerConfig) Save(baseDir string) error
Save: Save the server's configuration to the given baseDir.
type TtListener ¶
type TtListener struct {
// contains filtered or unexported fields
}
func (*TtListener) Addr ¶
func (ln *TtListener) Addr() net.Addr
func (*TtListener) Close ¶
func (ln *TtListener) Close() error