config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORSConfig

type CORSConfig struct {
	AllowedOrigins []string `mapstructure:"allowed_origins"`

	AllowedMethods []string `mapstructure:"allowed_methods"`

	AllowedHeaders []string `mapstructure:"allowed_headers"`

	MaxAge int `mapstructure:"max_age" default:"300"`

	AllowCredentials bool `mapstructure:"allow_credentials" default:"false"`
}

func (*CORSConfig) Validate

func (c *CORSConfig) Validate() error

type DatabaseService

type DatabaseService interface {
	DatabaseName() string
}

type GRPCService

type GRPCService interface {
	GRPCAddr() string
}

type HTTPDefaults

type HTTPDefaults struct {
	ReadTimeout  time.Duration `mapstructure:"read_timeout" default:"30s"`
	WriteTimeout time.Duration `mapstructure:"write_timeout" default:"30s"`
	IdleTimeout  time.Duration `mapstructure:"idle_timeout" default:"60s"`
}

type HTTPService

type HTTPService interface {
	HTTPAddr() string
}

type RuntimeConfig

type RuntimeConfig[T ServiceConfig] struct {
	Platform config
	Service  T
}

func Load

func Load[T ServiceConfig](serviceName string) (*RuntimeConfig[T], error)

func (*RuntimeConfig[T]) GetDatabaseConfig

func (r *RuntimeConfig[T]) GetDatabaseConfig() platformConfig.DatabaseConfig

func (*RuntimeConfig[T]) Validate

func (r *RuntimeConfig[T]) Validate() error

type ServiceConfig

type ServiceConfig interface {
	Validate() error
}

ServiceConfig interface all service configs must implement

Jump to

Keyboard shortcuts

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