Documentation ¶
Index ¶
Constants ¶
View Source
const (
ReqIDHello uint = iota
)
View Source
const (
RspIDEmpty uint = iota
)
View Source
const StreamOffSize = vamp.Size32
Variables ¶
View Source
var ( ReqVersion []byte RspVersion []byte )
View Source
var VampRequest = vamp.NewUnion(vamp.Size8, vamp.MustNamed("hello", vamp.MustUseStruct(HelloRequest{})), ).SetAltReader(func(alt uint, into any) (any, error) { i := into.(*any) switch alt { case ReqIDHello: *i = new(HelloRequest) return *i, nil } return nil, fmt.Errorf("unknown request id %d", alt) })
Functions ¶
This section is empty.
Types ¶
type HelloRequest ¶
type HelloRequest struct { RequestHeader ReqProto []byte `vamp:"size=8"` RspProto []byte `vamp:"size=8"` }
func (*HelloRequest) VampUnionAlt ¶
func (rq *HelloRequest) VampUnionAlt() (uint, any)
type RequestHeader ¶
type ResponseCode ¶
type ResponseCode uint16
const ( RspOK ResponseCode = iota RspProtoMismatch )
func (ResponseCode) String ¶
func (i ResponseCode) String() string
func (*ResponseCode) VampFromUint16 ¶
func (rc *ResponseCode) VampFromUint16(i uint16) error
func (ResponseCode) VampUnionAlt ¶
func (rp ResponseCode) VampUnionAlt() (uint, any)
Click to show internal directories.
Click to hide internal directories.