config

package
v0.0.0-...-1b0f532 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Port       string `env:"SUPERHERO_UPDATE_MEDIA_APP_PORT" yaml:"port" default:":7100"`
	TimeFormat string `env:"SUPERHERO_UPDATE_MEDIA_APP_TIME_FORMAT" yaml:"time_format" default:"2006-01-02T15:04:05"`
}

App holds the configuration values for the application.

type Aws

type Aws struct {
	Region              string `env:"AWS_REGION" yaml:"region" default:"us-west-2"`
	SuperheroesS3Bucket string `env:"AWS_SUPERHEROES_S3_BUCKET" yaml:"superheroes_s3_bucket" default:"superheroes-pictures"`
	CdnURL              string `env:"AWS_CDN_URL" yaml:"cdn_url" default:"d3pfwtk1dtfl92.cloudfront.net"`
	ImageExtension      string `env:"AWS_IMAGE_EXTENSION" yaml:"image_extension" default:"jpg"`
	ContentType         string `env:"AWS_IMAGE_CONTENT_TYPE" yaml:"content_type" default:"image/jpg"`
	ContentEncoding     string `env:"AWS_IMAGE_CONTENT_ENCODING" yaml:"content_encoding" default:"base64"`
}

type Config

type Config struct {
	App      *App
	Aws      *Aws
	Producer *Producer
}

Config holds the configuration.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns the configuration.

type Producer

type Producer struct {
	Brokers      string `env:"KAFKA_BROKERS" yaml:"brokers" default:"192.168.1.229:9092"`
	Topic        string `env:"KAFKA_UPDATE_MUNICIPALITY_PROFILE_PICTURE_TOPIC" yaml:"topic" default:"update.municipality.profilepicture"`
	BatchSize    int    `env:"KAFKA_BATCH_SIZE" yaml:"batch_size" default:"1"`
	BatchTimeout int    `env:"KAFKA_BATCH_TIMEOUT" yaml:"batch_timeout" default:"10"`
}

Producer holds the configuration values for the Kafka producer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