pbf

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthBroadcast        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBroadcast          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBroadcast = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthRouter        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRouter          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRouter = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthUdp        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowUdp          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupUdp = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthWebsocket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowWebsocket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupWebsocket = fmt.Errorf("proto: unexpected end of group")
)
View Source
var MsgType_name = map[int32]string{
	0: "UNKNOW_MsgType",
	1: "TextMsg",
	2: "BinaryMsg",
	3: "PingMsg",
	4: "PongMsg",
}
View Source
var MsgType_value = map[string]int32{
	"UNKNOW_MsgType": 0,
	"TextMsg":        1,
	"BinaryMsg":      2,
	"PingMsg":        3,
	"PongMsg":        4,
}

Functions

func RegisterBroadcastServer

func RegisterBroadcastServer(s *grpc.Server, srv BroadcastServer)

func RegisterRouterServer

func RegisterRouterServer(s *grpc.Server, srv RouterServer)

Types

type BroadcastClient

type BroadcastClient interface {
	Frontend(ctx context.Context, in *QueueMsg, opts ...grpc.CallOption) (*Status, error)
}

BroadcastClient is the client API for Broadcast service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewBroadcastClient

func NewBroadcastClient(cc *grpc.ClientConn) BroadcastClient

type BroadcastServer

type BroadcastServer interface {
	Frontend(context.Context, *QueueMsg) (*Status, error)
}

BroadcastServer is the server API for Broadcast service.

type MsgType added in v0.1.9

type MsgType int32
const (
	MsgType_UNKNOW_MsgType MsgType = 0
	MsgType_TextMsg        MsgType = 1
	MsgType_BinaryMsg      MsgType = 2
	MsgType_PingMsg        MsgType = 3
	MsgType_PongMsg        MsgType = 4
)

func (MsgType) EnumDescriptor added in v0.1.9

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

func (MsgType) String added in v0.1.9

func (x MsgType) String() string

type Package added in v0.1.9

type Package struct {
	Type                 MsgType  `protobuf:"varint,1,opt,name=Type,proto3,enum=pbf.MsgType" json:"Type,omitempty"`
	Payload              []byte   `protobuf:"bytes,2,opt,name=Payload,proto3" json:"Payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Package) Descriptor added in v0.1.9

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

func (*Package) GetPayload added in v0.1.9

func (m *Package) GetPayload() []byte

func (*Package) GetType added in v0.1.9

func (m *Package) GetType() MsgType

func (*Package) Marshal added in v0.1.9

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

func (*Package) MarshalTo added in v0.1.9

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

func (*Package) MarshalToSizedBuffer added in v0.1.9

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

func (*Package) ProtoMessage added in v0.1.9

func (*Package) ProtoMessage()

func (*Package) Reset added in v0.1.9

func (m *Package) Reset()

func (*Package) Size added in v0.1.9

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

func (*Package) String added in v0.1.9

func (m *Package) String() string

func (*Package) Unmarshal added in v0.1.9

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

func (*Package) XXX_DiscardUnknown added in v0.1.9

func (m *Package) XXX_DiscardUnknown()

func (*Package) XXX_Marshal added in v0.1.9

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

func (*Package) XXX_Merge added in v0.1.9

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

func (*Package) XXX_Size added in v0.1.9

func (m *Package) XXX_Size() int

func (*Package) XXX_Unmarshal added in v0.1.9

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

type QueueMsg

type QueueMsg struct {
	Data                 []byte   `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"`
	Targets              *Target  `protobuf:"bytes,2,opt,name=Targets,proto3" json:"Targets,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*QueueMsg) Descriptor

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

func (*QueueMsg) GetData

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

func (*QueueMsg) GetTargets

func (m *QueueMsg) GetTargets() *Target

func (*QueueMsg) Marshal

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

func (*QueueMsg) MarshalTo

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

func (*QueueMsg) MarshalToSizedBuffer

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

func (*QueueMsg) ProtoMessage

func (*QueueMsg) ProtoMessage()

func (*QueueMsg) Reset

func (m *QueueMsg) Reset()

func (*QueueMsg) Size

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

func (*QueueMsg) String

func (m *QueueMsg) String() string

func (*QueueMsg) Unmarshal

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

func (*QueueMsg) XXX_DiscardUnknown

func (m *QueueMsg) XXX_DiscardUnknown()

func (*QueueMsg) XXX_Marshal

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

func (*QueueMsg) XXX_Merge

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

func (*QueueMsg) XXX_Size

func (m *QueueMsg) XXX_Size() int

func (*QueueMsg) XXX_Unmarshal

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

type ReqArg

type ReqArg struct {
	Uid                  string   `protobuf:"bytes,1,opt,name=Uid,proto3" json:"Uid,omitempty"`
	MsgID                int32    `protobuf:"varint,2,opt,name=MsgID,proto3" json:"MsgID,omitempty"`
	Payload              []byte   `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ReqArg) Descriptor

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

