config

package
v0.0.0-...-3f89699 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Dev  environment = "dev"
	Prod environment = "prod"
)
View Source
const (
	Debug = "debug"
	Info  = "info"
	Warn  = "warn"
	Error = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Config *Config
	Logger *slog.Logger
	Models *data.Models
	RDB    *redis.Client
}

type Config

type Config struct {
	Environment environment `json:"environment"`
	Port        string      `json:"port"`
	Cache       bool        `json:"cache"`

	DB     DB     `json:"db"`
	JWT    JWT    `json:"jwt"`
	Logger Logger `json:"logger"`
}

type DB

type DB struct {
	Sql   Sql   `json:"sql"`
	Redis Redis `json:"redis"`
}

type JWT

type JWT struct {
	Secret string           `json:"secret"`
	Expire string           `json:"expire"`
	Token  *jwtauth.JWTAuth `json:"-"`
}

type Logger

type Logger struct {
	Level level `json:"level"`
}

type Redis

type Redis struct {
	Host     string `json:"host"`
	Password string `json:"password"`
	Port     string `json:"port"`
	DB       int    `json:"db"`
}

type Sql

type Sql struct {
	Host     string `json:"host"`
	Port     string `json:"port"`
	Username string `json:"username"`
	Password string `json:"password"`
	Name     string `json:"name"`
}

Jump to

Keyboard shortcuts

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