Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindProjectRoot ¶
Types ¶
type APIOverride ¶ added in v0.25.0
type APIOverride struct {
BaseURL *string `toml:"base_url,omitempty"`
Auth *string `toml:"auth,omitempty"`
AuthType *string `toml:"auth_type,omitempty"`
Headers map[string]string `toml:"headers,omitempty"`
}
APIOverride contains optional overrides for the API section.
type Config ¶
type Config struct {
Database *Database `toml:"database"`
API *API `toml:"api"`
GRPC *GRPC `toml:"grpc"`
Log *Log `toml:"log"`
Plugin *Plugin `toml:"plugin"`
Commands Commands `toml:"commands"`
Envs Envs `toml:"envs"`
// contains filtered or unexported fields
}
func Load ¶
Load reads and parses the tinker.toml configuration file. Environment overrides are NOT applied — use LoadWithEnv for that.
func LoadWithEnv ¶ added in v0.25.0
LoadWithEnv reads and parses the tinker.toml configuration file, then applies overrides for the specified environment (e.g., "staging", "production"). An empty envName means use the base configuration without overrides.
func (*Config) ApplyEnv ¶ added in v0.25.0
ApplyEnv applies environment overrides to the base config. Only non-nil fields in the override are applied; zero-value fields are left unchanged.
func (*Config) GetEnvVars ¶ added in v0.19.0
GetEnvVars returns the stored .env variables.
func (*Config) ListEnvs ¶ added in v0.25.0
ListEnvs returns the list of available environment names.
func (*Config) SetEnvVars ¶ added in v0.19.0
SetEnvVars stores the parsed .env variables on the config.
type DatabaseOverride ¶ added in v0.25.0
type DatabaseOverride struct {
Source *string `toml:"source,omitempty"`
Type *string `toml:"type,omitempty"`
Driver *string `toml:"driver,omitempty"`
}
DatabaseOverride contains optional overrides for the database section.
type EnvOverrides ¶ added in v0.25.0
type EnvOverrides struct {
Database *DatabaseOverride `toml:"database,omitempty"`
API *APIOverride `toml:"api,omitempty"`
GRPC *GRPCOverride `toml:"grpc,omitempty"`
}
EnvOverrides represents per-environment configuration overrides. Only non-nil fields are applied on top of the base config.
type Envs ¶ added in v0.25.0
type Envs map[string]EnvOverrides
Envs holds multi-environment configuration overrides. Each key is an environment name (e.g., "staging", "production"), and the value is a partial Config that overrides the base config.
type GRPCOverride ¶ added in v0.25.0
type GRPCOverride struct {
Addr *string `toml:"addr,omitempty"`
ProtoDir *string `toml:"proto_dir,omitempty"`
Reflection *bool `toml:"reflection,omitempty"`
}
GRPCOverride contains optional overrides for the gRPC section.