utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeWriteToTest

func TypeWriteToTest(t *testing.T, data []WriteTestData, errorExpected ...bool)

Types

type DuplicatedKeyError

type DuplicatedKeyError struct {
	Key interface{}
}

func (DuplicatedKeyError) Error

func (d DuplicatedKeyError) Error() string

type ErrorMessagePackType

type ErrorMessagePackType string

ErrorMessagePackType returns always an error if you try to write it.

func (ErrorMessagePackType) Len

func (e ErrorMessagePackType) Len() int

func (ErrorMessagePackType) WriteTo

func (e ErrorMessagePackType) WriteTo(w io.Writer) (int64, error)

type ExceededLengthError

type ExceededLengthError struct {
	Type         string
	ActualLength int
}

func (ExceededLengthError) Error

func (e ExceededLengthError) Error() string

type InvalidArgumentError

type InvalidArgumentError struct {
	Desc string
}

func (InvalidArgumentError) Error

func (i InvalidArgumentError) Error() string

type InvalidTypeError

type InvalidTypeError struct {
	Type string
}

func (InvalidTypeError) Error

func (i InvalidTypeError) Error() string

type MessagePackType

type MessagePackType interface {
	MessagePackTypeEncoder
	MessagePackTypeDecoder
}

MessagePackType is a MessagePack-compatible type

type MessagePackTypeDecoder

type MessagePackTypeDecoder interface {
}

MessagePackTypeDecoder contains the methods used to convert the bytes into the type

type MessagePackTypeEncoder

type MessagePackTypeEncoder interface {
	Len() int
	io.WriterTo
}

MessagePackTypeEncoder contains the methods used to convert the type into bytes

type Options

type Options string

Options is the string following a comma in a struct field's "sbor" tag, or the empty string. It does not include the leading comma.

func ParseTag

func ParseTag(tag string) (string, Options)

ParseTag splits a struct field's json tag into its name and comma-separated options.

func (Options) Contains

func (o Options) Contains(optionName string) bool

Contains reports whether a comma-separated list of options contains a particular substr flag. substr must be surrounded by a string boundary or commas.

type OutOfBoundError

type OutOfBoundError struct {
	Key int
}

func (OutOfBoundError) Error

func (o OutOfBoundError) Error() string

type WriteTestData

type WriteTestData struct {
	Input    MessagePackType
	Expected []byte
	Name     string
}

Jump to

Keyboard shortcuts

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