config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Server: struct {
		Host string `json:"host"`
		Port int    `json:"port"`
	}{
		Host: "localhost",
		Port: 8080,
	},
	Database: struct {
		RegistryPath string `json:"registry_path"`
		DataDir      string `json:"data_dir"`
	}{
		RegistryPath: "data/registry.db",
		DataDir:      "data/databases",
	},
	Auth: struct {
		Secret      string `json:"secret"`
		TokenExpiry int    `json:"token_expiry"`
	}{
		Secret:      "change-me-in-production",
		TokenExpiry: 24,
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Server struct {
		Host string `json:"host"`
		Port int    `json:"port"`
	} `json:"server"`
	Database struct {
		RegistryPath string `json:"registry_path"`
		DataDir      string `json:"data_dir"`
	} `json:"database"`
	Auth struct {
		Secret      string `json:"secret"`
		TokenExpiry int    `json:"token_expiry"` // in hours
	} `json:"auth"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

Jump to

Keyboard shortcuts

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