service

package
v0.0.0-...-9110ccf Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitIntoRuns

func SplitIntoRuns(values []Value) [][]Value

SplitIntoRuns breaks the values into runs of contiguous sequences. For example, given 1,2,3,5,6,7 it returns {1,2,3},{5,6,7}. The input slice is known to be non-empty.

Types

type File

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

File holds a single parsed file and associated data.

func (*File) AppendValue

func (f *File) AppendValue(v Value)

func (*File) GenDecl

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

genDecl processes one declaration clause.

func (*File) GetFile

func (f *File) GetFile() *ast.File

func (*File) GetTypeName

func (f *File) GetTypeName() string

func (*File) GetValues

func (f *File) GetValues() []Value

func (*File) SetFile

func (f *File) SetFile(file *ast.File)

func (*File) SetTypeName

func (f *File) SetTypeName(typeName string)

func (*File) SetValues

func (f *File) SetValues(values []Value)

type Generator

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

Generator holds the state of the analysis. Primarily used to buffer the output for format.Source.

func (*Generator) Format

func (g *Generator) Format() []byte

format returns the gofmt-ed contents of the Generator's buffer.

func (*Generator) Generate

func (g *Generator) Generate(typeName string)

generate produces the String method for the named type.

func (*Generator) GetPackage

func (g *Generator) GetPackage() *Package

func (*Generator) ParsePackage

func (g *Generator) ParsePackage(patterns []string, tags []string)

ParsePackage analyzes the single package constructed from the patterns and tags. ParsePackage exits if there is an error.

func (*Generator) Printf

func (g *Generator) Printf(format string, args ...interface{})

func (*Generator) SetLineComment

func (g *Generator) SetLineComment(lineComment bool)

func (*Generator) SetTrimPrefix

func (g *Generator) SetTrimPrefix(prefix string)

type Package

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

func (*Package) GetDefs

func (p *Package) GetDefs() map[*ast.Ident]types.Object

func (*Package) GetFile

func (p *Package) GetFile() []*File

func (*Package) GetName

func (p *Package) GetName() string

type Value

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

Value represents a declared constant.

func (*Value) Name

func (v *Value) Name() string

func (*Value) String

func (v *Value) String() string

func (*Value) Value

func (v *Value) Value() uint64

Jump to

Keyboard shortcuts

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