enum

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.Byter](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