Documentation ¶
Index ¶
- Constants
- Variables
- func AddJob(networkId string, fn func(networkId string) error)
- func Base64Decode(str string) (string, error)
- func ExecCommand(name string, commands ...string) error
- func GetDaemon() *daemon.Context
- func GetFrameTypeName(key uint16) (name string)
- func GetPacketHeader(buff []byte) (packet.Header, error)
- func ReplaceLocalConfig(newCfg *LocalConfig) error
- func StringToBase64(str string) string
- func UpdateLocalConfig(newCfg *LocalConfig) error
- type Auth
- type Config
- type Encrypt
- type IPHeader
- type IPV6Cfg
- type Local
- type LocalConfig
- type LocalInfo
- type LogCfg
- type NodeCfg
- func (cfg *NodeCfg) AuthEnable() bool
- func (cfg *NodeCfg) ControlUrl() string
- func (cfg *NodeCfg) EnableAuth() bool
- func (cfg *NodeCfg) EnableEncrypt() bool
- func (cfg *NodeCfg) EnableRelay() bool
- func (cfg *NodeCfg) HostUrl() string
- func (cfg *NodeCfg) HttpListenStr() string
- func (cfg *NodeCfg) RegistryUrl() string
- type Protocol
- type Redis
- type RegistryCfg
- type Relay
- type Star
- type SuperStar
- type UserFunc
Constants ¶
Variables ¶
View Source
var (
UCTL = &user{
UserId: "123456789abcdef0",
}
)
Functions ¶
func Base64Decode ¶
func ExecCommand ¶
func GetFrameTypeName ¶
func ReplaceLocalConfig ¶
func ReplaceLocalConfig(newCfg *LocalConfig) error
ReplaceLocalConfig update json file
func StringToBase64 ¶
func UpdateLocalConfig ¶
func UpdateLocalConfig(newCfg *LocalConfig) error
UpdateLocalConfig update json file
Types ¶
type Config ¶
type Config struct { NodeCfg *NodeCfg `mapstructure:"node"` RegistryCfg *RegistryCfg `mapstructure:"registry"` }
func InitConfig ¶
type IPHeader ¶
func GetIPFrameHeader ¶
GetIPFrameHeader return srcIP, destIP
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
func (*Local) ReadFile ¶
func (l *Local) ReadFile() (config *LocalConfig, err error)
func (*Local) WriteFile ¶
func (l *Local) WriteFile(config *LocalConfig) error
type LocalConfig ¶
type LocalConfig struct { Auth string `json:"auth,omitempty"` AppId string `json:"appId,omitempty"` UserId string `json:"userId,omitempty"` Debug bool `json:"debug,omitempty"` }
func GetLocalConfig ¶
func GetLocalConfig() (*LocalConfig, error)
type LocalInfo ¶
type LocalInfo struct { Username string `json:"username"` Password string `json:"password"` UserId string `json:"userId"` }
func GetLocalUserInfo ¶
type NodeCfg ¶
type NodeCfg struct { Registry string `mapstructure:"registry"` Udp string `mapstructure:"udp"` Listen int `mapstructure:"listen"` HttpListen string `mapstructure:"httpListen"` ConsoleUrl string `mapstructure:"consoleUrl"` //Protocol Protocol `mapstructure:"type"` Offset int32 `mapstructure:"offset"` Encrypt Encrypt `mapstructure:"encrypt"` Auth Auth `mapstructure:"auth"` Relay Relay `mapstructure:"relay"` Log LogCfg `mapstructure:"log"` IPV6 IPV6Cfg `mapstructure:"ipv6"` Driver string `mapstructure:"driver"` }
NodeCfg read from a config file or cmd flags, node and registry configurations are here.
func (*NodeCfg) AuthEnable ¶
func (*NodeCfg) ControlUrl ¶
func (*NodeCfg) EnableAuth ¶
func (*NodeCfg) EnableEncrypt ¶
func (*NodeCfg) EnableRelay ¶
func (*NodeCfg) HttpListenStr ¶
func (*NodeCfg) RegistryUrl ¶
type RegistryCfg ¶
Click to show internal directories.
Click to hide internal directories.