config

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 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"`
}

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"`
	Processor ProcessorConfig `json:"processor"`
	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 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"`
	Secret string `yaml:"secret"`
}

OAuthClientCredentials are used for issuing access tokens

type ProcessorConfig

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

ProcessorConfig holds the configuration options for the Optimizely Event Processor.

type ServerConfig

type ServerConfig struct {
	ReadTimeout  time.Duration `json:"readtimeout"`
	WriteTimeout time.Duration `json:"writetimeout"`
	CertFile     string        `json:"certfile"`
	KeyFile      string        `json:"keyfile"`
}

ServerConfig holds the global http server configs

type ServiceAuthConfig added in v0.12.0

type ServiceAuthConfig struct {
	Clients    []OAuthClientCredentials `yaml:"clients" json:"-"`
	HMACSecret string                   `yaml:"hmacSecret" json:"-"`
	TTL        time.Duration            `yaml:"ttl" json:"-"`
}

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