enum

package
v0.0.0-...-519d24f Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Package      string            // package name
	Dependencies map[string]string // imports (full package path => imported name)
	Specs        []*Spec
}

Generator is a generator for Enum sources

func NewGenerator

func NewGenerator() *Generator

NewGenerator returns a new instance of Generator

func (*Generator) GetAnnotationSymbol

func (*Generator) GetAnnotationSymbol() generator.AnnotationSymbol

GetAnnotationSymbol implements generator.Generator#GetAnnotation

func (*Generator) GetFormatter

func (*Generator) GetFormatter() generator.Formatter

GetFormatter implements generator.Generator#GetFormatter

func (*Generator) Run

func (enum *Generator) Run(pkg *generator.PackageInfo, nodes []*generator.AnnotatedNode) ([]*generator.Result, error)

Run implementes generator.Generator#Run

type Spec

type Spec struct {
	EnumName string
	Values   []Value
}

Spec represents Enum specification

func CollectSpecs

func CollectSpecs(pkg *generator.PackageInfo, nodes []*generator.AnnotatedNode) ([]*Spec, error)

CollectSpecs returns a spec list of Enum

type Value

type Value struct {
	Name     string // constant name
	Value    int64  // enum value
	StrValue string // enum string value
}

Value represents a enum value

Directories

Path Synopsis
Code generated by github.com/yssk22/go/generator DO NOT EDIT.
Code generated by github.com/yssk22/go/generator DO NOT EDIT.

Jump to

Keyboard shortcuts

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