comments

package
v0.0.0-...-40449d9 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 7 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
}

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.

type ConverterConfig

type ConverterConfig struct {
	Name          string
	ExtendMethods []string
	WrapErrors    bool
}

ConverterConfig contains settings that can be set via comments.

type Method

type Method struct {
	IgnoredFields   map[string]struct{}
	NameMapping     map[string]string
	MatchIgnoreCase bool
	WrapErrors      bool
	// target to source
	IdentityMapping map[string]struct{}
	// mapping function to source
	ExtendMapping map[string]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