enum

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: ISC Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const Null = -1

Null is the value used to represent JSON null. It should never be used as a value, as it won't get serialized as such.

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(i Enum) []byte

Int8ToJSON converts the passed Enum to a byte slice with it's JSON representation.

Types

type Enum

type Enum int8

Enum is a nullable version of a uint8. Enum values should only consist of positive values, as negative values are reserved for internal constants, such as Null. This also mean that only 7 of the 8 Bit will be available for storage.

func FromJSON

func FromJSON(b []byte) (Enum, error)

Int8FromJSON decodes the Enum stored as JSON src the passed byte slice.

Jump to

Keyboard shortcuts

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