Versions in this module Expand all Collapse all v1 v1.0.0 Nov 9, 2019 Changes in this version + const DefaultDebugPath + const DefaultHostURL + const DefaultRPCPath + const StatusUnprocessableEntity + var App appInter + var DefaultServer = NewServer() + var ErrConnect = errors.New("dial is fail") + var ErrNetwork = errors.New("connection is shut down") + var ErrShutdown = errors.New("connection is shut down") + var Unexpected = errors.New("unexpected EOF") + func AppDaemon() + func AppRestart(name, addr string, port int) + func AppStop(name, addr string, port int) + func ConvertAssign(dest, src interface{}) error + func CurrentTimeNum() int + func Exit(errorMsg ...interface{}) + func ExpandValueEnv(value string) (realValue string) + func FieldEmpty(v reflect.Value) error + func FileExists(path string) bool + func GetSysClock() int64 + func LoadConfig(project string) (e error) + func Log() *log + func ParseBool(val interface{}) (value bool, err error) + func ParseStruct(t reflect.Type, v reflect.Value, def string, sn string) (sInds []reflect.Value, eTyps []reflect.Type, defs []string, ...) + func Register(rcvr interface{}) error + func RegisterBreaker(cmd breakerCmd, rangeSec int, timeoutRatio float32, resumeSec int) + func RegisterConf(name string, adapter Config) + func RegisterName(name string, rcvr interface{}) error + func RunDay(hour, minute int, child func(), name string) + func RunDefaultTimer(tick int64, child func()) + func RunTickStopTimer(tick int64, child TickStopRun) + func ServeCodec(codec ServerCodec) + func ServeRequest(codec ServerCodec) error + func Testing() bool + func UnRegister(name string) + type CallBreak struct + func (this *CallBreak) Breaking(cmd _cmdInrer) bool + func (this *CallBreak) Call(cmd _cmdInrer, timeout bool) + func (this *CallBreak) Gotree() *CallBreak + func (this *CallBreak) RunTick() + func (this *CallBreak) StopTick() + type CallClient struct + func (this *CallClient) Close() + func (this *CallClient) Do(inArg interface{}, reply interface{}) (err error) + func (this *CallClient) Gotree(concurrency int, timeout int) *CallClient + func (this *CallClient) Start() + type CallCmd struct + Gseq string + Head string + func (this *CallCmd) Gotree(child interface{}) *CallCmd + func (this *CallCmd) Header(k string) string + func (this *CallCmd) RemoteAddr(naddr interface{}) (string, error) + func (this *CallCmd) ServiceMethod() string + func (this *CallCmd) SetHeader(k string, v string) + func (this *CallCmd) SetHttpHeader(head http.Header) + type CallController struct + func (this *CallController) CallInvoke_(conn net.Conn, gs *GotreeService) + func (this *CallController) CallName_() string + func (this *CallController) FUCK_YOU_(cmd int, result *int) error + func (this *CallController) Gotree(child interface{}) *CallController + func (this *CallController) OnCreate(method string, argv interface{}) + func (this *CallController) OnDestory(method string, reply interface{}, e error) + func (this *CallController) RemoteAddr() string + type CallQps struct + func (this *CallQps) ComQpsBeginTime(args ...interface{}) + func (this *CallQps) Gotree() *CallQps + func (this *CallQps) Qps(serviceMethod string, ms int64) + type CallRoute struct + func (this *CallRoute) GetAddrList(SerName string) *panels + func (this *CallRoute) Gotree() *CallRoute + func (this *CallRoute) LocalAddCom(name, ip, port string, id int) + type CmdHeader struct + func (this *CmdHeader) Get(src, key string) string + func (this *CmdHeader) Set(src, key, val string) string + type ComEntity struct + func (this *ComEntity) AddComObject(obj interface{}) + func (this *ComEntity) GetComObject(obj interface{}) error + func (this *ComEntity) Gotree(child interface{}) *ComEntity + func (this *ComEntity) UpdateComObject(component *ComObject) + type ComLocator struct + func (this *ComLocator) Add(obj interface{}) + func (this *ComLocator) Broadcast(fun string, arg interface{}) error + func (this *ComLocator) Exist(com interface{}) bool + func (this *ComLocator) Fetch(obj interface{}) error + func (this *ComLocator) Get(name string) interface{} + func (this *ComLocator) Gotree() *ComLocator + func (this *ComLocator) Remove(obj interface{}) + type ComNode interface + AllCom func() (list []*Panel) + BalanceAddr func() string + HashRpcAddr func(value interface{}) string + HostHashRpcAddr func(value interface{}) string + MasterAddr func() string + RandomAddr func() string + SlaveAddr func() string + type ComObject struct + func (this *ComObject) Add(obj interface{}) + func (this *ComObject) Broadcast(method string, arg interface{}) + func (this *ComObject) Get(obj interface{}) error + func (this *ComObject) Gotree() *ComObject + func (this *ComObject) Remove(obj interface{}) + type ComPanel struct + Extra []interface{} + ID int + Name string + Port string + type ConHash struct + func (this *ConHash) Add(addr interface{}) + func (this *ConHash) Check(addr interface{}) bool + func (this *ConHash) ConHash() *ConHash + func (this *ConHash) Remove(addr interface{}) + func (this *ConHash) Search(value uint32) interface{} + type Config interface + Parse func(key string) (Configer, error) + type Configer interface + DefaultBool func(key string, defaultVal bool) bool + DefaultFloat func(key string, defaultVal float64) float64 + DefaultInt func(key string, defaultVal int) int + DefaultInt64 func(key string, defaultVal int64) int64 + DefaultString func(key string, defaultVal string) string + GetSection func(section string) (map[string]string, error) + String func(key string) string + func GetConfig() Configer + func NewConfig(adapterName, filename string) (Configer, error) + type Func func() interface + func (f Func) Value() interface{} + type GotreeBase struct + func (this *GotreeBase) AddChild(parnet interface{}, child ...interface{}) + func (this *GotreeBase) AddEvent(event string, handle handlerFunc) + func (this *GotreeBase) Event(event string, args ...interface{}) + func (this *GotreeBase) GetChild(parnet interface{}) (child interface{}, err error) + func (this *GotreeBase) Gotree(child interface{}) *GotreeBase + func (this *GotreeBase) RemoveEvent(event string) + func (this *GotreeBase) TopChild() (result interface{}) + type GotreeMap struct + func (this *GotreeMap) AllKey() []interface{} + func (this *GotreeMap) DelAll() + func (this *GotreeMap) Exist(key interface{}) bool + func (this *GotreeMap) Get(key interface{}, value interface{}) error + func (this *GotreeMap) Gotree(openLock ...bool) *GotreeMap + func (this *GotreeMap) Interface(key interface{}) interface{} + func (this *GotreeMap) Remove(key interface{}) + func (this *GotreeMap) Set(key interface{}, value interface{}) + func (this *GotreeMap) SetOrStore(key interface{}, value interface{}) (v interface{}, set bool) + type GotreeService struct + func (this *GotreeService) Actions() []string + func (this *GotreeService) Calls() int + func (this *GotreeService) CancelController(name string) + func (this *GotreeService) Close() + func (this *GotreeService) Gotree() *GotreeService + func (this *GotreeService) Hook(key string, value interface{}) + func (this *GotreeService) RegController(controller interface{}) + func (this *GotreeService) Run(addr string) + func (this *GotreeService) Runtime() RuntimeStack + type Hash struct + func (this *Hash) Gotree(mod uint32) *Hash + func (this *Hash) HashNodeSum(v interface{}, modarg ...int) int + type HealthClient struct + AppRemote []... + LastInfoTime int64 + StartTime string + func (this *HealthClient) AddAppRemote(ip string, port int) + func (this *HealthClient) AddDaoByNode(name string, id int, args ...interface{}) + func (this *HealthClient) AddRemoteAddr(RemoteAddr string) + func (this *HealthClient) Close() + func (this *HealthClient) Gotree() *HealthClient + func (this *HealthClient) Start() + type HealthController struct + func (this *HealthController) AppInfo(arg interface{}, ret *string) error + func (this *HealthController) ComQps(arg interface{}, ret *string) error + func (this *HealthController) ComQpsBeginTime(arg interface{}, ret *string) error + func (this *HealthController) ComStatus(arg interface{}, ret *string) error + func (this *HealthController) DaoInfo(arg interface{}, ret *string) error + func (this *HealthController) DaoServerStatus(arg interface{}, ret *string) error + func (this *HealthController) Gotree() *HealthController + func (this *HealthController) HandShake(coms struct{ ... }, ret *int) error + func (this *HealthController) Ping(arg interface{}, ret *int) error + func (this *HealthController) ProcessId(arg interface{}, ret *int) error + type IniConfig struct + func (ini *IniConfig) Parse(name string) (Configer, error) + type IniConfigContainer struct + func (c *IniConfigContainer) Bool(key string) (bool, error) + func (c *IniConfigContainer) DefaultBool(key string, defaultval bool) bool + func (c *IniConfigContainer) DefaultFloat(key string, defaultval float64) float64 + func (c *IniConfigContainer) DefaultInt(key string, defaultval int) int + func (c *IniConfigContainer) DefaultInt64(key string, defaultval int64) int64 + func (c *IniConfigContainer) DefaultString(key string, defaultval string) string + func (c *IniConfigContainer) Float(key string) (float64, error) + func (c *IniConfigContainer) GetSection(section string) (map[string]string, error) + func (c *IniConfigContainer) Int(key string) (int, error) + func (c *IniConfigContainer) Int64(key string) (int64, error) + func (c *IniConfigContainer) String(key string) string + type KeyValue struct + Key string + Value insideVar + type Limiting struct + func (this *Limiting) Go(fun func() error) (e error) + func (this *Limiting) Gotree(count int) *Limiting + type NetConn struct + UserAgent string + func (this *NetConn) Close(pool string) (string, bool) + func (this *NetConn) Do(req *http.Request, v interface{}) (r *http.Response, err error) + func (this *NetConn) Gotree(host ...string) *NetConn + func (this *NetConn) Host() string + func (this *NetConn) NewRequest(method, path string, body interface{}) (*http.Request, error) + type ObServer struct + func (this *ObServer) AddEvent(o interface{}, handle handlerFunc) + func (this *ObServer) Event(args ...interface{}) + func (this *ObServer) Gotree() *ObServer + func (this *ObServer) RemoveEvent(o interface{}) + func (this *ObServer) SubscribeLen() int + type PB struct + func (this *PB) Next() bool + type Panel struct + Extra []interface{} + func (this *Panel) RpcAddr() string + type Request struct + Seq uint64 + ServiceMethod string + type Response struct + Error string + Seq uint64 + ServiceMethod string + type RunStack struct + func (this *RunStack) Calls() (result int) + func (this *RunStack) Del(key string) + func (this *RunStack) Eval(key string, value interface{}) error + func (this *RunStack) Get(key string) interface{} + func (this *RunStack) Gotree() *RunStack + func (this *RunStack) Remove() + func (this *RunStack) Set(key string, value interface{}) + type RuntimeStack interface + Calls func() int + Eval func(string, interface{}) error + Get func(string) interface{} + Remove func() + Set func(string, interface{}) + type Scanner interface + Scan func(src interface{}) error + type Server struct + func NewServer() *Server + func (server *Server) Close() + func (server *Server) Register(rcvr interface{}) error + func (server *Server) RegisterGotreeService(gs *GotreeService) + func (server *Server) RegisterName(name string, rcvr interface{}) error + func (server *Server) ServeCodec(codec ServerCodec) + func (server *Server) ServeRequest(codec ServerCodec) error + func (server *Server) ServiceNameList() []string + func (server *Server) UnRegister(name string) + type ServerCodec interface + Close func() error + ConnInterface func() net.Conn + ReadRequestBody func(interface{}) error + ReadRequestHeader func(*Request) error + WriteResponse func(*Response, interface{}) error + func NewServerCodec(conn net.Conn) ServerCodec + type SleepObject struct + func (this *SleepObject) Gotree() *SleepObject + func (this *SleepObject) Reset() + func (this *SleepObject) Sleep() int64 + type StopTick interface + Stop func() + func RunTick(tick int64, child func(), name string, delay int) StopTick + type TickStopRun func(stop *bool) + type Trace struct + Buf []byte + Error error + Key string + Value string + func (this *Trace) BoolValue() (bool, error) + func (this *Trace) Caller(depth int) string + func (this *Trace) CharIn(b byte, s string) int + func (this *Trace) Gotree() *Trace + func (this *Trace) HasKey() bool + func (this *Trace) HasValue() bool + func (this *Trace) IntValue() (int, error) + func (this *Trace) NewRetryListener(l net.Listener, minSleepMs, maxSleepMs int) net.Listener + func (this *Trace) NoKey() bool + func (this *Trace) NoValue() bool + func (this *Trace) Parse(str, sep string) *Trace + func (this *Trace) ParseTraceWith(str, sep string, sepIndexFn func(string, string) int) *Trace + func (this *Trace) ReadInput(prompt, def string) string + func (this *Trace) RetryListen(netname, addr string, minSleepMs, maxSleepMs int) (net.Listener, error) + func (this *Trace) Rparse(str, sep string) *Trace + func (this *Trace) SortedNumberIn(n int, nums ...int) + func (this *Trace) String() string + func (this *Trace) Trim() *Trace + func (this *Trace) ValueOrKey() string