protocol

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBCPayload

func DecodeBCPayload(p []byte) string

func EncodeBCPayload

func EncodeBCPayload(v string) ([]byte, error)

func WriteMessage

func WriteMessage(w io.Writer, m Message) error

Types

type FileInfo

type FileInfo struct {
	Name string
	Size int64
}

func DecodeFIPayload

func DecodeFIPayload(p []byte) FileInfo

type Message

type Message struct {
	Type    MessageType
	Payload []byte
}

func NewBC

func NewBC(p []byte) *Message

func NewFC

func NewFC(p []byte) *Message

func NewFI

func NewFI(name string, size int64) *Message

func NewNO

func NewNO() *Message

func NewOK

func NewOK() *Message

func ReadMessage

func ReadMessage(r io.Reader) (Message, error)

type MessageType

type MessageType byte
const (
	OK MessageType = 0x01
	NO MessageType = 0x02
	BC MessageType = 0x03
	FI MessageType = 0x04
	FC MessageType = 0x05
)

Jump to

Keyboard shortcuts

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