builder

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

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

	IdFieldInUsage string

	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