func (*ReqArg) GetMsgID

func (m *ReqArg) GetMsgID() int32

func (*ReqArg) GetPayload

func (m *ReqArg) GetPayload() []byte

func (*ReqArg) GetUid

func (m *ReqArg) GetUid() string

func (*ReqArg) Marshal

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

func (*ReqArg) MarshalTo

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

func (*ReqArg) MarshalToSizedBuffer

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

func (*ReqArg) ProtoMessage

func (*ReqArg) ProtoMessage()

func (*ReqArg) Reset

func (m *ReqArg) Reset()

func (*ReqArg) Size

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

func (*ReqArg) String

func (m *ReqArg) String() string

func (*ReqArg) Unmarshal

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

func (*ReqArg) XXX_DiscardUnknown

func (m *ReqArg) XXX_DiscardUnknown()

func (*ReqArg) XXX_Marshal

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

func (*ReqArg) XXX_Merge

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

func (*ReqArg) XXX_Size

func (m *ReqArg) XXX_Size() int

func (*ReqArg) XXX_Unmarshal

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

type Request

type Request struct {
	MsgID                int32    `protobuf:"varint,1,opt,name=MsgID,proto3" json:"MsgID,omitempty"`
	Token                string   `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"`
	Payload              []byte   `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Request) Descriptor

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

func (*Request) GetMsgID

func (m *Request) GetMsgID() int32

func (*Request) GetPayload

func (m *Request) GetPayload() []byte

func (*Request) GetToken

func (m *Request) GetToken() string

func (*Request) Marshal

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

func (*Request) MarshalTo

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

func (*Request) MarshalToSizedBuffer

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

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) Size

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

func (*Request) String

func (m *Request) String() string

func (*Request) Unmarshal

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

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

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

func (*Request) XXX_Merge

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

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

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

type RespMsg

type RespMsg struct {
	MsgID                int32    `protobuf:"varint,1,opt,name=MsgID,proto3" json:"MsgID,omitempty"`
	Code                 int32    `protobuf:"varint,2,opt,name=Code,proto3" json:"Code,omitempty"`
	AppId                string   `protobuf:"bytes,3,opt,name=AppId,proto3" json:"AppId,omitempty"`
	Payload              []byte   `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RespMsg) Descriptor

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

func (*RespMsg) GetAppId

func (m *RespMsg) GetAppId() string

func (*RespMsg) GetCode

func (m *RespMsg) GetCode() int32

func (*RespMsg) GetMsgID

func (m *RespMsg) GetMsgID() int32

func (*RespMsg) GetPayload

func (m *RespMsg) GetPayload() []byte

func (*RespMsg) Marshal

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

func (*RespMsg) MarshalTo

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

func (*RespMsg) MarshalToSizedBuffer

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

func (*RespMsg) ProtoMessage

func (*RespMsg) ProtoMessage()

func (*RespMsg) Reset

func (m *RespMsg) Reset()

func (*RespMsg) Size

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

func (*RespMsg) String

func (m *RespMsg) String() string

func (*RespMsg) Unmarshal

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

func (*RespMsg) XXX_DiscardUnknown

func (m *RespMsg) XXX_DiscardUnknown()

