Documentation ¶
Overview ¶
Copyright 2020 newtbig Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 newtbig Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type App
- type CallBack
- type Connect
- type Dispatcher
- type DisposeFunc
- type FuncVerify
- type Gate
- type Option
- func ByteOrder(t bool) Option
- func Conf(cName string) Option
- func Debug(t bool) Option
- func DisLen(t uint32) Option
- func DisRep(t uint32) Option
- func ExitWaitTTL(t time.Duration) Option
- func Metadata(md map[string]string) Option
- func NetHeadSize(t uint16) Option
- func NetType(nt string) Option
- func Parse(t bool) Option
- func Process(p Processor) Option
- func RPCExpired(t time.Duration) Option
- func RPCMaxCoroutine(t uint32) Option
- func ReadDeadline(t int64) Option
- func RegisterInterval(t time.Duration) Option
- func RegisterTTL(t int) Option
- func Serv(s Server) Option
- func Version(v string) Option
- func Wait(b bool) Option
- func WorkDir(v string) Option
- func WriteDeadline(t int64) Option
- type Options
- type Processor
- type RPC
- type Server
- type Service
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { UpdateOptions(opts ...Option) error Run(opts ...Option) error OnInit() error OnDestroy() error Options() Options OnRegiste(func(app App)) error GetProcessID() string WorkDir() string SetVerify(_func FuncVerify) error GetVerify() FuncVerify GetKeysAPI() eclient.KV GetEClient() *etcdclient.ETCDClient GetRPC() RPC GetDispatcher() Dispatcher Register(msgID uint32, msgHandler DisposeFunc) RegisteSer(id uint32, key string) error IsGate() bool }
type Dispatcher ¶
type Dispatcher interface { RegisteSer(id uint32, key string) error Route(msg *framepb.Msg) (string, error) RouteB(msg *framepb.Msg) ([]string, error) GetServer(sType string, id uint64) ([]byte, error) GetGate(id uint64) ([]byte, error) GetStatus() ([]byte, error) CheckRoute(key uint64) bool Start() error Stop() error Clear() error }
type FuncVerify ¶
type FuncVerify func(interface{}) bool
type Gate ¶
type Gate interface { App SetVerify(_func FuncVerify) error GetVerify() FuncVerify }
type Option ¶
type Option func(*Options)
func ExitWaitTTL ¶
func NetHeadSize ¶
func RPCExpired ¶
func RPCMaxCoroutine ¶
func ReadDeadline ¶
func RegisterInterval ¶
func RegisterTTL ¶
func WriteDeadline ¶
type Options ¶
type Options struct { Context context.Context HostName string PID string Metadata map[string]string Version string RunMode string Debug bool Parse bool WorkDir string AppName string ConfName string ETCDHosts []string NetType string ServerType string ServerName string ServerIP string ServerIPOut string ServerPort string ServerConTypes []string HeartBeatInterval int64 ExitWaitTTL time.Duration RegisterInterval time.Duration RegisterTTL int RPCExpired time.Duration RPCMaxCoroutine uint32 MaxConn int32 MaxPacketSize int64 ReadDeadline int64 WriteDeadline int64 RpmLimit uint32 MaxMsgChanLen uint32 NetHeadSize uint16 ByteOrder bool NatsHosts []string Serv Server Process Processor Rpc RPC DisLen uint32 DisRep uint32 }