MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / Marshal

Method Marshal

internal/frame/frame.go:50–52  ·  view source on GitHub ↗

Marshal serializes the frame to a byte slice using the schema: session_id : 16 bytes seq : uint64 BE flags : uint8 target_len : uint8 target : N bytes payload_len : uint32 BE payload : N bytes

()

Source from the content-addressed store, hash-verified

48// payload_len : uint32 BE
49// payload : N bytes
50func (f *Frame) Marshal() ([]byte, error) {
51 return f.AppendMarshal(make([]byte, 0, f.EncodedLen()))
52}
53
54func (f *Frame) AppendMarshal(dst []byte) ([]byte, error) {
55 if len(f.Target) > maxTargetLen {

Calls 2

AppendMarshalMethod · 0.95
EncodedLenMethod · 0.95