Documentation
¶
Index ¶
- Constants
- type AuthManagerConfig
- type AuthManagerProvider
- type AuthManagerStorage
- type Config
- type ConnectionConfig
- type ConsumerConfig
- type ForEachConfig
- type GatewayConfig
- type HTTPClientConfig
- type HTTPClientTLS
- type HTTPConfig
- type HTTPServerConfig
- type KVConfig
- type LogConfig
- type MetricsConfig
- type NATSConfig
- type PublishConfig
- type RulesConfig
- type SecurityConfig
- type ServeOverrides
- type VerificationConfig
Constants ¶
View Source
const ( DefaultNATSURL = "nats://localhost:4222" DefaultReconnectWait = 50 * time.Millisecond DefaultFetchTimeout = 5 * time.Second DefaultAckWaitTimeout = 30 * time.Second DefaultPublishAckTimeout = 5 * time.Second DefaultRetryBaseDelay = 50 * time.Millisecond DefaultHTTPReadTimeout = 30 * time.Second DefaultHTTPWriteTimeout = 30 * time.Second DefaultHTTPIdleTimeout = 120 * time.Second DefaultHTTPShutdownGracePeriod = 30 * time.Second DefaultHTTPClientTimeout = 30 * time.Second DefaultHTTPIdleConnTimeout = 90 * time.Second DefaultMaxHeaderBytes = 1 << 20 )
View Source
const ( DefaultWorkerCount = 2 DefaultFetchBatchSize = 1 DefaultMaxDeliver = 3 DefaultMaxAckPending = 1000 DefaultPublishMaxRetries = 3 DefaultMaxIdleConns = 100 DefaultMaxIdleConnsPerHost = 10 DefaultForEachMaxIterations = 100 DefaultInboundQueueSize = 1000 )
View Source
const ( MaxWorkerCount = 1000 MaxFetchBatchSize = 10000 MaxAckPending = 100000 MaxForEachIterations = 10000 MaxInboundQueueSize = 100000 )
View Source
const ( DefaultConsumerPrefix = "shunt" PublishModeJetStream = "jetstream" PublishModeCore = "core" DefaultPublishMode = PublishModeJetStream DefaultDeliverPolicy = "new" DefaultReplayPolicy = "instant" DefaultLogLevel = "info" DefaultLogEncoding = "json" DefaultLogOutput = "stdout" DefaultMetricsAddress = ":2112" DefaultMetricsPath = "/metrics" DefaultHTTPServerAddress = ":8080" DefaultPublicKeyHeader = "Nats-Public-Key" DefaultSignatureHeader = "Nats-Signature" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthManagerConfig ¶
type AuthManagerConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
Storage AuthManagerStorage `json:"storage" yaml:"storage"`
Providers []AuthManagerProvider `json:"providers" yaml:"providers"`
}
type AuthManagerProvider ¶
type AuthManagerProvider struct {
ID string `json:"id" yaml:"id"`
Type string `json:"type" yaml:"type"`
KVKey string `json:"kvKey" yaml:"kvKey"`
RefreshBefore string `json:"refreshBefore" yaml:"refreshBefore"`
RefreshEvery string `json:"refreshEvery" yaml:"refreshEvery"`
TokenURL string `json:"tokenUrl" yaml:"tokenUrl"`
ClientID string `json:"clientId" yaml:"clientId"`
ClientSecret string `json:"clientSecret" yaml:"clientSecret"`
Scopes []string `json:"scopes" yaml:"scopes"`
AuthURL string `json:"authUrl" yaml:"authUrl"`
Method string `json:"method" yaml:"method"`
Headers map[string]string `json:"headers" yaml:"headers"`
Body string `json:"body" yaml:"body"`
TokenPath string `json:"tokenPath" yaml:"tokenPath"`
}
type AuthManagerStorage ¶
type Config ¶
type Config struct {
NATS NATSConfig `json:"nats" yaml:"nats"`
HTTP HTTPConfig `json:"http,omitempty" yaml:"http,omitempty"`
Logging LogConfig `json:"logging" yaml:"logging"`
Metrics MetricsConfig `json:"metrics" yaml:"metrics"`
KV KVConfig `json:"kv" yaml:"kv"`
Rules RulesConfig `json:"rules" yaml:"rules"`
Security SecurityConfig `json:"security" yaml:"security"`
ForEach ForEachConfig `json:"forEach" yaml:"forEach"`
Gateway GatewayConfig `json:"gateway" yaml:"gateway"`
AuthManager AuthManagerConfig `json:"authManager" yaml:"authManager"`
}
func NewDefaults ¶ added in v0.1.1
func NewDefaults() *Config
NewDefaults returns a Config populated with all default values. Useful for programmatic config construction (e.g. dev/test commands).
func (*Config) ApplyOverrides ¶
func (c *Config) ApplyOverrides(o ServeOverrides)
type ConnectionConfig ¶
type ConsumerConfig ¶
type ConsumerConfig struct {
ConsumerPrefix string `json:"consumerPrefix" yaml:"consumerPrefix"`
WorkerCount int `json:"workerCount" yaml:"workerCount"`
FetchBatchSize int `json:"fetchBatchSize" yaml:"fetchBatchSize"`
FetchTimeout time.Duration `json:"fetchTimeout" yaml:"fetchTimeout"`
MaxAckPending int `json:"maxAckPending" yaml:"maxAckPending"`
AckWaitTimeout time.Duration `json:"ackWaitTimeout" yaml:"ackWaitTimeout"`
MaxDeliver int `json:"maxDeliver" yaml:"maxDeliver"`
DeliverPolicy string `json:"deliverPolicy" yaml:"deliverPolicy"`
ReplayPolicy string `json:"replayPolicy" yaml:"replayPolicy"`
}
type ForEachConfig ¶
type ForEachConfig struct {
MaxIterations int `json:"maxIterations" yaml:"maxIterations"`
}
type GatewayConfig ¶
type GatewayConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
}
type HTTPClientConfig ¶
type HTTPClientConfig struct {
Timeout time.Duration `json:"timeout" yaml:"timeout"`
MaxIdleConns int `json:"maxIdleConns" yaml:"maxIdleConns"`
MaxIdleConnsPerHost int `json:"maxIdleConnsPerHost" yaml:"maxIdleConnsPerHost"`
IdleConnTimeout time.Duration `json:"idleConnTimeout" yaml:"idleConnTimeout"`
TLS HTTPClientTLS `json:"tls,omitempty" yaml:"tls,omitempty"`
}
type HTTPClientTLS ¶
type HTTPClientTLS struct {
InsecureSkipVerify bool `json:"insecureSkipVerify" yaml:"insecureSkipVerify"`
}
type HTTPConfig ¶
type HTTPConfig struct {
Server HTTPServerConfig `json:"server" yaml:"server"`
Client HTTPClientConfig `json:"client" yaml:"client"`
}
type HTTPServerConfig ¶
type HTTPServerConfig struct {
Address string `json:"address" yaml:"address"`
ReadTimeout time.Duration `json:"readTimeout" yaml:"readTimeout"`
WriteTimeout time.Duration `json:"writeTimeout" yaml:"writeTimeout"`
IdleTimeout time.Duration `json:"idleTimeout" yaml:"idleTimeout"`
MaxHeaderBytes int `json:"maxHeaderBytes" yaml:"maxHeaderBytes"`
ShutdownGracePeriod time.Duration `json:"shutdownGracePeriod" yaml:"shutdownGracePeriod"`
InboundWorkerCount int `json:"inboundWorkerCount" yaml:"inboundWorkerCount"`
InboundQueueSize int `json:"inboundQueueSize" yaml:"inboundQueueSize"`
}
type MetricsConfig ¶
type NATSConfig ¶
type NATSConfig struct {
URLs []string `json:"urls" yaml:"urls"`
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
Token string `json:"token" yaml:"token"`
NKey string `json:"nkey" yaml:"nkey"`
CredsFile string `json:"credsFile" yaml:"credsFile"`
TLS struct {
Enable bool `json:"enable" yaml:"enable"`
CertFile string `json:"certFile" yaml:"certFile"`
KeyFile string `json:"keyFile" yaml:"keyFile"`
CAFile string `json:"caFile" yaml:"caFile"`
Insecure bool `json:"insecure" yaml:"insecure"`
} `json:"tls" yaml:"tls"`
Consumers ConsumerConfig `json:"consumers" yaml:"consumers"`
Connection ConnectionConfig `json:"connection" yaml:"connection"`
Publish PublishConfig `json:"publish" yaml:"publish"`
}
type PublishConfig ¶
type RulesConfig ¶
type RulesConfig struct {
KVBucket string `json:"kvBucket" yaml:"kvBucket"`
}
type SecurityConfig ¶
type SecurityConfig struct {
Verification VerificationConfig `json:"verification" yaml:"verification"`
}
type ServeOverrides ¶
type VerificationConfig ¶
Click to show internal directories.
Click to hide internal directories.