Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
VerifySHA256Digest bool `json:"verify-sha256" yaml:"verify-sha256" mapstructure:"verify-sha256"`
}
type Cooldown ¶ added in v0.13.0
type Cooldown struct {
IgnoreCooldown bool `json:"ignore-cooldown" yaml:"ignore-cooldown" mapstructure:"ignore-cooldown"`
}
type Core ¶ added in v0.2.0
type Core struct {
Store `json:"" yaml:",inline" mapstructure:",squash"`
// CooldownRaw is the raw config value for the global cooldown duration.
// Use Cooldown field after PostLoad has been called.
CooldownRaw any `json:"cooldown" yaml:"cooldown,omitempty" mapstructure:"cooldown"`
Cooldown JSONDuration `json:"-" yaml:"-" mapstructure:"-"`
Tools Tools `json:"tools" yaml:"tools" mapstructure:"tools"`
}
Core options make up the static application configuration on disk.
func DefaultCore ¶ added in v0.2.0
func DefaultCore() Core
type Format ¶ added in v0.7.0
type GoBuild ¶ added in v0.12.0
type GoBuild struct {
Module string `json:"module" yaml:"module" mapstructure:"module"`
Entrypoint string `json:"entrypoint" yaml:"entrypoint" mapstructure:"entrypoint"`
LDFlags string `json:"ld-flags" yaml:"ld-flags" mapstructure:"ld-flags"`
Args []string `json:"args" yaml:"args" mapstructure:"args"`
Env []string `json:"env" yaml:"env" mapstructure:"env"`
Source string `json:"source" yaml:"source" mapstructure:"source"`
RepoURL string `json:"repo-url" yaml:"repo-url" mapstructure:"repo-url"`
}
type GoInstall ¶ added in v0.2.0
type GoInstall struct {
Module string `json:"module" yaml:"module" mapstructure:"module"`
Entrypoint string `json:"entrypoint" yaml:"entrypoint" mapstructure:"entrypoint"`
LDFlags string `json:"ld-flags" yaml:"ld-flags" mapstructure:"ld-flags"`
Args []string `json:"args" yaml:"args" mapstructure:"args"`
Env []string `json:"env" yaml:"env" mapstructure:"env"`
}
type JSONDuration ¶ added in v0.13.0
JSONDuration is a time.Duration that supports YAML/JSON unmarshaling from human-friendly duration strings like "7d" (days) in addition to standard Go durations like "168h". The IsSet field tracks whether the value was explicitly configured (distinguishing "not configured" from "explicitly set to zero").
func (JSONDuration) MarshalText ¶ added in v0.13.0
func (d JSONDuration) MarshalText() ([]byte, error)
func (*JSONDuration) ParseFrom ¶ added in v0.13.0
func (d *JSONDuration) ParseFrom(v any) error
ParseFrom parses a JSONDuration from various input types that may come from config loading (string, int, float64, etc). This is needed because mapstructure doesn't support TextUnmarshaler interface, so we need to handle the raw config value in PostLoad.
func (*JSONDuration) UnmarshalText ¶ added in v0.13.0
func (d *JSONDuration) UnmarshalText(text []byte) error
func (*JSONDuration) UnmarshalYAML ¶ added in v0.13.0
func (d *JSONDuration) UnmarshalYAML(unmarshal func(interface{}) error) error
type List ¶ added in v0.5.0
type Store ¶
type Store struct {
Root string `json:"root" yaml:"root" mapstructure:"root"`
}
func DefaultStore ¶
func DefaultStore() Store
type Tool ¶
type Tool struct {
Name string `json:"name" yaml:"name" mapstructure:"name"`
Version ToolVersionConfig `json:"version" yaml:"version" mapstructure:"version"`
InstallMethod string `json:"method" yaml:"method,omitempty" mapstructure:"method"`
Parameters map[string]any `json:"with" yaml:"with,omitempty" mapstructure:"with"`
}
func (Tool) ToConfig ¶
func (t Tool) ToConfig(opts ToolOptions) (*tool.Config, *binny.VersionIntent, error)
func (Tool) ToTool ¶
func (t Tool) ToTool(opts ToolOptions) (binny.Tool, *binny.VersionIntent, error)
type ToolOptions ¶ added in v0.13.0
type ToolOptions struct {
// contains filtered or unexported fields
}
ToolOptions holds configuration for tool construction behavior.
func DefaultToolOptions ¶ added in v0.13.0
func DefaultToolOptions() ToolOptions
DefaultToolOptions returns a ToolOptions with default values.
func (ToolOptions) WithGlobalCooldown ¶ added in v0.13.0
func (o ToolOptions) WithGlobalCooldown(d JSONDuration) ToolOptions
WithGlobalCooldown sets the global cooldown that applies to all tools (unless overridden per-tool).
func (ToolOptions) WithIgnoreCooldown ¶ added in v0.13.0
func (o ToolOptions) WithIgnoreCooldown(ignore bool) ToolOptions
WithIgnoreCooldown sets whether all cooldowns should be bypassed.
type ToolVersionConfig ¶
type ToolVersionConfig struct {
Want string `json:"want" yaml:"want" mapstructure:"want"`
Constraint string `json:"constraint" yaml:"constraint,omitempty" mapstructure:"constraint"`
// CooldownRaw is the raw config value for the per-tool cooldown duration.
// Use Cooldown field after PostLoad has been called.
CooldownRaw any `json:"cooldown" yaml:"cooldown,omitempty" mapstructure:"cooldown"`
Cooldown JSONDuration `json:"-" yaml:"-" mapstructure:"-"`
ResolveMethod string `json:"method" yaml:"method,omitempty" mapstructure:"method"`
Parameters map[string]any `json:"with" yaml:"with,omitempty" mapstructure:"with"`
}
func (*ToolVersionConfig) PostLoad ¶ added in v0.13.0
func (t *ToolVersionConfig) PostLoad() error
PostLoad is called by fangs after config loading to parse raw config values.
type VersionResolution ¶ added in v0.2.0
type VersionResolution struct {
Constraint string `json:"constraint" yaml:"constraint" mapstructure:"constraint"`
Method string `json:"method" yaml:"method" mapstructure:"method"`
}
func (*VersionResolution) AddFlags ¶ added in v0.2.0
func (o *VersionResolution) AddFlags(flags clio.FlagSet)