config

package
v0.0.0-...-8f202a6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCAL_ENV      = "local"
	STAGING_ENV    = "staging"
	PRODUCTION_ENV = "production"

	CONTENT_TYPE                     = "Content-Type"
	CONTENT_TYPE_JSON                = "application/json"
	ENV                              = "APEXA_ENV"
	POSTGRE_MASTER_DB_SECRET_MANAGER = "APEXA_POSTGRE_DB_MASTER"
	POSTGRE_SLAVE_DB_SECRET_MANAGER  = "APEXA_POSTGRE_DB_STAGING"
	REDIS_ADDR_SECRET_MANAGER        = "APEXA_REDIS_ADDR"
	REDIS_PASSWORD_SECRET_MANAGER    = "APEXA_REDIS_PASSWORD"
	REDIS_DB_SECRET_MANAGER          = "APEXA_REDIS_DB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bsi

type Bsi struct {
	Url   string `json:"BSI_URL"`
	Token string `json:"BSI_Token"`
}

type Config

type Config struct {
	Http       HttpConfig
	Database   DatabaseConfig
	Redis      RedisConfig
	Fonnte     FonnteConfig
	Starsender StarsenderConfig
	Privy      PrivyConfig
	S3         S3Config
	Bsi        Bsi
	SES        SESConfig
	SMTP       SMTPConfig
	Telegram   TelegramConfig
	Discord    DiscordConfig
	Secret     SecretManagerConfig
	Gotenberg  GotenbergConfig
	Media      MediaConfig
	Token      TokenConfig
}

func GetConfig

func GetConfig() (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	DriverName      string `json:"DATABASE_DriverName"`
	Master          string `json:"DATABASE_Master"`
	Slaves          string `json:"DATABASE_Slaves"`
	MaxOpenConns    int    `json:"DATABASE_MaxOpenConns"`
	MaxIdleConns    int    `json:"DATABASE_MaxIdleConns"`
	ConnMaxLifetime int    `json:"DATABASE_ConnMaxLifetime"`
	User            string `json:"DATABASE_User"`
	Password        string `json:"DATABASE_Password"`
	Network         string `json:"DATABASE_Network"`
	DBName          string `json:"DATABASE_DBName"`
	Address         string `json:"DATABASE_Address"`
}

type DiscordConfig

type DiscordConfig struct {
	BaseURL          string `json:"DISCORD_BaseURL"`
	ApiPrefix        string `json:"DISCORD_ApiPrefix"`
	DefaultWebhookID string `json:"DISCORD_DefaultWebhookID"`
	Token            string `json:"DISCORD_Token"`
}

type FonnteConfig

type FonnteConfig struct {
	BaseURL           string `json:"FONNTE_BaseURL"`
	OverSeasAPIKey    string `json:"FONNTE_OverSeasAPIKey"`
	DomesticAPIKey    string `json:"FONNTE_DomesticAPIKey"`
	OTPOverSeasAPIKey string `json:"FONNTE_OTPOverSeasAPIKey"`
	OTPDomesticAPIKey string `json:"FONNTE_OTPDomesticAPIKey"`
	Fallback          string `json:"FONNTE_Fallback"`
}

type GotenbergConfig

type GotenbergConfig struct {
	Url string
}

type HttpConfig

type HttpConfig struct {
	Address      string        `json:"HTTP_Address"`
	ReadTimeout  time.Duration `json:"HTTP_ReadTimeout"`
	WriteTimeout time.Duration `json:"HTTP_WriteTimeout"`
	ApiPrefix    string        `json:"HTTP_ApiPrefix"`
	BaseURL      string        `json:"HTTP_BaseURL"`
}

type MediaConfig

type MediaConfig struct {
	RootPath string
}

type PrivyConfig

type PrivyConfig struct {
	BaseURL     string `json:"PRIVY_BaseURL"`
	Username    string `json:"PRIVY_Username"`
	Password    string `json:"PRIVY_Password"`
	MerchantKey string `json:"PRIVY_MerchantKey"`
}

type RedisConfig

type RedisConfig struct {
	Address  string `json:"REDIS_Address"`
	Password string `json:"REDIS_Password"`
	DB       int    `json:"REDIS_DB"`
}

type S3Config

type S3Config struct {
	AccessKeyID     string `json:"S3_AccessKeyID"`
	SecretAccessKey string `json:"S3_SecretAccessKey"`
	SessionToken    string `json:"S3_SessionToken"`
	Region          string `json:"S3_Region"`
	Bucket          string `json:"S3_Bucket"`
	EndpointUrl     string `json:"S3_EndpointUrl"`
}

type SESConfig

type SESConfig struct {
	Region      string `json:"SES_Region"`
	AccessKey   string `json:"SES_AccessKey"`
	SecretKey   string `json:"SES_SecretKey"`
	Session     string `json:"SES_Session"`
	FromAddress string `json:"SES_FromAddress"`
	FromName    string `json:"SES_FromName"`
}

type SMTPConfig

type SMTPConfig struct {
	SMTPServer         string `json:"SMTP_SMTPServer"`
	SMTPPort           string `json:"SMTP_SMTPPort"`
	Identity           string `json:"SMTP_Identity"`
	Username           string `json:"SMTP_Username"`
	Password           string `json:"SMTP_Password"`
	FromAddress        string `json:"SMTP_FromAddress"`
	FromName           string `json:"SMTP_FromName"`
	AuthType           string `json:"SMTP_AuthType"`
	UseTLS             bool   `json:"SMTP_UseTLS"`
	InsecureSkipVerify bool   `json:"SMTP_InsecureSkipVerify"`
}

type SecretManagerConfig

type SecretManagerConfig struct {
	Provider   string `json:"SECRET_Provider"`
	Region     string `json:"SECRET_Region"`
	AccessKey  string `json:"SECRET_AccessKey"`
	SecretKey  string `json:"SECRET_SecretKey"`
	SecretName string `json:"SECRET_SecretName"`
}

type StarsenderConfig

type StarsenderConfig struct {
	BaseURL           string `json:"STARSENDER_BaseURL"`
	OverSeasAPIKey    string `json:"STARSENDER_OverSeasAPIKey"`
	DomesticAPIKey    string `json:"STARSENDER_DomesticAPIKey"`
	OTPOverSeasAPIKey string `json:"STARSENDER_OTPOverSeasAPIKey"`
	OTPDomesticAPIKey string `json:"STARSENDER_OTPDomesticAPIKey"`
	Fallback          string `json:"STARSENDER_Fallback"`
}

type TelegramConfig

type TelegramConfig struct {
	BaseURL       string `json:"TELEGRAM_BaseURL"`
	ApiPrefix     string `json:"TELEGRAM_ApiPrefix"`
	DefaultChatID string `json:"TELEGRAM_DefaultChatID"`
	Token         string `json:"TELEGRAM_Token"`
}

type TokenConfig

type TokenConfig struct {
	TokenExpiration string `json:"TokenExpiration"`
}

Jump to

Keyboard shortcuts

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