builder

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCantBuild = errors.New("cannot build")

Functions

func Singular

func Singular(s string) string

Types

type ClientBuilder

type ClientBuilder[T any] struct {
	// contains filtered or unexported fields
}

func NewClientBuilder

func NewClientBuilder[T any](cfg Config) *ClientBuilder[T]

func (*ClientBuilder[T]) BuildFor

func (b *ClientBuilder[T]) BuildFor(build *config.Config)

func (*ClientBuilder[T]) BuildMethod

func (b *ClientBuilder[T]) BuildMethod(build *config.Config, m reflect.Method)

type Config

type Config struct {
	InputStructSuffix string

	// ReadFlagPrefixes The prefix that read flags must have (removed in alias flag).
	ReadFlagPrefixes []string
	// CreateFlagPrefixes The prefix that create flags must have (removed in alias flag).
	CreateFlagPrefixes []string
	// UpdateFlagPrefixes The prefix that update flags must have (removed in alias flag).
	UpdateFlagPrefixes []string
	// DeleteFlagPrefixes The prefix that delete flags must have (removed in alias flag).
	DeleteFlagPrefixes []string

	SkipFlagsPrefixes []string

	FlagOverrides map[string]config.Flag
	FlagReplaces  []string

	PriorityFields []string

	RequiredFromFieldPointer bool
	RequiredFromComment      func(string) bool

	AliasRootPath []string
}

type MethodBuilder

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

func NewMethodBuilder

func NewMethodBuilder(cfg Config, build *config.Config, m reflect.Method) *MethodBuilder

func (*MethodBuilder) Build

func (b *MethodBuilder) Build() error

func (*MethodBuilder) Commit

func (b *MethodBuilder) Commit()

type SpecBuilder

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

func NewSpecBuilder

func NewSpecBuilder(cfg Config) *SpecBuilder

func (*SpecBuilder) BuildSpec

func (b *SpecBuilder) BuildSpec(base *config.Config, pkgNames ...string)

Jump to

Keyboard shortcuts

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