config

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomHooks = []viper.DecoderConfigOption{
	addDecodeHook(PulsarCompressionTypeHookFunc()),
	addDecodeHook(PulsarCompressionLevelHookFunc()),
	addDecodeHook(QuantityDecodeHook()),
}

Functions

func FormatValidationErrors added in v0.12.1

func FormatValidationErrors(err error) error

func PulsarCompressionLevelHookFunc

func PulsarCompressionLevelHookFunc() mapstructure.DecodeHookFuncType

func PulsarCompressionTypeHookFunc

func PulsarCompressionTypeHookFunc() mapstructure.DecodeHookFuncType

func QuantityDecodeHook

func QuantityDecodeHook() mapstructure.DecodeHookFuncType

Types

type Config added in v0.12.1

type Config interface {
	Validate() error
}

type PulsarConfig added in v0.11.0

type PulsarConfig struct {
	// Pulsar URL
	URL string `validate:"required"`
	// Path to the trusted TLS certificate file (must exist)
	TLSTrustCertsFilePath string
	// Whether Pulsar client accept untrusted TLS certificate from broker
	TLSAllowInsecureConnection bool
	// Whether the Pulsar client will validate the hostname in the broker's TLS Cert matches the actual hostname.
	TLSValidateHostname bool
	// Max number of connections to a single broker that will be kept in the pool. (Default: 1 connection)
	MaxConnectionsPerBroker int
	// Whether Pulsar authentication is enabled
	AuthenticationEnabled bool
	// Authentication type. For now only "JWT" auth is valid
	AuthenticationType string
	// Path to the JWT token (must exist). This must be set if AuthenticationType is "JWT"
	JwtTokenPath string
	// The pulsar topic that Jobset Events will be published to
	JobsetEventsTopic string
	// Compression to use.  Valid values are "None", "LZ4", "Zlib", "Zstd".  Default is "None"
	CompressionType pulsar.CompressionType
	// Compression Level to use.  Valid values are "Default", "Better", "Faster".  Default is "Default"
	CompressionLevel pulsar.CompressionLevel
	// Maximum allowed Events per message
	MaxAllowedEventsPerMessage int `validate:"gte=0"`
	// Maximum allowed message size in bytes
	MaxAllowedMessageSize uint
	// Timeout when sending messages asynchronously
	SendTimeout time.Duration
	// Backoff from polling when Pulsar returns an error
	BackoffTime time.Duration
	// Number of pulsar messages that will be queued by the pulsar consumer.
	ReceiverQueueSize int
}

type RedisConfig

type RedisConfig struct {
	// Either a single address or a seed list of host:port addresses
	Addrs           []string `validate:"required"`
	DB              int      `validate:"gte=0,lte=16"`
	Password        string
	MaxRetries      int
	MinRetryBackoff time.Duration
	MaxRetryBackoff time.Duration
	DialTimeout     time.Duration
	ReadTimeout     time.Duration
	WriteTimeout    time.Duration
	PoolSize        int `validate:"required"`
	MinIdleConns    int
	MaxConnAge      time.Duration
	PoolTimeout     time.Duration
	IdleTimeout     time.Duration
	MasterName      string
}

func (RedisConfig) AsUniversalOptions

func (rc RedisConfig) AsUniversalOptions() *redis.UniversalOptions

Jump to

Keyboard shortcuts

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