func (*RespMsg) XXX_Marshal

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

func (*RespMsg) XXX_Merge

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

func (*RespMsg) XXX_Size

func (m *RespMsg) XXX_Size() int

func (*RespMsg) XXX_Unmarshal

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

type Response

type Response struct {
	MsgID                int32    `protobuf:"varint,1,opt,name=MsgID,proto3" json:"MsgID,omitempty"`
	Code                 int32    `protobuf:"varint,2,opt,name=Code,proto3" json:"Code,omitempty"`
	Payload              []byte   `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Response) Descriptor

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

func (*Response) GetCode

func (m *Response) GetCode() int32

func (*Response) GetMsgID

func (m *Response) GetMsgID() int32

func (*Response) GetPayload

func (m *Response) GetPayload() []byte

func (*Response) Marshal

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

func (*Response) MarshalTo

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

func (*Response) MarshalToSizedBuffer

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

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) Size

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

func (*Response) String

func (m *Response) String() string

func (*Response) Unmarshal

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

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

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

func (*Response) XXX_Merge

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

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

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

type RouterClient

type RouterClient interface {
	ReqCall(ctx context.Context, in *ReqArg, opts ...grpc.CallOption) (*RespMsg, error)
}

RouterClient is the client API for Router service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRouterClient

func NewRouterClient(cc *grpc.ClientConn) RouterClient

type RouterServer

type RouterServer interface {
	ReqCall(context.Context, *ReqArg) (*RespMsg, error)
}

RouterServer is the server API for Router service.

type Status

type Status struct {
	Code                 int32    `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	Msg                  string   `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Status) Descriptor

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

func (*Status) GetCode

func (m *Status) GetCode() int32

func (*Status) GetMsg

func (m *Status) GetMsg() string

func (*Status) Marshal

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

func (*Status) MarshalTo

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

func (*Status) MarshalToSizedBuffer

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

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) Size

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

func (*Status) String

func (m *Status) String() string

func (*Status) Unmarshal

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

func (*Status) XXX_DiscardUnknown

func (m *Status) XXX_DiscardUnknown()

func (*Status) XXX_Marshal

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

func (*Status) XXX_Merge

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

func (*Status) XXX_Size

func (m *Status) XXX_Size() int

func (*Status) XXX_Unmarshal

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

type Target

type Target struct {
	GroupId              map[string]bool `` /* 156-byte string literal not displayed */
	Uids                 map[string]bool `` /* 150-byte string literal not displayed */
	UnlessUids           map[string]bool `` /* 162-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*Target) Descriptor

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

func (*Target) GetGroupId

func (m *Target) GetGroupId() map[string]bool

func (*Target) GetUids

func (m *Target) GetUids() map[string]bool

func (*Target) GetUnlessUids

func (m *Target) GetUnlessUids() map[string]bool

func (*Target) Marshal

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

func (*Target) MarshalTo

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

func (*Target) MarshalToSizedBuffer

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

func (*Target) ProtoMessage

func (*Target) ProtoMessage()

func (*Target) Reset

func (m *Target) Reset()

func (*Target) Size

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

func (*Target) String

func (m *Target) String() string

func (*Target) Unmarshal

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

func (*Target) XXX_DiscardUnknown

func (m *Target) XXX_DiscardUnknown()

func (*Target) XXX_Marshal

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

func (*Target) XXX_Merge

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

func (*Target) XXX_Size

func (m *Target) XXX_Size() int

func (*Target) XXX_Unmarshal

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

type UnimplementedBroadcastServer

type UnimplementedBroadcastServer struct {
}

UnimplementedBroadcastServer can be embedded to have forward compatible implementations.

func (*UnimplementedBroadcastServer) Frontend

type UnimplementedRouterServer

type UnimplementedRouterServer struct {
}

UnimplementedRouterServer can be embedded to have forward compatible implementations.

func (*UnimplementedRouterServer) ReqCall

func (*UnimplementedRouterServer) ReqCall(ctx context.Context, req *ReqArg) (*RespMsg, error)

Jump to

Keyboard shortcuts

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