config

package
v0.0.1-0...-104a2d1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	Name              string        `default:"nuts_api"`
	Host              string        `default:"0.0.0.0"`
	Port              string        `default:"3080"`
	ReadHeaderTimeout time.Duration `split_words:"true" default:"60s"`
	GracefulTimeout   time.Duration `split_words:"true" default:"8s"`

	RequestLog bool `split_words:"true" default:"false"`
}

func API

func API() Api

type Auth

type Auth struct {
	SigningKey string `required:"true"`
	RefreshKey string `required:"true"`

	GoogleAuthEnabled  bool   `split_words:"true" required:"false" default:"false"`
	GoogleClientID     string `split_words:"true" required:"false"`
	GoogleClientSecret string `split_words:"true" required:"false"`
	GoogleCallbackURL  string `split_words:"true" required:"false"`

	GithubAuthEnabled  bool   `split_words:"true" required:"false" default:"false"`
	GithubClientID     string `split_words:"true" required:"false"`
	GithubClientSecret string `split_words:"true" required:"false"`
	GithubCallbackURL  string `split_words:"true" required:"false"`

	EncryptionSecretKeyHex string `split_words:"true" required:"true"`
}

func AUTH

func AUTH() Auth

type Cache

type Cache struct {
	Host      string `default:"0.0.0.0"`
	Port      string `default:"6379"`
	Hosts     []string
	Name      int `default:"1"`
	User      string
	Pass      string
	CacheTime time.Duration `split_words:"true" default:"5s"`
}

func NewCache

func NewCache() Cache

type Config

type Config struct {
	Auth
	Cors
	Api
	DB
	Storage
	Cache
	Integrations
}

func New

func New() *Config

type Cors

type Cors struct {
	AllowedOrigins []string `split_words:"true"`
}

func NewCors

func NewCors() Cors

type DB

type DB struct {
	Driver                 string        `required:"true"`
	Host                   string        `default:"localhost"`
	Name                   string        `default:"postgres"`
	TestName               string        `split_words:"true" default:"test"`
	User                   string        `default:"postgres"`
	Pass                   string        `default:"password"`
	SslMode                string        `split_words:"true" default:"disable"`
	MaxConnectionPool      int           `split_words:"true" default:"4"`
	MaxIdleConnections     int           `split_words:"true" default:"4"`
	ConnectionsMaxLifeTime time.Duration `split_words:"true" default:"300s"`
	Port                   uint16        `default:"5432"`
}

func DataStore

func DataStore() DB

type Integrations

type Integrations struct {
	EnabledFinancialProviders []string `split_words:"true" required:"false"`

	// Teller.io
	TellerEnvironment        string `split_words:"true" required:"false" default:"sandbox"`
	TellerBaseUri            string `split_words:"true" required:"false" default:"https://api.teller.io"`
	TellerCertPath           string `split_words:"true" required:"false"`
	TellerCertPrivateKeyPath string `split_words:"true" required:"false"`

	// Plaid
	PlaidEnvironment string `split_words:"true" required:"false" default:"sandbox"`
	PlaidClientId    string `split_words:"true" required:"false"`
	PlaidSecret      string `split_words:"true" required:"false"`
	PlaidBaseUri     string `split_words:"true" required:"false" default:"https://production.plaid.com"`
	PlaidWebhookUri  string `split_words:"true" required:"false"`

	// GoCardless
	GoCardlessSecretId  string `split_words:"true" required:"false"`
	GoCardlessSecretKey string `split_words:"true" required:"false"`
	GoCardlessBaseUri   string `split_words:"true" required:"false" default:"https://ob.gocardless.com"`

	// Mono.co
	MonoSecretKey string `split_words:"true" required:"false"`
	MonoBaseUri   string `split_words:"true" required:"false" default:"https://api.mono.co"`

	// Brankas
	BrankasApiKey  string `split_words:"true" required:"false"`
	BrankasBaseUri string `split_words:"true" required:"false" default:"https://api.brankas.com"`

	// Payments
	PaymentApiProvider     string `required:"false"`
	PayStackPrivateKeyPath string `required:"false"`
	PayBoxPrivateKey       string `required:"false"`
}

func INTEGRATIONS

func INTEGRATIONS() Integrations

type Storage

type Storage struct {
	Host   string `required:"true" default:"Fs"`
	Region string `required:"false"`

	PublicBucketName  string `required:"false" split_words:"true" default:"nuts_public"`
	PrivateBucketName string `required:"false" split_words:"true" default:"nuts_private"`

	AccessKey string `required:"false" split_words:"true"`
	SecretKey string `required:"false" split_words:"true"`

	MinioEndpoint string `required:"false" split_words:"true" default:"localhost:9000"`
	MinioSSL      bool   `required:"false" split_words:"true" default:"false"`

	R2AccountID string `required:"false" split_words:"true"`

	FSPath string `required:"false" split_words:"true"`
}

func NewStorage

func NewStorage() Storage

Jump to

Keyboard shortcuts

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