config

package
v0.0.0-...-29610b7 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCorsConfig

func LoadCorsConfig() middleware.CORSConfig

LoadCorsConfig loads the CORS configuration

func LoadNewRelicConfig

func LoadNewRelicConfig() newrelic.Config

LoadNewRelicConfig loads the newrelic configuration

Types

type AppConfig

type AppConfig struct {
	Name           string
	Version        string
	CmsUrl         string
	PortalUrl      string
	FileUrl        string
	Env            string
	Domain         string
	ContextTimeout time.Duration
}

AppConfig represents app configuration.

func LoadAppConfig

func LoadAppConfig() AppConfig

LoadAppConfig loads app configuration from file.

type AwsConfig

type AwsConfig struct {
	Env             string
	AccessKey       string
	SecretAccessKey string
	Region          string
	Bucket          string
	Cloudfront      string
}

SentryConfig is the sentry configuration

func LoadAwsConfig

func LoadAwsConfig() AwsConfig

LoadAwsConfig loads the sentry configuration

type Config

type Config struct {
	App      AppConfig
	DB       DBConfig
	JWT      JWTConfig
	Sentry   SentryConfig
	Cors     middleware.CORSConfig
	ELastic  ElasticConfig
	AWS      AwsConfig
	Redis    RedisConfig
	NewRelic newrelic.Config
	Mail     MailConfig
	External ExternalConfig
	Unleash  UnleashConfig
	Google   GoogleConfig
}

Config is the struct for the config

func NewConfig

func NewConfig() *Config

NewConfig creates a new Config struct

type DBConfig

type DBConfig struct {
	DSN             string
	MaxIdleConns    int
	MaxOpenConns    int
	ConnMaxIdleTime time.Duration
	ConnMaxLifetime time.Duration
}

DBConfig represents DB configuration.

func LoadDBConfig

func LoadDBConfig() DBConfig

LoadDBConfig loads DB configuration from file.

type ElasticConfig

type ElasticConfig struct {
	ElasticConfig *elasticsearch.Config
	IndexContent  string
	IndexSize     int
}

func LoadElasticConfig

func LoadElasticConfig() ElasticConfig

LoadElasticConfig loads the elasticsearch configuration

type ExternalConfig

type ExternalConfig struct {
	CoreDataUrl string
}

ExternalConfig represents app configuration.

func LoadExternalConfig

func LoadExternalConfig() ExternalConfig

LoadExternalConfig loads app configuration from file.

type GoogleConfig

type GoogleConfig struct {
	GoogleTranslateApiUrl string
	GoogleTranslateApiKey string
}

GoogleConfig represents app configuration.

func LoadGoogleConfig

func LoadGoogleConfig() GoogleConfig

LoadGoogleConfig loads app configuration from file.

type JWTConfig

type JWTConfig struct {
	AccessSecret      string
	RefreshSecret     string
	TTL               time.Duration
	RefreshTTL        time.Duration
	JSiteTTL          time.Duration
	JSiteAccessSecret string
}

JWTConfig represents JWT configuration.

func LoadJWTConfig

func LoadJWTConfig() JWTConfig

LoadJWTConfig loads JWT configuration.

type MailConfig

type MailConfig struct {
	SMTPHost     string
	SMTPPort     string
	SenderName   string
	ReceiverName string
	AuthEmail    string
	AuthPassword string
}

SentryConfig is the sentry configuration

func LoadMailConfig

func LoadMailConfig() MailConfig

LoadMailConfig loads the sentry configuration

type RedisConfig

type RedisConfig struct {
	Host string
	Port int
	TTL  time.Duration
}

func LoadRedisConfig

func LoadRedisConfig() RedisConfig

type SentryConfig

type SentryConfig struct {
	DSN              string
	TracesSampleRate float64
	Environment      string
}

SentryConfig is the sentry configuration

func LoadSentryConfig

func LoadSentryConfig() SentryConfig

LoadSentryConfig loads the sentry configuration

type UnleashConfig

type UnleashConfig struct {
	Url   string
	Token string
}

func LoadUnleashConfig

func LoadUnleashConfig() UnleashConfig

Jump to

Keyboard shortcuts

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