config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion = "urn:agentapi-doctor:config:v1beta2"

	TargetNamePattern = `^[a-z0-9][a-z0-9._-]{0,127}$`
)
View Source
const MaxConfigBytes = 1 << 20

Variables

This section is empty.

Functions

func SaveFile

func SaveFile(path string, config Config, overwrite bool) error

Types

type Auth

type Auth struct {
	Type   string          `yaml:"type" json:"type"`
	Token  SecretReference `yaml:"token" json:"token"`
	Header string          `yaml:"header,omitempty" json:"header,omitempty"`
}

func (Auth) Validate

func (auth Auth) Validate() error

type Config

type Config struct {
	APIVersion string            `yaml:"apiVersion" json:"apiVersion"`
	Targets    map[string]Target `yaml:"targets" json:"targets"`
}

func Decode

func Decode(raw []byte) (Config, error)

func Default

func Default() Config

func LoadFile

func LoadFile(path string) (Config, error)

func (Config) Validate

func (config Config) Validate() error

type ParsedSecretReference

type ParsedSecretReference struct {
	Scheme SecretScheme
	Value  string
}

func ParseSecretReference

func ParseSecretReference(reference string) (ParsedSecretReference, error)

type SecretReference

type SecretReference struct {
	Ref string `yaml:"ref" json:"ref"`
}

type SecretScheme

type SecretScheme string
const (
	SecretEnv     SecretScheme = "env"
	SecretKeyring SecretScheme = "keyring"
	SecretFile    SecretScheme = "file"
	SecretExec    SecretScheme = "exec"
)

type Target

type Target struct {
	BaseURL  string            `yaml:"baseURL" json:"baseURL"`
	Protocol string            `yaml:"protocol" json:"protocol"`
	Model    string            `yaml:"model" json:"model"`
	Auth     *Auth             `yaml:"auth,omitempty" json:"auth,omitempty"`
	Metadata map[string]string `yaml:"metadata,omitempty" json:"metadata,omitempty"`
}

func (Target) Validate

func (target Target) Validate() error

Jump to

Keyboard shortcuts

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