config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CMD_PING string = "ping"
	CMD_MEM  string = "mem"
)

Variables

View Source
var TSessionSessionType_name = map[int32]string{
	0: "CONNECTOR",
	1: "LOGIC",
	2: "CMD",
}
View Source
var TSessionSessionType_value = map[string]int32{
	"CONNECTOR": 0,
	"LOGIC":     1,
	"CMD":       2,
}

Functions

This section is empty.

Types

type CmdMsg

type CmdMsg struct {
	RunRoutineNum        int64    `protobuf:"varint,1,opt,name=runRoutineNum,proto3" json:"runRoutineNum,omitempty"`
	Data                 []byte   `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CmdMsg) Descriptor

func (*CmdMsg) Descriptor() ([]byte, []int)

func (*CmdMsg) GetData

func (m *CmdMsg) GetData() []byte

func (*CmdMsg) GetRunRoutineNum

func (m *CmdMsg) GetRunRoutineNum() int64

func (*CmdMsg) ProtoMessage

func (*CmdMsg) ProtoMessage()

func (*CmdMsg) Reset

func (m *CmdMsg) Reset()

func (*CmdMsg) String

func (m *CmdMsg) String() string

func (*CmdMsg) XXX_DiscardUnknown

func (m *CmdMsg) XXX_DiscardUnknown()

func (*CmdMsg) XXX_Marshal

func (m *CmdMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CmdMsg) XXX_Merge

func (m *CmdMsg) XXX_Merge(src proto.Message)

func (*CmdMsg) XXX_Size

func (m *CmdMsg) XXX_Size() int

func (*CmdMsg) XXX_Unmarshal

func (m *CmdMsg) XXX_Unmarshal(b []byte) error

type Config

type Config struct {
	Natsconf   Natsconfig   `json:"natsconfig"`
	MasterConf MasterConfig `json:"master"`
	LogConf    LogConfig    `json:"log"`

	Connector []*ConnectorConfig `json:"connector"`
	Servers   []*ServersConfig   `json:"servers"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(filePath string) (*Config, error)

func (*Config) GetConConfByServerId

func (c *Config) GetConConfByServerId(serverId string) *ConnectorConfig

func (*Config) GetMasterConf

func (c *Config) GetMasterConf() *MasterConfig

func (*Config) GetServerByType

func (c *Config) GetServerByType(serverType string) []*ServersConfig

func (*Config) GetServerConfByServerId

func (c *Config) GetServerConfByServerId(serverId string) *ServersConfig

type ConnectorConfig

type ConnectorConfig struct {
	ID         string `json:"id"`
	Host       string `json:"host"`
	ClientPort int    `json:"clientPort"`
	Frontend   bool   `json:"frontend"`
}

type LogConfig

type LogConfig struct {
	Encoding   string `json:"encoding"`
	Level      string `json:"level"`
	MaxLogSize int64  `json:"maxLogSize"`
	NumBackups int    `json:"numBackups"`
}

type MasterConfig

type MasterConfig struct {
	ID             string `json:"id"`
	NodeHeartBeart int    `json:"nodeHeartBeart"`
}

type Natsconfig

type Natsconfig struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

type ServersConfig

type ServersConfig struct {
	ID               string `json:"id"`
	ServerType       string `json:"serverType"`
	HandleTimeOut    int    `json:"handleTimeOut"`
	RPCTimeOut       int    `json:"rpcTimeOut"`
	MaxRunRoutineNum int    `json:"maxRunRoutineNum"`
}

type TSession

type TSession struct {
	Cid                  string              `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"`
	SrcSubRouter         string              `protobuf:"bytes,2,opt,name=srcSubRouter,proto3" json:"srcSubRouter,omitempty"`
	DstSubRouter         string              `protobuf:"bytes,3,opt,name=dstSubRouter,proto3" json:"dstSubRouter,omitempty"`
	Body                 []byte              `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	St                   TSessionSessionType `protobuf:"varint,5,opt,name=st,proto3,enum=config.TSessionSessionType" json:"st,omitempty"`
	ReplyToken           string              `protobuf:"bytes,6,opt,name=replyToken,proto3" json:"replyToken,omitempty"`
	Router               string              `protobuf:"bytes,7,opt,name=router,proto3" json:"router,omitempty"`
	LogicBindId          string              `protobuf:"bytes,8,opt,name=logicBindId,proto3" json:"logicBindId,omitempty"`
	RpcRespCode          int32               `protobuf:"varint,9,opt,name=rpcRespCode,proto3" json:"rpcRespCode,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

func (*TSession) Descriptor

func (*TSession) Descriptor() ([]byte, []int)

func (*TSession) GetBody

func (m *TSession) GetBody() []byte

func (*TSession) GetCid

func (m *TSession) GetCid() string

func (*TSession) GetDstSubRouter

func (m *TSession) GetDstSubRouter() string

func (*TSession) GetLogicBindId

func (m *TSession) GetLogicBindId() string

func (*TSession) GetReplyToken

func (m *TSession) GetReplyToken() string

func (*TSession) GetRouter

func (m *TSession) GetRouter() string

func (*TSession) GetRpcRespCode

func (m *TSession) GetRpcRespCode() int32

func (*TSession) GetSrcSubRouter

func (m *TSession) GetSrcSubRouter() string

func (*TSession) GetSt

func (m *TSession) GetSt() TSessionSessionType

func (*TSession) ProtoMessage

func (*TSession) ProtoMessage()

func (*TSession) Reset

func (m *TSession) Reset()

func (*TSession) String

func (m *TSession) String() string

func (*TSession) XXX_DiscardUnknown

func (m *TSession) XXX_DiscardUnknown()

func (*TSession) XXX_Marshal

func (m *TSession) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TSession) XXX_Merge

func (m *TSession) XXX_Merge(src proto.Message)

func (*TSession) XXX_Size

func (m *TSession) XXX_Size() int

func (*TSession) XXX_Unmarshal

func (m *TSession) XXX_Unmarshal(b []byte) error

type TSessionSessionType

type TSessionSessionType int32
const (
	TSession_CONNECTOR TSessionSessionType = 0
	TSession_LOGIC     TSessionSessionType = 1
	TSession_CMD       TSessionSessionType = 2
)

func (TSessionSessionType) EnumDescriptor

func (TSessionSessionType) EnumDescriptor() ([]byte, []int)

func (TSessionSessionType) String

func (x TSessionSessionType) String() string

Jump to

Keyboard shortcuts

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