primitive

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 4 Imported by: 11

Documentation

Index

Constants

View Source
const VarContinueBit = 0x80
View Source
const VarSegmentBits = 0x7F

Variables

View Source
var IdentifierNameSpaceRegex = regexp.MustCompile(`^[a-z0-9._-]+$`)
View Source
var IdentifierValueRegex = regexp.MustCompile(`^[a-z0-9/._-]+$`)

Functions

func DecodeMCString

func DecodeMCString(input io.ByteReader) (*string, int, error)

Types

type BitSet added in v1.0.2

type BitSet struct {
	Data []uint64 // Can't inline type, since we need to change this value in the methods
}

func NewBitSet added in v1.0.2

func NewBitSet(size uint) BitSet

func (*BitSet) Flip added in v1.0.2

func (b *BitSet) Flip(index uint)

func (*BitSet) Get added in v1.0.2

func (b *BitSet) Get(index uint) bool

func (*BitSet) Length added in v1.0.2

func (b *BitSet) Length() uint

func (*BitSet) Set added in v1.0.2

func (b *BitSet) Set(index uint)

func (*BitSet) String added in v1.0.2

func (b *BitSet) String() string

type Identifier

type Identifier string

func (Identifier) ValidateNameSpace

func (i Identifier) ValidateNameSpace() error

func (Identifier) ValidateValue

func (i Identifier) ValidateValue() error

type MCString

type MCString string

func (MCString) ByteLength

func (s MCString) ByteLength() int

func (MCString) Encode

func (s MCString) Encode() []byte

type VarInt

type VarInt int32

func DecodeVarInt

func DecodeVarInt(input io.ByteReader) (*VarInt, int, error)

func (VarInt) ByteLength

func (i VarInt) ByteLength() int

func (VarInt) Encode

func (i VarInt) Encode() []byte

type VarLong

type VarLong int64

func DecodeVarLong

func DecodeVarLong(input io.ByteReader) (*VarLong, int, error)

func (VarLong) ByteLength

func (l VarLong) ByteLength() int

func (VarLong) Encode

func (l VarLong) Encode() []byte

Jump to

Keyboard shortcuts

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