setup

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("setup_config", fx.Provide(newModule))

Module

Functions

This section is empty.

Types

type API

type API struct {
	RootToken string `env:"ROOT_TOKEN"`
}

API

type Authenticator

type Authenticator struct {
	JWTDuration int64 `env:"JWT_DURATION"` // jwt token duration in seconds
}

type Config

type Config struct {
	fx.Out

	API  *API           `env:",prefix=API_"`
	Auth *Authenticator `env:",prefix=JWT_"`

	DB  *DB     `env:",prefix=DB_"`
	Log *Logger `env:",prefix=LOG_"`

	Server *Server `env:",prefix=SERVER_"`
	Tunnel *Tunnel `env:",prefix=TUNNEL_"`
}

Configs

type DB

type DB struct {
	Username    string `env:"USERNAME, default=dino"`
	Password    string `env:"PASSWORD, default=dino"`
	Host        string `env:"HOST, default=postgres"`
	Port        string `env:"PORT, default=5432"`
	Name        string `env:"NAME, default=dino"`
	ExtraParams string `env:"EXTRA_PARAMS, default=sslmode=disable"`
}

DB

func (*DB) Dial

func (dbc *DB) Dial() string

Dial

type Logger

type Logger struct {
	Level string `env:"LEVEL,default=DEBUG"`
}

Logger

type Server

type Server struct {
	Host     string `env:"HOST, default=127.0.0.1"`
	Port     string `env:"PORT, default=50051"`
	QuicHost string `env:"QUIC_HOST, default=127.0.0.1"`
	QuicPort string `env:"QUIC_PORT, default=4242"`
	CertPath string `env:"SSL_CERT_PATH"`
	KeyPath  string `env:"SSL_KEY_PATH"`
}

Server

type Tunnel

type Tunnel struct {
	ID       string `env:"ID"`
	Token    string `env:"TOKEN"`
	Endpoint string `env:"ENDPOINT"`
}

Tunnel

Jump to

Keyboard shortcuts

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