command

package
v1.0.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Static embed.FS

Functions

func BuildVersion

func BuildVersion() string

Types

type Enumerate

type Enumerate struct {
	Type     string
	TypeName string
	Explain  string
	Values   []*Value
}

type ErrnoOption

type ErrnoOption struct {
	Pattern         []string
	Type            []string
	Tags            []string
	DisableStringer bool
	Epk             string
}

type File

type File struct {
	Pkg         *Package
	File        *ast.File
	TypeName    string
	TypeComment string
	Type        string
	Values      []*Value
}

func (*File) GenDecl

func (f *File) GenDecl(node ast.Node) bool

GenDecl processes one declaration clause.

type Gen

type Gen struct {
	Pattern   []string
	OutputDir string
	Type      []string
	Tags      []string
	Version   string

	Epk string
	// contains filtered or unexported fields
}

func (*Gen) Generate

func (g *Gen) Generate() error

type GenFile

type GenFile struct {
	Version      string
	IsDeprecated bool
	Package      string
	Epk          string
	Enums        []*Enumerate
}

type Package

type Package struct {
	Name  string
	Defs  map[*ast.Ident]types.Object
	Files []*File
}

type RootCmd

type RootCmd struct {
	ErrnoOption
	// contains filtered or unexported fields
}

func NewRootCmd

func NewRootCmd() *RootCmd

func (*RootCmd) Execute

func (r *RootCmd) Execute() error

Execute adds all child commands to the root command and sets flags appropriately.

type SortValue

type SortValue []*Value

SortValue 使我们可以将`constants`进行排序, 要谨慎地按照有符号或无符号的顺序进行恰当的处理

func (SortValue) Len

func (b SortValue) Len() int

func (SortValue) Less

func (b SortValue) Less(i, j int) bool

func (SortValue) Swap

func (b SortValue) Swap(i, j int)

type Value

type Value struct {
	OriginalName string // 常量定义的名称
	Mapping      string // 注释名称, 如果没有, 则同常量名称
	// value相关
	Value  uint64 // 需要时转为`int64`.
	Signed bool   // `constant`是否是有符号类型.
	Val    string // `constant`的字符串值,由"go/constant"包提供.
}

Value represents a declared constant.

func (*Value) String

func (v *Value) String() string

Jump to

Keyboard shortcuts

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