Categorygithub.com/chronos-tachyon/enumhelper
modulepackage
1.2.0
Repository: https://github.com/chronos-tachyon/enumhelper.git
Documentation: pkg.go.dev

# README

enumhelper

Go Latest Release Go Reference License Go Report Card

Helpers for implementing enums in Go.

# Functions

DereferenceEnumData returns enumData[value] or panics with InvalidEnumValueError.
IsNull returns true iff err is an instance of IsNullError.
MakeAllowedEnumNames returns the list of canonical string representations for this enum.
MakeBitfieldType initializes and returns a BitfieldType.
MarshalEnumToJSON marshals this enum value to JSON.
ParseEnum parses an enum value.
UnmarshalEnumFromJSON unmarshals an enum value from JSON.

# Structs

AnnotatedBitfieldData extends BitfieldData with some auto-populated fields.
BitfieldData holds data about one particular bitfield bit.
BitfieldType holds data about a bitfield type.
EnumData holds data about one particular enum value.
InvalidBitfieldIndexError indicates an enum whose numeric value is out of range.
InvalidBitfieldNameError indicates a bitfield bit whose string representation could not be recognized.
InvalidEnumNameError indicates an enum whose string representation could not be recognized.
InvalidEnumValueError indicates an enum whose numeric value is out of range.
IsNullError indicates that a JSON null value was parsed.