config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingGuardRailsAPIHost = errors.New("missing mandatory GUARDRAILS_API_HOST environment variables.")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	HttpClient       *HttpClientConfig
	GuardRailsClient *GuardRailsClient
}

Config provides centralized configuration for the application.

func New

func New() *Config

New instantiates new config.

type GuardRailsClient

type GuardRailsClient struct {
	APIHost string
}

GuardRailsClient contains configuration for guardrails client.

func NewGuardRailsClientConfig

func NewGuardRailsClientConfig() *GuardRailsClient

type HttpClientConfig

type HttpClientConfig struct {
	// PollingInterval define how long the client should wait before attempting to connect to API server.
	PollingInterval time.Duration
	// Timeout define maximum waiting time allowed for http connections before it considered timeout.
	Timeout time.Duration
	// RetryTimeout define maximum waiting time of doing backoff retry in case client get unexpected response from API server.
	RetryTimeout time.Duration
}

HttpClientConfig provides configuration for guardrails cli http client.

Jump to

Keyboard shortcuts

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