config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost     = "127.0.0.1"
	DefaultPort     = 8080
	DefaultLocation = "global"
	DefaultUIMode   = "auto"
)

Variables

View Source
var ErrUsage = errors.New("usage error")

Functions

func IsLoopbackHost

func IsLoopbackHost(host string) bool

Types

type Config

type Config struct {
	Server     ServerConfig `yaml:"server"`
	Vertex     VertexConfig `yaml:"vertex"`
	Models     []Model      `yaml:"models"`
	UI         UIConfig     `yaml:"ui"`
	Verbose    bool         `yaml:"verbose"`
	SourcePath string       `yaml:"-"`
}

func Load

func Load(flags Flags) (*Config, error)

func (*Config) Address

func (c *Config) Address() string

func (*Config) LocalModelID

func (c *Config) LocalModelID(upstreamID string) string

func (*Config) UpstreamModelID

func (c *Config) UpstreamModelID(id string) string

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) VertexBaseURL

func (c *Config) VertexBaseURL() string

type Flags

type Flags struct {
	ConfigPath string
	Host       string
	Port       int
	Project    string
	Location   string
	UIMode     string
	Verbose    bool
}

type Model

type Model struct {
	ID         string `yaml:"id"`
	UpstreamID string `yaml:"upstream_id"`
}

type ServerConfig

type ServerConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type UIConfig

type UIConfig struct {
	Mode string `yaml:"mode"`
}

type VertexConfig

type VertexConfig struct {
	Project  string `yaml:"project"`
	Location string `yaml:"location"`
}

Jump to

Keyboard shortcuts

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