config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfiguration

func ValidateConfiguration(creds []Credential, models []VendorModel) *errors.APIError

ValidateConfiguration validates the complete application configuration

func ValidateCredentials

func ValidateCredentials(creds []Credential) *errors.APIError

ValidateCredentials validates credential configuration

func ValidateVendorModels

func ValidateVendorModels(models []VendorModel) *errors.APIError

ValidateVendorModels validates vendor model configuration

Types

type AppConfig

type AppConfig struct {
	Credentials  []Credential  `validate:"required,min=1,dive"`
	VendorModels []VendorModel `validate:"required,min=1,dive"`
}

AppConfig represents the complete application configuration

type Credential

type Credential struct {
	Platform string `json:"platform"`
	Type     string `json:"type"`
	Value    string `json:"value"`
}

func LoadCredentials

func LoadCredentials(filePath string) ([]Credential, error)

type ValidatedCredential

type ValidatedCredential struct {
	Platform string `validate:"required,oneof=openai gemini anthropic"`
	Type     string `validate:"required,oneof=api-key oauth"`
	Value    string `validate:"required,min=1"`
}

Credential validation tags

type ValidatedVendorModel

type ValidatedVendorModel struct {
	Vendor string `validate:"required,oneof=openai gemini anthropic"`
	Model  string `validate:"required,min=1"`
}

VendorModel validation tags

type VendorModel

type VendorModel struct {
	Vendor string `json:"vendor"`
	Model  string `json:"model"`
}

func LoadVendorModels

func LoadVendorModels(filePath string) ([]VendorModel, error)

Jump to

Keyboard shortcuts

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