config

package
v2.0.0-...-87fb603 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MakeError        toml.ErrorMaker   `toml:"-"`
	Imports          []string          `toml:"imports"`
	Targets          []Target          `toml:"target"`
	Sources          []Source          `toml:"source"`
	Rules            []Rule            `toml:"rule"`
	Converters       []Converter       `toml:"converter"`
	ConverterHelpers []ConverterHelper `toml:"converter-helper"`
}

func Load

func Load(path string) (_ *Config, err error)

type Constraint

type Constraint struct {
	constraint.Expr
}

func (*Constraint) MarshalText

func (c *Constraint) MarshalText() ([]byte, error)

func (*Constraint) UnmarshalText

func (c *Constraint) UnmarshalText(text []byte) error

type Converter

type Converter struct {
	Type      *regexp.Regexp `toml:"type"`
	Templates struct {
		ToRye   string `toml:"to-rye"`
		FromRye string `toml:"from-rye"`
	} `toml:"template"`
}

type ConverterHelper

type ConverterHelper struct {
	Name      string `toml:"name"`
	Templates struct {
		ToRye   string `toml:"to-rye"`
		FromRye string `toml:"from-rye"`
	} `toml:"template"`
}

type Error

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

func (*Error) Error

func (e *Error) Error() string

Error returns a short error message.

func (*Error) String

func (e *Error) String() string

String returns the full multi-line error string.

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Rule

type Rule struct {
	Select struct {
		Package *regexp.Regexp `toml:"package"`
		Name    *regexp.Regexp `toml:"name"`
		Recv    *regexp.Regexp `toml:"recv"`
		Type    string         `toml:"type"`
		TypePos toml.FieldPosition
	} `toml:"select"`
	Actions struct {
		Include       *bool  `toml:"include"`
		Rename        string `toml:"rename"`
		RenamePos     toml.FieldPosition
		ToCasing      string `toml:"to-casing"`
		ToCasingPos   toml.FieldPosition
		SetPackage    string `toml:"set-package"`
		SetPackagePos toml.FieldPosition
	} `toml:"action"`
}

type Source

type Source struct {
	Packages []string `toml:"packages"`
}

type Target

type Target struct {
	Select     *Constraint `toml:"select"`
	CGoEnabled *bool       `toml:"cgo-enabled"`
}