Documentation ¶
Index ¶
- Constants
- func LoadConfig(p string, override *Configuration) error
- type APIKeyAuth
- type AuthConfiguration
- type AuthProvider
- type BasicAuth
- type CacheConfiguration
- type CacheProvider
- type Configuration
- type DatabaseConfiguration
- type DefaultStrategyConfiguration
- type ExponentialBackoffStrategyConfiguration
- type FileRealmOption
- type GroupConfig
- type HTTPServerConfiguration
- type LoggerConfiguration
- type LoggerProvider
- type NativeRealmOptions
- type NewRelicConfiguration
- type QueueConfiguration
- type QueueProvider
- type RedisCacheConfiguration
- type RedisQueueConfiguration
- type SMTPConfiguration
- type SentryConfiguration
- type ServerConfiguration
- type SignatureConfiguration
- type SignatureHeaderProvider
- type StrategyConfiguration
- type StrategyProvider
- type TracerConfiguration
- type TracerProvider
Constants ¶
View Source
const ( RedisQueueProvider QueueProvider = "redis" InMemoryQueueProvider QueueProvider = "in-memory" DefaultStrategyProvider StrategyProvider = "default" ExponentialBackoffStrategyProvider StrategyProvider = "exponential-backoff" DefaultSignatureHeader SignatureHeaderProvider = "X-Convoy-Signature" ConsoleLoggerProvider LoggerProvider = "console" NewRelicTracerProvider TracerProvider = "new_relic" RedisCacheProvider CacheProvider = "redis" )
View Source
const (
DevelopmentEnvironment string = "development"
)
View Source
const MaxResponseSize = 50 * 1024
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(p string, override *Configuration) error
LoadConfig is used to load the configuration from either the json config file or the environment variables.
Types ¶
type APIKeyAuth ¶
type AuthConfiguration ¶
type AuthConfiguration struct { RequireAuth bool `json:"require_auth"` File FileRealmOption `json:"file"` Native NativeRealmOptions `json:"native"` }
type AuthProvider ¶
type AuthProvider string
type CacheConfiguration ¶ added in v0.4.10
type CacheConfiguration struct { Type CacheProvider `json:"type"` Redis RedisCacheConfiguration `json:"redis"` }
type CacheProvider ¶ added in v0.4.10
type CacheProvider string
type Configuration ¶
type Configuration struct { Auth AuthConfiguration `json:"auth,omitempty"` Database DatabaseConfiguration `json:"database"` Sentry SentryConfiguration `json:"sentry"` Queue QueueConfiguration `json:"queue"` Server ServerConfiguration `json:"server"` MaxResponseSize uint64 `json:"max_response_size"` GroupConfig GroupConfig `json:"group"` SMTP SMTPConfiguration `json:"smtp"` Environment string `json:"env" envconfig:"CONVOY_ENV" required:"true" default:"development"` MultipleTenants bool `json:"multiple_tenants"` Logger LoggerConfiguration `json:"logger"` Tracer TracerConfiguration `json:"tracer"` NewRelic NewRelicConfiguration `json:"new_relic"` Cache CacheConfiguration `json:"cache"` BaseUrl string `json:"base_url"` }
func Get ¶
func Get() (Configuration, error)
Get fetches the application configuration. LoadConfig must have been called previously for this to work. Use this when you need to get access to the config object at runtime
type DatabaseConfiguration ¶
type ExponentialBackoffStrategyConfiguration ¶ added in v0.4.10
type ExponentialBackoffStrategyConfiguration struct {
RetryLimit uint64 `json:"retryLimit" envconfig:"CONVOY_RETRY_LIMIT"`
}
type FileRealmOption ¶
type FileRealmOption struct { Basic []BasicAuth `json:"basic" bson:"basic"` APIKey []APIKeyAuth `json:"api_key"` }
type GroupConfig ¶
type GroupConfig struct { Strategy StrategyConfiguration `json:"strategy"` Signature SignatureConfiguration `json:"signature"` DisableEndpoint bool `json:"disable_endpoint"` }
type HTTPServerConfiguration ¶
type HTTPServerConfiguration struct { SSL bool `json:"ssl" envconfig:"SSL"` SSLCertFile string `json:"ssl_cert_file" envconfig:"CONVOY_SSL_CERT_FILE"` SSLKeyFile string `json:"ssl_key_file" envconfig:"CONVOY_SSL_KEY_FILE"` Port uint32 `json:"port" envconfig:"PORT"` WorkerPort uint32 `json:"worker_port" envconfig:"WORKER_PORT"` }
type LoggerConfiguration ¶
type LoggerConfiguration struct { Type LoggerProvider `json:"type"` ServerLog struct { Level string `json:"level"` } `json:"server_log"` }
type LoggerProvider ¶
type LoggerProvider string
type NativeRealmOptions ¶
type NativeRealmOptions struct {
Enabled bool `json:"enabled"`
}
type NewRelicConfiguration ¶
type QueueConfiguration ¶
type QueueConfiguration struct { Type QueueProvider `json:"type" envconfig:"CONVOY_QUEUE_PROVIDER"` Redis RedisQueueConfiguration `json:"redis"` }
type QueueProvider ¶
type QueueProvider string
type RedisCacheConfiguration ¶ added in v0.4.10
type RedisCacheConfiguration struct {
Dsn string `json:"dsn"`
}
type RedisQueueConfiguration ¶
type RedisQueueConfiguration struct {
DSN string `json:"dsn" envconfig:"CONVOY_REDIS_DSN"`
}
type SMTPConfiguration ¶
type SentryConfiguration ¶
type SentryConfiguration struct {
Dsn string `json:"dsn" envconfig:"CONVOY_SENTRY_DSN"`
}
type ServerConfiguration ¶
type ServerConfiguration struct {
HTTP HTTPServerConfiguration `json:"http"`
}
type SignatureConfiguration ¶
type SignatureConfiguration struct { Header SignatureHeaderProvider `json:"header" envconfig:"CONVOY_SIGNATURE_HEADER"` Hash string `json:"hash" envconfig:"CONVOY_SIGNATURE_HASH"` }
type SignatureHeaderProvider ¶
type SignatureHeaderProvider string
func (SignatureHeaderProvider) String ¶
func (s SignatureHeaderProvider) String() string
type StrategyConfiguration ¶
type StrategyConfiguration struct { Type StrategyProvider `json:"type"` Default DefaultStrategyConfiguration `json:"default"` ExponentialBackoff ExponentialBackoffStrategyConfiguration `json:"exponentialBackoff,omitempty"` }
type StrategyProvider ¶
type StrategyProvider string
type TracerConfiguration ¶
type TracerConfiguration struct {
Type TracerProvider `json:"type"`
}
type TracerProvider ¶
type TracerProvider string
Click to show internal directories.
Click to hide internal directories.