enum

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enum

type Enum struct {
	// contains filtered or unexported fields
}

The Enum rule.

func FromFile

func FromFile(f *fs.File) *Enum

FromFile creates Enum rule from specified file.

func New

func New[T bytes.ByteKeeper](name string, content T) *Enum

New creates new Enum rule with specified name and content.

func (*Enum) Check

func (e *Enum) Check() error

Check checks that enum is valid.

func (*Enum) GetAST

func (e *Enum) GetAST() (schema.ASTNode, error)

func (*Enum) Len

func (e *Enum) Len() (uint, error)

func (*Enum) Values

func (e *Enum) Values() ([]Value, error)

Values returns a list of values defined in this enum.

type Value

type Value struct {
	// Comment value's comment.
	Comment string

	// Type value type.
	Type schema.SchemaType

	// Value enum value.
	Value bytes.Bytes
}

Value represents single enum's value.

Jump to

Keyboard shortcuts

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