Documentation ¶
Index ¶
- type BytesMessage
- func (b *BytesMessage) Bytes() []byte
- func (b *BytesMessage) Marshal() ([]byte, error)
- func (b *BytesMessage) MarshalJSON() ([]byte, error)
- func (b *BytesMessage) ProtoMessage()
- func (b *BytesMessage) Reset()
- func (b *BytesMessage) String() string
- func (b *BytesMessage) UnmarshalJSON(data []byte) error
- type Message
- type Protocol
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BytesMessage ¶
type BytesMessage struct {
// contains filtered or unexported fields
}
BytesMessage is the simple implement of Message
func (*BytesMessage) Bytes ¶
func (b *BytesMessage) Bytes() []byte
Bytes is used to return native data
func (*BytesMessage) Marshal ¶
func (b *BytesMessage) Marshal() ([]byte, error)
Marshal implements the proto.Marshaler interface
func (*BytesMessage) MarshalJSON ¶
func (b *BytesMessage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*BytesMessage) ProtoMessage ¶
func (b *BytesMessage) ProtoMessage()
ProtoMessage implements the proto.Message interface
func (*BytesMessage) Reset ¶
func (b *BytesMessage) Reset()
Reset implements the proto.Message interface
func (*BytesMessage) String ¶
func (b *BytesMessage) String() string
String implements the proto.Message interface
func (*BytesMessage) UnmarshalJSON ¶
func (b *BytesMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.UnmarshalJSON interface
type Message ¶
type Message interface { proto.Message json.Marshaler json.Unmarshaler proto.Marshaler Bytes() []byte }
Message defines a generic message interface
func NewBytesMessage ¶
NewBytesMessage is used to init BytesMessage
type Request ¶
type Request struct { Protocol Protocol `json:"protocol"` Method string `json:"method"` Host string `json:"host"` Path string `json:"path"` Header map[string]string `json:"header"` Body Message `json:"body"` }
Request defines the request structure
Click to show internal directories.
Click to hide internal directories.