obi

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte, v ...interface{}) error

Decode uses obi encoding scheme to decode the given input(s).

func DecodeBytes

func DecodeBytes(data []byte) ([]byte, []byte, error)

DecodeBytes decodes the input bytes and returns bytes result and the remaining bytes.

func DecodeSigned16

func DecodeSigned16(data []byte) (int16, []byte, error)

DecodeSigned16 decodes the input bytes into `uint64` and returns the remaining bytes.

func DecodeSigned32

func DecodeSigned32(data []byte) (int32, []byte, error)

DecodeSigned32 decodes the input bytes into `uint64` and returns the remaining bytes.

func DecodeSigned64

func DecodeSigned64(data []byte) (int64, []byte, error)

DecodeSigned64 decodes the input bytes into `uint64` and returns the remaining bytes.

func DecodeSigned8

func DecodeSigned8(data []byte) (int8, []byte, error)

DecodeSigned8 decodes the input bytes into `uint64` and returns the remaining bytes.

func DecodeString

func DecodeString(data []byte) (string, []byte, error)

DecodeString decodes the input bytes and returns string result and the remaining bytes.

func DecodeUnsigned16

func DecodeUnsigned16(data []byte) (uint16, []byte, error)

DecodeUnsigned16 decodes the input bytes into `uint16` and returns the remaining bytes.

func DecodeUnsigned32

func DecodeUnsigned32(data []byte) (uint32, []byte, error)

DecodeUnsigned32 decodes the input bytes into `uint32` and returns the remaining bytes.

func DecodeUnsigned64

func DecodeUnsigned64(data []byte) (uint64, []byte, error)

DecodeUnsigned64 decodes the input bytes into `uint64` and returns the remaining bytes.

func DecodeUnsigned8

func DecodeUnsigned8(data []byte) (uint8, []byte, error)

DecodeUnsigned16 decodes the input bytes into `uint8` and returns the remaining bytes.

func Encode

func Encode(v ...interface{}) ([]byte, error)

Encode uses obi encoding scheme to encode the given input(s) into bytes.

func EncodeBytes

func EncodeBytes(v []byte) []byte

EncodeBytes takes a `[]byte` variable and encodes it into a byte array

func EncodeSigned16

func EncodeSigned16(v int16) []byte

EncodeSigned16 takes an `int16` variable and encodes it into a byte array

func EncodeSigned32

func EncodeSigned32(v int32) []byte

EncodeSigned32 takes an `int32` variable and encodes it into a byte array

func EncodeSigned64

func EncodeSigned64(v int64) []byte

EncodeSigned64 takes an `int64` variable and encodes it into a byte array

func EncodeSigned8

func EncodeSigned8(v int8) []byte

EncodeSigned8 takes an `int8` variable and encodes it into a byte array

func EncodeString

func EncodeString(v string) []byte

EncodeString takes a `string` variable and encodes it into a byte array

func EncodeUnsigned16

func EncodeUnsigned16(v uint16) []byte

EncodeUnsigned16 takes an `uint16` variable and encodes it into a byte array

func EncodeUnsigned32

func EncodeUnsigned32(v uint32) []byte

EncodeUnsigned32 takes an `uint32` variable and encodes it into a byte array

func EncodeUnsigned64

func EncodeUnsigned64(v uint64) []byte

EncodeUnsigned64 takes an `uint64` variable and encodes it into a byte array

func EncodeUnsigned8

func EncodeUnsigned8(v uint8) []byte

EncodeUnsigned8 takes an `uint8` variable and encodes it into a byte array

func GetSchema

func GetSchema(v interface{}) (string, error)

GetSchema returns the compact OBI individual schema of the given value.

func MustDecode

func MustDecode(data []byte, v ...interface{})

MustDecode uses obi encoding scheme to decode the given input. Panics on error.

func MustEncode

func MustEncode(v ...interface{}) []byte

MustEncode uses obi encoding scheme to encode the given input into bytes. Panics on error.

func MustGetSchema

func MustGetSchema(v interface{}) string

MustGetSchema returns the compact OBI individual schema of the given value. Panics on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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