network/metadata.go

18 lines
497 B
Go
Raw Normal View History

2022-10-11 17:36:09 +08:00
package network
import "git.hpds.cc/Component/network/frame"
// Metadata is used for storing extra info of the application
type Metadata interface {
// Encode is the serialize method
Encode() []byte
}
// MetadataBuilder is the builder of Metadata
type MetadataBuilder interface {
// Build will return a Metadata instance according to the handshake frame passed in
Build(f *frame.HandshakeFrame) (Metadata, error)
// Decode is the deserialize method
Decode(buf []byte) (Metadata, error)
}