util

package
v0.0.0-...-5ced1f2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ChunkedMTU payload size for a single message
	ChunkedMTU = 16300
)

Variables

This section is empty.

Functions

func RandomToken

func RandomToken() string

Types

type ChunckedData

type ChunckedData struct {
	PeerData int    `json:"__peerData"`
	N        int    `json:"n"`
	Total    int    `json:"total"`
	Data     []byte `json:"data"`
}

ChunckedData wraps a data slice with metadata to assemble back the whole data

func Chunk

func Chunk(raw []byte) (chunks []ChunckedData)

Chunk slices a data payload in a list of ChunckedData

Jump to

Keyboard shortcuts

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