comments

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 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 Converter

type Converter struct {
	Name    string
	Config  ConverterConfig
	Methods MethodMapping
	Scope   *types.Scope
	// contains filtered or unexported fields
}

Converter defines a converter that was marked with converterMarker.

func ParseDocs

func ParseDocs(config ParseDocsConfig) ([]Converter, error)

ParseDocs parses the docs for the given pattern.

func (*Converter) BuildCtx

func (c *Converter) BuildCtx(method string) *builder.MethodContext

func (*Converter) RegGlobalExtend

func (c *Converter) RegGlobalExtend(extend map[xtype.Signature]*builder.MethodDefinition)

func (*Converter) RegSpecificExtend

func (c *Converter) RegSpecificExtend(method string, extend map[xtype.Signature]*builder.MethodDefinition)

type ConverterConfig

type ConverterConfig struct {
	Name             string
	ExtendMethods    []string
	NoStrict         bool
	IgnoreUnexported bool
	UseTag           []string
}

ConverterConfig contains settings that can be set via comments.

type Method

type Method struct {
	IgnoredFields   map[string]struct{}
	NameMapping     map[string]string
	MatchIgnoreCase bool
	// target to source
	IdentityMapping       map[string]struct{}
	NoStrict              bool
	Strict                bool
	IgnoreUnexported      bool
	EnabledUnexportedWarn bool
	ExtendMethods         []string
	IgnoreTag             bool
	Tag                   []string
}

Method contains settings that can be set via comments.

type MethodMapping

type MethodMapping map[string]Method

MethodMapping a mapping between method name and method.

type ParseDocsConfig

type ParseDocsConfig struct {
	// PackagePattern is a golang package pattern to scan, required.
	PackagePattern string
	// WorkingDir is a directory to invoke the tool on. If omitted, current directory is used.
	WorkingDir string
}

ParseDocsConfig provides input to the ParseDocs method below.

Jump to

Keyboard shortcuts

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