src

package
v0.0.0-...-24f885a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// VERSION is injected by buildflags
	VERSION = "SELFBUILD"
	// SALT is use for pbkdf2 key expansion
	SALT = "kcp-go"
)

Functions

func BuildClientFlags

func BuildClientFlags() []cli.Flag

func BuildServerFlags

func BuildServerFlags() []cli.Flag

func ParseConfigFile

func ParseConfigFile(config interface{}, c *cli.Context)

func PostLoadConfig

func PostLoadConfig(config *Config)

func RunClient

func RunClient(config ClientConfig)

func RunServer

func RunServer(config ServerConfig)

func SetConfig

func SetConfig(config *Config, c *cli.Context)

Types

type ClientConfig

type ClientConfig struct {
	Conn        int `json:"conn"`
	AutoExpire  int `json:"autoexpire"`
	ScavengeTTL int `json:"scavengettl"`
	Config
}

type Config

type Config struct {
	Listen       string `json:"listen"`
	Target       string `json:"target"`
	Key          string `json:"key"`
	Crypt        string `json:"crypt"`
	Mode         string `json:"mode"`
	MTU          int    `json:"mtu"`
	SndWnd       int    `json:"sndwnd"`
	RcvWnd       int    `json:"rcvwnd"`
	DataShard    int    `json:"datashard"`
	ParityShard  int    `json:"parityshard"`
	DSCP         int    `json:"dscp"`
	NoComp       bool   `json:"nocomp"`
	AckNodelay   bool   `json:"acknodelay"`
	NoDelay      int    `json:"nodelay"`
	Interval     int    `json:"interval"`
	Resend       int    `json:"resend"`
	NoCongestion int    `json:"nc"`
	SockBuf      int    `json:"sockbuf"`
	KeepAlive    int    `json:"keepalive"`
	Log          string `json:"log"`
	SnmpLog      string `json:"snmplog"`
	SnmpPeriod   int    `json:"snmpperiod"`
	Quiet        bool   `json:"quiet"`
}

type ServerConfig

type ServerConfig struct {
	Pprof bool `json:"pprof"`
	Config
}

Jump to

Keyboard shortcuts

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