config

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = GetDefaultConfig()

Functions

This section is empty.

Types

type Config

type Config struct {
	Project         string `config:"project_id" validate:"required"`
	Topic           string `config:"topic" validate:"required"`
	CredentialsFile string `config:"credentials_file"`
	Subscription    struct {
		Name                string        `config:"name" validate:"required"`
		RetainAckedMessages bool          `config:"retain_acked_messages"`
		RetentionDuration   time.Duration `config:"retention_duration"`
		Create              bool          `config:"create"`

		// Settings for the Pub/Sub receiver
		ConnectionPoolSize int `config:"connection_pool_size"`
	}
	Json struct {
		Enabled               bool   `config:"enabled"`
		AddErrorKey           bool   `config:"add_error_key"`
		UseNumber             bool   `config:"use_number"`
		FieldsUnderRoot       bool   `config:"fields_under_root"`
		FieldsUseTimestamp    bool   `config:"fields_use_timestamp"`
		FieldsTimestampName   string `config:"fields_timestamp_name"`
		FieldsTimestampFormat string `config:"fields_timestamp_format"`
	}
}

func GetAndValidateConfig

func GetAndValidateConfig(cfg *common.Config) (*Config, error)

func GetDefaultConfig added in v1.3.0

func GetDefaultConfig() Config

Jump to

Keyboard shortcuts

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