logic

package
v0.0.0-...-d47803c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthLogic        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLogic          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLogic = fmt.Errorf("proto: unexpected end of group")
)
View Source
var EnterRoomDataRoomType_name = map[int32]string{
	0: "None",
	1: "Public",
	2: "PwdRoom",
}
View Source
var EnterRoomDataRoomType_value = map[string]int32{
	"None":    0,
	"Public":  1,
	"PwdRoom": 2,
}
View Source
var GateTologicMsgSerializeType_name = map[int32]string{
	0: "None",
	1: "Json",
	2: "Protobuf",
}
View Source
var GateTologicMsgSerializeType_value = map[string]int32{
	"None":     0,
	"Json":     1,
	"Protobuf": 2,
}
View Source
var LogicCmd_name = map[int32]string{
	0:    "None",
	1:    "EnterRoom",
	2:    "ExitRoom",
	3:    "Talk",
	1001: "Login",
	1002: "UnLogin",
}
View Source
var LogicCmd_value = map[string]int32{
	"None":      0,
	"EnterRoom": 1,
	"ExitRoom":  2,
	"Talk":      3,
	"Login":     1001,
	"UnLogin":   1002,
}
View Source
var TalkDataToType_name = map[int32]string{
	0: "None",
	1: "Conn",
	2: "All",
	3: "User",
	4: "Room",
}
View Source
var TalkDataToType_value = map[string]int32{
	"None": 0,
	"Conn": 1,
	"All":  2,
	"User": 3,
	"Room": 4,
}

Functions

func NewXClientForLogic

func NewXClientForLogic(addr string) (client.XClient, error)

NewXClientForLogic creates a XClient. You can configure this client with more options such as etcd registry, serialize type, select algorithm and fail mode.

func ServeForLogic

func ServeForLogic(addr string) error

ServeForLogic starts a server only registers one service. You can register more services and only start one server. It blocks until the application exits.

Types

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

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

func (*Empty) Marshal

func (m *Empty) Marshal() (dAtA []byte, err error)

func (*Empty) MarshalTo

func (m *Empty) MarshalTo(dAtA []byte) (int, error)

func (*Empty) MarshalToSizedBuffer

func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) Size

func (m *Empty) Size() (n int)

func (*Empty) String

func (m *Empty) String() string

func (*Empty) Unmarshal

func (m *Empty) Unmarshal(dAtA []byte) error

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

type EnterRoomData

