config

package
v0.0.0-...-7e31de2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AProvider

type AProvider struct {
	ClientURL string `env:"URL" envDefault:"http://0.0.0.0:8080"`
	Token     string `env:"Token" envDefault:""`
}

func (*AProvider) GetCircuitBreakerConfig

func (p *AProvider) GetCircuitBreakerConfig() *gobreaker.CircuitBreaker

type App

type App struct {
	Env  string `env:"ENV" envDefault:"development"`
	Name string `env:"NAME" envDefault:"EXIFY"`
}

type BProvider

type BProvider struct {
	ClientURL string `env:"URL" envDefault:"http://0.0.0.0:8080"`
	Token     string `env:"Token" envDefault:""`
}

func (*BProvider) GetCircuitBreakerConfig

func (p *BProvider) GetCircuitBreakerConfig() *gobreaker.CircuitBreaker

type Configs

type Configs struct {
	App   App         `envPrefix:"APP_"`
	Mysql Mysql       `envPrefix:"MYSQL_"`
	A     AProvider   `envPrefix:"A_"`
	B     BProvider   `envPrefix:"B_"`
	Http  Http        `envPrefix:"HTTP_"`
	Kafka KafkaConfig `envPrefix:"KAFKA_"`
}

func Configure

func Configure() (*Configs, error)

type Http

type Http struct {
	Port    string `env:"PORT" envDefault:"3000"`
	Address string `env:"ADDRESS" envDefault:"0.0.0.0"`
}

type KafkaConfig

type KafkaConfig struct {
	Brokers []string `env:"KAFKA_BROKERS"   envSeparator:"," envDefault:"localhost:9092"`
}

func (KafkaConfig) ToSaramaConfig

func (conf KafkaConfig) ToSaramaConfig() (*sarama.Config, error)

type Mysql

type Mysql struct {
	DSN string `env:"DSN" envDefault:"root:1234@tcp(127.0.0.1:3316)/exify?charset=utf8&parseTime=True&loc=Local"`
}

Jump to

Keyboard shortcuts

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