config

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindProjectRoot

func FindProjectRoot(start string) (string, error)

Types

type API

type API struct {
	BaseURL  string            `toml:"base_url"`
	Spec     string            `toml:"spec"`
	Auth     string            `toml:"auth"`
	AuthType string            `toml:"auth_type"`
	Headers  map[string]string `toml:"headers"`

	ResolvedBaseURL string `toml:"-"`
	ResolvedAuth    string `toml:"-"`
}

type Commands

type Commands map[string]string

type Config

type Config struct {
	Database *Database `toml:"database"`
	API      *API      `toml:"api"`
	GRPC     *GRPC     `toml:"grpc"`
	Log      *Log      `toml:"log"`
	Commands Commands  `toml:"commands"`
	// contains filtered or unexported fields
}

func Load

func Load(dir string) (*Config, error)

func (*Config) GetEnvVars added in v0.19.0

func (c *Config) GetEnvVars() map[string]string

GetEnvVars returns the stored .env variables.

func (*Config) Resolve

func (c *Config) Resolve() error

func (*Config) SetEnvVars added in v0.19.0

func (c *Config) SetEnvVars(env map[string]string)

SetEnvVars stores the parsed .env variables on the config.

func (*Config) Validate added in v0.19.0

func (c *Config) Validate() []string

Validate checks the configuration for common issues and returns all problems found.

type Database

type Database struct {
	Source string `toml:"source"`
	Type   string `toml:"type"`
	Driver string `toml:"driver"`
	URL    string `toml:"-"`
}

type GRPC

type GRPC struct {
	Addr       string `toml:"addr"`
	ProtoDir   string `toml:"proto_dir"`
	Reflection bool   `toml:"reflection"`

	ResolvedAddr string `toml:"-"`
}

type Log added in v0.14.0

type Log struct {
	Files []string `toml:"files"`
}

Jump to

Keyboard shortcuts

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