type EnterRoomData struct {
	RID                  int64    `protobuf:"varint,1,opt,name=rID,proto3" json:"rID,omitempty"`
	RType                int64    `protobuf:"varint,2,opt,name=rType,proto3" json:"rType,omitempty"`
	Pwd                  string   `protobuf:"bytes,3,opt,name=pwd,proto3" json:"pwd,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

EnterRoomData LogicCmd = EnterRoom = 1;

func (*EnterRoomData) Descriptor

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

func (*EnterRoomData) GetPwd

func (m *EnterRoomData) GetPwd() string

func (*EnterRoomData) GetRID

func (m *EnterRoomData) GetRID() int64

func (*EnterRoomData) GetRType

func (m *EnterRoomData) GetRType() int64

func (*EnterRoomData) Marshal

func (m *EnterRoomData) Marshal() (dAtA []byte, err error)

func (*EnterRoomData) MarshalTo

func (m *EnterRoomData) MarshalTo(dAtA []byte) (int, error)

func (*EnterRoomData) MarshalToSizedBuffer

func (m *EnterRoomData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EnterRoomData) ProtoMessage

func (*EnterRoomData) ProtoMessage()

func (*EnterRoomData) Reset

func (m *EnterRoomData) Reset()

func (*EnterRoomData) Size

func (m *EnterRoomData) Size() (n int)

func (*EnterRoomData) String

func (m *EnterRoomData) String() string

func (*EnterRoomData) Unmarshal

func (m *EnterRoomData) Unmarshal(dAtA []byte) error

func (*EnterRoomData) XXX_DiscardUnknown

func (m *EnterRoomData) XXX_DiscardUnknown()

func (*EnterRoomData) XXX_Marshal

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

func (*EnterRoomData) XXX_Merge

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

func (*EnterRoomData) XXX_Size

func (m *EnterRoomData) XXX_Size() int

func (*EnterRoomData) XXX_Unmarshal

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

type EnterRoomDataRoomType

type EnterRoomDataRoomType int32
const (
	EnterRoomData_None    EnterRoomDataRoomType = 0
	EnterRoomData_Public  EnterRoomDataRoomType = 1
	EnterRoomData_PwdRoom EnterRoomDataRoomType = 2
)

func (EnterRoomDataRoomType) EnumDescriptor

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

func (EnterRoomDataRoomType) String

func (x EnterRoomDataRoomType) String() string

type ExitRoomData

type ExitRoomData struct {
	RID                  int64    `protobuf:"varint,1,opt,name=rID,proto3" json:"rID,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ExitRoomData LogicCmd = ExitRoom = 2;

func (*ExitRoomData) Descriptor

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

func (*ExitRoomData) GetRID

func (m *ExitRoomData) GetRID() int64

func (*ExitRoomData) Marshal

func (m *ExitRoomData) Marshal() (dAtA []byte, err error)

func (*ExitRoomData) MarshalTo

func (m *ExitRoomData) MarshalTo(dAtA []byte) (int, error)

func (*ExitRoomData) MarshalToSizedBuffer

func (m *ExitRoomData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ExitRoomData) ProtoMessage

func (*ExitRoomData) ProtoMessage()

func (*ExitRoomData) Reset

func (m *ExitRoomData) Reset()

func (*ExitRoomData) Size

func (m *ExitRoomData) Size() (n int)

func (*ExitRoomData) String

func (m *ExitRoomData) String() string

func (*ExitRoomData) Unmarshal

func (m *ExitRoomData) Unmarshal(dAtA []byte) error

func (*ExitRoomData) XXX_DiscardUnknown

func (m *ExitRoomData) XXX_DiscardUnknown()

func (*ExitRoomData) XXX_Marshal

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

func (*ExitRoomData) XXX_Merge

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

func (*ExitRoomData) XXX_Size

func (m *ExitRoomData) XXX_Size() int

func (*ExitRoomData) XXX_Unmarshal

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

type GateTologicMsg

type GateTologicMsg struct {
	From                 int64                       `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
	ServerId             int64                       `protobuf:"varint,2,opt,name=serverId,proto3" json:"serverId,omitempty"`
	Serialize            GateTologicMsgSerializeType `protobuf:"varint,3,opt,name=serialize,proto3,enum=logic.GateTologicMsgSerializeType" json:"serialize,omitempty"`
	Data                 []byte                      `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func (*GateTologicMsg) Descriptor

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

func (*GateTologicMsg) GetData

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

func (*GateTologicMsg) GetFrom

func (m *GateTologicMsg) GetFrom() int64

func (*GateTologicMsg) GetSerialize

func (m *GateTologicMsg) GetSerialize() GateTologicMsgSerializeType

func (*GateTologicMsg) GetServerId

func (m *GateTologicMsg) GetServerId() int64

func (*GateTologicMsg) Marshal

func (m *GateTologicMsg) Marshal() (dAtA []byte, err error)

func (*GateTologicMsg) MarshalTo

func (m *GateTologicMsg) MarshalTo(dAtA []byte) (int, error)

func (*GateTologicMsg) MarshalToSizedBuffer

func (m *GateTologicMsg) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GateTologicMsg) ProtoMessage

func (*GateTologicMsg) ProtoMessage()

func (*GateTologicMsg) Reset

func (m *GateTologicMsg) Reset()

func (*GateTologicMsg) Size

func (m *GateTologicMsg) Size() (n int)

func (*GateTologicMsg) String

func (m *GateTologicMsg) String() string

func (*GateTologicMsg) Unmarshal

func (m *GateTologicMsg) Unmarshal(dAtA []byte) error

func (*GateTologicMsg) XXX_DiscardUnknown

func (m *GateTologicMsg) XXX_DiscardUnknown()

func (*GateTologicMsg) XXX_Marshal

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

func (*GateTologicMsg) XXX_Merge

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

func (*GateTologicMsg) XXX_Size

func (m *GateTologicMsg) XXX_Size() int

func (*GateTologicMsg) XXX_Unmarshal

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

type GateTologicMsgSerializeType

type GateTologicMsgSerializeType int32
const (
	GateTologicMsg_None     GateTologicMsgSerializeType = 0
	GateTologicMsg_Json     GateTologicMsgSerializeType = 1
	GateTologicMsg_Protobuf GateTologicMsgSerializeType = 2
)

func (GateTologicMsgSerializeType) EnumDescriptor

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

func (GateTologicMsgSerializeType) String

type LogicAble

type LogicAble interface {

	// GateToLogic is server rpc method as defined
	GateToLogic(ctx context.Context, args *GateTologicMsg, reply *Empty) (err error)

	// ConnectionBegin is server rpc method as defined
	ConnectionBegin(ctx context.Context, args *GateTologicMsg, reply *Empty) (err error)

	// ConnectionLost is server rpc method as defined
	ConnectionLost(ctx context.Context, args *GateTologicMsg, reply *Empty) (err error)
}

================== interface skeleton ===================

type LogicClient

type LogicClient struct {
	// contains filtered or unexported fields
}

================== client stub =================== Logic is a client wrapped XClient.

func NewLogicClient

func NewLogicClient(xclient client.XClient) *LogicClient

NewLogicClient wraps a XClient as LogicClient. You can pass a shared XClient object created by NewXClientForLogic.

func (*LogicClient) ConnectionBegin

func (c *LogicClient) ConnectionBegin(ctx context.Context, args *GateTologicMsg) (reply *Empty, err error)

ConnectionBegin is client rpc method as defined

func (*LogicClient) ConnectionLost

func (c *LogicClient) ConnectionLost(ctx context.Context, args *GateTologicMsg) (reply *Empty, err error)

ConnectionLost is client rpc method as defined

func (*LogicClient) GateToLogic

func (c *LogicClient) GateToLogic(ctx context.Context, args *GateTologicMsg) (reply *Empty, err error)

GateToLogic is client rpc method as defined

type LogicCmd

type LogicCmd int32
const (
	LogicCmd_None      LogicCmd = 0
	LogicCmd_EnterRoom LogicCmd = 1
	LogicCmd_ExitRoom  LogicCmd = 2
	LogicCmd_Talk      LogicCmd = 3
	LogicCmd_Login     LogicCmd = 1001
	LogicCmd_UnLogin   LogicCmd = 1002
)

func (LogicCmd) EnumDescriptor

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

func (LogicCmd) String

func (x LogicCmd) String() string

type LogicData

type LogicData struct {
	Cmd                  LogicCmd `protobuf:"varint,1,opt,name=cmd,proto3,enum=logic.LogicCmd" json:"cmd,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 (*LogicData) Descriptor

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

func (*LogicData) GetCmd

func (m *LogicData) GetCmd() LogicCmd

func (*LogicData) GetData

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

func (*LogicData) Marshal

func (m *LogicData) Marshal() (dAtA []byte, err error)

func (*LogicData) MarshalTo

func (m *LogicData) MarshalTo(dAtA []byte) (int, error)

func (*LogicData) MarshalToSizedBuffer

func (m *LogicData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LogicData) ProtoMessage

func (*LogicData) ProtoMessage()

func (*LogicData) Reset

func (m *LogicData) Reset()

func (*LogicData) Size

func (m *LogicData) Size() (n int)

func (*LogicData) String

func (m *LogicData) String() string

func (*LogicData) Unmarshal

func (m *LogicData) Unmarshal(dAtA []byte) error

func (*LogicData) XXX_DiscardUnknown

func (m *LogicData) XXX_DiscardUnknown()

func (*LogicData) XXX_Marshal

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

func (*LogicData) XXX_Merge

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

func (*LogicData) XXX_Size

func (m *LogicData) XXX_Size() int

func (*LogicData) XXX_Unmarshal

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

type LogicImpl

type LogicImpl struct{}

================== server skeleton ===================

func (*LogicImpl) ConnectionBegin

func (s *LogicImpl) ConnectionBegin(ctx context.Context, args *GateTologicMsg, reply *Empty) (err error)

ConnectionBegin is server rpc method as defined

func (*LogicImpl) ConnectionLost

func (s *LogicImpl) ConnectionLost(ctx context.Context, args *GateTologicMsg, reply *Empty) (err error)

ConnectionLost is server rpc method as defined

func (*LogicImpl) GateToLogic

func (s *LogicImpl) GateToLogic(ctx context.Context, args *GateTologicMsg, reply *Empty) (err error)

GateToLogic is server rpc method as defined

type LogicOneClient

type LogicOneClient struct {
	// contains filtered or unexported fields
}

================== oneclient stub =================== LogicOneClient is a client wrapped oneClient.

func NewLogicOneClient

func NewLogicOneClient(oneclient *client.OneClient) *LogicOneClient

NewLogicOneClient wraps a OneClient as LogicOneClient. You can pass a shared OneClient object created by NewOneClientForLogic.

func (*LogicOneClient) ConnectionBegin

func (c *LogicOneClient) ConnectionBegin(ctx context.Context, args *GateTologicMsg) (reply *Empty, err error)

ConnectionBegin is client rpc method as defined

func (*LogicOneClient) ConnectionLost

func (c *LogicOneClient) ConnectionLost(ctx context.Context, args *GateTologicMsg) (reply *Empty, err error)

ConnectionLost is client rpc method as defined

func (*LogicOneClient) GateToLogic

func (c *LogicOneClient) GateToLogic(ctx context.Context, args *GateTologicMsg) (reply *Empty, err error)

GateToLogic is client rpc method as defined

type TalkData

type TalkData struct {
	To                   int64          `protobuf:"varint,1,opt,name=to,proto3" json:"to,omitempty"`
	TType                TalkDataToType `protobuf:"varint,2,opt,name=tType,proto3,enum=logic.TalkDataToType" json:"tType,omitempty"`
	Data                 []byte         `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

TalkData LogicCmd = Talk = 3;

func (*TalkData) Descriptor

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

func (*TalkData) GetData

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

func (*TalkData) GetTType

func (m *TalkData) GetTType() TalkDataToType

func (*TalkData) GetTo

func (m *TalkData) GetTo() int64

func (*TalkData) Marshal

func (m *TalkData) Marshal() (dAtA []byte, err error)

func (*TalkData) MarshalTo

func (m *TalkData) MarshalTo(dAtA []byte) (int, error)

func (*TalkData) MarshalToSizedBuffer

func (m *TalkData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TalkData) ProtoMessage

func (*TalkData) ProtoMessage()

func (*TalkData) Reset

func (m *TalkData) Reset()

func (*TalkData) Size

func (m *TalkData) Size() (n int)

func (*TalkData) String

func (m *TalkData) String() string

func (*TalkData) Unmarshal

func (m *TalkData) Unmarshal(dAtA []byte) error

func (*TalkData) XXX_DiscardUnknown

func (m *TalkData) XXX_DiscardUnknown()

func (*TalkData) XXX_Marshal

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

func (*TalkData) XXX_Merge

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

func (*TalkData) XXX_Size

func (m *TalkData) XXX_Size() int

func (*TalkData) XXX_Unmarshal

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

type TalkDataToType

type TalkDataToType int32
const (
	TalkData_None TalkDataToType = 0
	TalkData_Conn TalkDataToType = 1
	TalkData_All  TalkDataToType = 2
	TalkData_User TalkDataToType = 3
	TalkData_Room TalkDataToType = 4
)

func (TalkDataToType) EnumDescriptor

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

func (TalkDataToType) String

func (x TalkDataToType) String() string

Jump to

Keyboard shortcuts

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