enum_generator

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEnumGenerator

func NewEnumGenerator(pkg *packagex.Package) generate.Generator

Types

type Enum

type Enum struct {
	PkgPath string
	Name    string
	Options []EnumOption
	// contains filtered or unexported fields
}

func NewEnum

func NewEnum(pkgPath, enumName string, options []EnumOption) *Enum

func (*Enum) EnumCodeId

func (enum *Enum) EnumCodeId(option EnumOption) string

type EnumGenerator

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

func (*EnumGenerator) Scan

func (gen *EnumGenerator) Scan(enumNames ...string)

func (*EnumGenerator) WriteToFile

func (gen *EnumGenerator) WriteToFile()

type EnumOption

type EnumOption struct {
	ConstValue int64  `json:"constValue"`
	Value      string `json:"value"`
	Doc        string `json:"doc"`
}

type EnumScanner

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

func (*EnumScanner) Scan

func (scanner *EnumScanner) Scan(enum *types.TypeName) *Enum

Jump to

Keyboard shortcuts

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