config

package
v0.0.0-...-76f7c0c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RabbitMQBroker = "RabbitMQ"
	SQSBroker      = "SQS"
)

Variables

This section is empty.

Functions

func ReadConfiguration

func ReadConfiguration() error

func ReadFlags

func ReadFlags()

func SetAWSSession

func SetAWSSession(sess *session.Session)

Types

type AWSConfig

type AWSConfig struct {
	Region            string
	DatabaseSecretARN string
	DynamoDB          DynamoDBConfig
}

type AuthConfig

type AuthConfig struct {
	GRPC GRPCConfig
}

type AuthenticationConfig

type AuthenticationConfig struct {
	AccessTokenDuration  int64  `json:"access_token_duration"`  // minutes
	RefreshTokenDuration int64  `json:"refresh_token_duration"` // minutes
	MFA                  bool   `json:"mfa"`
	Channel              string `json:"channel"`
}

type Config

type Config struct {
	Server         ServerConfig
	Redis          RedisConfig
	Authentication AuthenticationConfig
	SMTP           SMTPConfig
	MessageBroker  MessageBrokerConfig
	AWS            AWSConfig
	Services       ServicesConfig
	Prometheus     PrometheusConfig
	I18N           I18NConfig
	TemplateCache  map[string]*template.Template
}
var (
	AppConfig  Config
	AWSSession *session.Session
)

type DynamoDBConfig

type DynamoDBConfig struct {
	RoleARN         string
	RoleSessionName string
	RCU             int64
	WCU             int64
}

type GRPCConfig

type GRPCConfig struct {
	Deadline       int64 // milliseconds
	UseCompression bool
}

type Handler

type Handler struct {
}

func NewHandler

func NewHandler() *Handler

func (*Handler) GetConfig

func (h *Handler) GetConfig(c *gin.Context)

type I18NConfig

type I18NConfig struct {
	TableName  string
	Seed       bool
	SeedValues []*models.KeyValuePair
}

type MessageBrokerConfig

type MessageBrokerConfig struct {
	Broker   string
	RabbitMQ RabbitMQConfig
	SQS      SQSConfig
}

type PrometheusConfig

type PrometheusConfig struct {
	Enabled     bool
	MetricsPath string
}

type RabbitMQConfig

type RabbitMQConfig struct {
	DefaultUser     string
	DefaultPassword string
	Host            string
	Port            string
	Exchange        string
	Queue           string
}

type RedisConfig

type RedisConfig struct {
	Host     string
	Port     string
	Password string
}

type SMTPConfig

type SMTPConfig struct {
	ClientID     string
	ClientSecret string
	AccessToken  string
	RefreshToken string
}

type SQSConfig

type SQSConfig struct {
	QueueName                 string
	ContentBasedDeduplication string
	DelaySeconds              string
	MessageRetentionPeriod    string
	MaxNumberOfMessages       int64
	VisibilityTimeout         int64
	WaitTimeSeconds           int64
}

type ServerConfig

type ServerConfig struct {
	ListenAddress   string
	GinMode         string
	DevelopmentMode bool
}

type ServicesConfig

type ServicesConfig struct {
	Auth    AuthConfig
	Storage StorageConfig
}

type StorageConfig

type StorageConfig struct {
	GRPC            GRPCConfig
	ImagesPrefix    string
	DocumentsPrefix string
}

Jump to

Keyboard shortcuts

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