config

package
v0.14.1-beta Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package config contains all the configuration attributes for running Optimizely Agent

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Auth                ServiceAuthConfig `json:"-"`
	MaxConns            int               `json:"maxConns"`
	Port                string            `json:"port"`
	EnableNotifications bool              `json:"enableNotifications"`
	EnableOverrides     bool              `json:"enableOverrides"`
}

APIConfig holds the REST API configuration

type AdminConfig

type AdminConfig struct {
	Auth ServiceAuthConfig `json:"-"`
	Port string            `json:"port"`
}

AdminConfig holds the configuration for the admin web interface

type AgentConfig

type AgentConfig struct {
	Version string `json:"version"`
	Author  string `json:"author"`
	Name    string `json:"name"`

	SDKKeys []string `yaml:"sdkKeys" json:"sdkKeys"`

	Admin   AdminConfig   `json:"admin"`
	API     APIConfig     `json:"api"`
	Log     LogConfig     `json:"log"`
	Client  ClientConfig  `json:"client"`
	Server  ServerConfig  `json:"server"`
	Webhook WebhookConfig `json:"webhook"`
}

AgentConfig is the top level configuration struct

func NewDefaultConfig

func NewDefaultConfig() *AgentConfig

NewDefaultConfig returns the default configuration for Optimizely Agent

type ClientConfig added in v0.13.0

type ClientConfig struct {
	PollingInterval time.Duration `json:"pollingInterval"`
	BatchSize       int           `json:"batchSize" default:"10"`
	QueueSize       int           `json:"queueSize" default:"1000"`
	FlushInterval   time.Duration `json:"flushInterval" default:"30s"`
}

ClientConfig holds the configuration options for the Optimizely Client.

type LogConfig

type LogConfig struct {
	Pretty bool   `json:"pretty"`
	Level  string `json:"level"`
}

LogConfig holds the log configuration

type OAuthClientCredentials added in v0.12.0

type OAuthClientCredentials struct {
	ID         string   `yaml:"id"`
	SecretHash string   `yaml:"secretHash"`
	SDKKeys    []string `yaml:"sdkKeys"`
}

OAuthClientCredentials are used for issuing access tokens

type ServerConfig

type ServerConfig struct {
	ReadTimeout     time.Duration `json:"readTimeout"`
	WriteTimeout    time.Duration `json:"writeTimeout"`
	CertFile        string        `json:"certFile"`
	KeyFile         string        `json:"keyFile"`
	DisabledCiphers []string      `json:"disabledCiphers"`
}

ServerConfig holds the global http server configs

type ServiceAuthConfig added in v0.12.0

type ServiceAuthConfig struct {
	Clients            []OAuthClientCredentials `yaml:"clients" json:"-"`
	HMACSecrets        []string                 `yaml:"hmacSecrets" json:"-"`
	TTL                time.Duration            `yaml:"ttl" json:"-"`
	JwksURL            string                   `yaml:"jwksURL"`
	JwksUpdateInterval time.Duration            `yaml:"jwksUpdateInterval"`
}

ServiceAuthConfig holds the authentication configuration for a particular service

type WebhookConfig

type WebhookConfig struct {
	Port     string                   `json:"port"`
	Projects map[int64]WebhookProject `json:"projects"`
}

WebhookConfig holds configuration for Optimizely Webhooks

type WebhookProject

type WebhookProject struct {
	SDKKeys            []string `json:"sdkKeys"`
	Secret             string   `json:"-"`
	SkipSignatureCheck bool     `json:"skipSignatureCheck" default:"false"`
}

WebhookProject holds the configuration for a single Project webhook

Jump to

Keyboard shortcuts

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