Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePasswordHash ¶
GeneratePasswordHash is used to generate password hash.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the accelerator client.
func NewClient ¶
func NewClient(cfg *ClientConfig) (*Client, error)
NewClient is used to create a new client from configuration.
type ClientConfig ¶
type ClientConfig struct { Common struct { Interface string `toml:"interface"` PassHash string `toml:"pwd_hash"` LogPath string `toml:"log_path"` } `toml:"common"` Client struct { Mode string `toml:"mode"` ConnPoolSize int `toml:"conn_pool_size"` Timeout duration `toml:"timeout"` } `toml:"client"` TCP struct { RemoteNetwork string `toml:"remote_network"` RemoteAddress string `toml:"remote_address"` LocalNetwork string `toml:"local_network"` LocalAddress string `toml:"local_address"` } `toml:"tcp"` UDP struct { RemoteNetwork string `toml:"remote_network"` RemoteAddress string `toml:"remote_address"` LocalNetwork string `toml:"local_network"` LocalAddress string `toml:"local_address"` } `toml:"udp"` TLS struct { ClientCert string `toml:"client_cert"` ClientKey string `toml:"client_key"` RootCA string `toml:"root_ca"` } `toml:"tls"` TAP struct { ComponentID string `toml:"component_id"` DeviceName string `toml:"device_name"` } `toml:"tap"` }
ClientConfig contains accelerator client configurations.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the accelerator server.
func NewServer ¶
func NewServer(cfg *ServerConfig) (*Server, error)
NewServer is used to create a new server from configuration.
type ServerConfig ¶
type ServerConfig struct { Common struct { Interface string `toml:"interface"` PassHash string `toml:"pwd_hash"` LogPath string `toml:"log_path"` } `toml:"common"` Server struct { ConnPoolSize int `toml:"conn_pool_size"` NumFrameSender int `toml:"num_frame_sender"` Timeout duration `toml:"timeout"` } `toml:"server"` TCP struct { Enabled bool `toml:"enabled"` Network string `toml:"network"` Address string `toml:"address"` } `toml:"tcp"` UDP struct { Enabled bool `toml:"enabled"` Network string `toml:"network"` Address string `toml:"address"` } `toml:"udp"` TLS struct { ServerCert string `toml:"server_cert"` ServerKey string `toml:"server_key"` ClientCA string `toml:"client_ca"` } `toml:"tls"` NAT struct { Enabled bool `toml:"enabled"` Timeout duration `toml:"timeout"` MAC struct { Local string `toml:"local"` Gateway string `toml:"gateway"` } `toml:"mac"` IPv4 struct { Enabled bool `toml:"enabled"` Local string `toml:"local"` Gateway string `toml:"gateway"` } `toml:"ipv4"` IPv6 struct { Enabled bool `toml:"enabled"` Local string `toml:"local"` Gateway string `toml:"gateway"` } `toml:"ipv6"` } `toml:"nat"` }
ServerConfig contains accelerator server configurations.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.