option

package
v2.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

func NewLoader

func NewLoader(astLoader *astloader.Loader, pkgName string) *Loader

func (*Loader) Load

func (l *Loader) Load() (result *Result, errs []error)

type Option

type Option struct {
	FnObj      types.Object
	Name       string
	Value      Value
	Properties Properties
	Position   token.Position
}

func MustOption

func MustOption(o *Option, _ bool) *Option

func (Option) At

func (o Option) At(key string) (*Option, bool)

func (Option) Exists

func (o Option) Exists(key string) bool

func (Option) OneOf

func (o Option) OneOf(key string) bool

func (Option) Slice

func (o Option) Slice(key string) ([]*Option, bool)

type Parser

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

func NewParser

func NewParser(pkg *packages.Package) *Parser

func (Parser) Parse

func (p Parser) Parse(expr ast.Expr) (*Option, error)

type Properties

type Properties map[string][]*Option

type Result

type Result struct {
	Data            *astloader.Data
	Options         []*ResultOption
	ExternalOptions []*ResultOption
}

type ResultOption

type ResultOption struct {
	Pkg    *packages.Package
	Option *Option
}

type Value

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

func (Value) Bool

func (v Value) Bool() (value bool)

func (Value) Expr

func (v Value) Expr() ast.Expr

func (Value) ExprSlice

func (v Value) ExprSlice() (value []ast.Expr)

func (Value) Float

func (v Value) Float() (value float32)

func (Value) Int

func (v Value) Int() (value int)

func (Value) Pos

func (v Value) Pos() token.Position

func (Value) String

func (v Value) String() (value string)

func (Value) StringSlice

func (v Value) StringSlice() (value []string)

func (Value) Type

func (v Value) Type() types.Type

Jump to

Keyboard shortcuts

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