config

package
v1.7.34 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Package config represnets configurations for given system Supported configurations are env as of right now.

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Copyright 2025 Deirror. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v1.7.22

type Config struct {
	ReadMode                      // Determines the mode in which configuration is read
	Resources []resource.Resource // The resources representing the config source
}

Config represents the configuration for the application. It combines a ReadMode, which determines how the configuration is loaded or interpreted, with a Resource, which points to the underlying source of the configuration (e.g., a local path or a remote URI).

func NewConfig added in v1.7.22

func NewConfig(m ReadMode, rs []resource.Resource) *Config

func (*Config) WithReadMode added in v1.7.22

func (c *Config) WithReadMode(m ReadMode) *Config

WithReadMode returns a copy of the Config with a new ReadMode.

func (*Config) WithResource added in v1.7.22

func (c *Config) WithResource(rs []resource.Resource) *Config

WithResource returns a copy of the Config with a new Resource.

type MultiConfig

type MultiConfig[T any] map[string]*T

Represents maps of prefixes (e.g. "NEON", "UPSTASH", "WEB", "db", "whatever_you-want") to a set of Configs.

type ReadMode added in v1.7.22

type ReadMode string
const (
	File ReadMode = "file" // Read from a local file (.env, YAML, etc.)
	OS   ReadMode = "os"   // Read from inherited OS environment variables
	Ext  ReadMode = "ext"  // Read from external source (Docker secrets, K8s secrets, etc.)
)

func ParseReadMode added in v1.7.22

func ParseReadMode(s string) (ReadMode, error)

ParseReadMode converts a string to a ReadMode. Case-insensitive.

func (ReadMode) IsExt added in v1.7.27

func (r ReadMode) IsExt() bool

func (ReadMode) IsFile added in v1.7.26

func (r ReadMode) IsFile() bool

func (ReadMode) IsOS added in v1.7.26

func (r ReadMode) IsOS() bool

Directories

Path Synopsis
env
Package env provides helpers for loading any configuration from environment variables.
Package env provides helpers for loading any configuration from environment variables.
app
db
doc
jwt
kv
url

Jump to

Keyboard shortcuts

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