Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCantBuild = errors.New("cannot build")
Functions ¶
func RequiredHelp ¶
Types ¶
type APIBuilder ¶
type APIBuilder struct {
// contains filtered or unexported fields
}
func NewAPIBuilder ¶
func (*APIBuilder) Build ¶
func (b *APIBuilder) Build(spec Spec) error
func (*APIBuilder) Commit ¶
func (b *APIBuilder) Commit()
type AliasBuilder ¶
type AliasBuilder struct {
// contains filtered or unexported fields
}
func NewAliasBuilder ¶
func (*AliasBuilder) Build ¶
func (b *AliasBuilder) Build(spec Spec) error
func (*AliasBuilder) Commit ¶
func (b *AliasBuilder) Commit()
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, spec Spec)
func (*ClientBuilder[T]) BuildMethod ¶
type Config ¶
type Config struct {
InputStructSuffix string
// SkipMethods skips the method (no octl API command)
SkipMethods []string
// SkipSuffixes skips the method with the following suffixes
SkipSuffixes []string
// AllowedNumOut defines the number of allowed args
AllowedNumOut []int
// Skip avoids generating an alias for an entity
SkipAlias []string
// TypeName is an entity => type name map
TypeName map[string]string
PriorityFields []string
RequiredFromFieldPointer bool
RequiredFromComment func(string) bool
// 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 map[string][]string
StripFlagsPrefixes map[string][]string
FlagOverrides map[string]config.Flag
FlagReplaces []string
IdFieldInUsage string
AliasRootPath []string
}
type EntityBuilder ¶
type EntityBuilder struct {
// contains filtered or unexported fields
}
func NewEntityBuilder ¶
func (*EntityBuilder) Build ¶
func (b *EntityBuilder) Build(spec Spec) error
func (*EntityBuilder) Commit ¶
func (b *EntityBuilder) Commit()
type MethodBuilder ¶
type Spec ¶
type Spec struct {
Calls map[string]SpecCall `yaml:"calls,omitempty"`
Attributes map[string]SpecAttribute `yaml:"attributes,omitempty"`
}
func (Spec) ForAttribute ¶
func (s Spec) ForAttribute(call, name string) SpecAttribute
func (*Spec) SetAttribute ¶
func (s *Spec) SetAttribute(call, name string, spec SpecAttribute)
type SpecAttribute ¶
type SpecBuilder ¶
type SpecBuilder struct {
// contains filtered or unexported fields
}
func NewSpecBuilder ¶
func NewSpecBuilder(cfg Config) *SpecBuilder
Click to show internal directories.
Click to hide internal directories.