modules

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderAWS   string = "aws"
	ProviderVault string = "vault"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLConfig

type ACLConfig struct {
	Deny []string `yaml:"deny" json:"deny" default:"[\"@default\"]"`
}

func (*ACLConfig) Validate

func (acl *ACLConfig) Validate() error

type AccessLogConfig

type AccessLogConfig struct {
	BaseConfig
	Enabled bool      `yaml:"enabled" json:"enabled" default:"true"`
	Format  LogFormat `yaml:"format" json:"format" default:"text"`
	Colored bool      `yaml:"colored" json:"colored" default:"true"`
	File    string    `yaml:"file" json:"file"`
}

func (AccessLogConfig) Validate

func (cfg AccessLogConfig) Validate() error

type AdminConfig

type AdminConfig struct {
	BaseConfig
	Listen         string `yaml:"listen" json:"listen" default:"127.0.0.1:9601"`
	DebugEndpoints bool   `yaml:"debug_endpoints" json:"debug_endpoints" envconfig:"DEBUG_ENDPOINTS"`
	TLS            TLS    `yaml:"tls" json:"tls"`
}

func (AdminConfig) IsEnabled

func (cfg AdminConfig) IsEnabled() bool

func (AdminConfig) URL added in v1.0.1

func (cfg AdminConfig) URL() string

func (AdminConfig) Validate

func (cfg AdminConfig) Validate() error

type AwsProvider

type AwsProvider struct {
	Region string `json:"region" yaml:"region"`
	URL    string `json:"url" yaml:"url"`
}

func (*AwsProvider) Validate

func (cfg *AwsProvider) Validate() error

type BaseConfig

type BaseConfig struct{}

func (BaseConfig) PostProcess

func (c BaseConfig) PostProcess() error

func (BaseConfig) Validate

func (c BaseConfig) Validate() error

type DatabaseConfig

type DatabaseConfig struct {
	BaseConfig
	Host        string         `yaml:"host" json:"host" default:"127.0.0.1"`
	Port        uint32         `yaml:"port" json:"port" default:"5432"`
	Username    string         `yaml:"username" json:"username" default:"webhookx"`
	Password    types.Password `yaml:"password" json:"password" default:""`
	Database    string         `yaml:"database" json:"database" default:"webhookx"`
	Parameters  string         `yaml:"parameters" json:"parameters" default:"application_name=webhookx&sslmode=disable&connect_timeout=10"`
	MaxPoolSize uint32         `yaml:"max_pool_size" json:"max_pool_size" default:"40" envconfig:"MAX_POOL_SIZE"`
	MaxLifetime uint32         `yaml:"max_life_time" json:"max_life_time" default:"1800" envconfig:"MAX_LIFETIME"`
}

func (DatabaseConfig) GetDSN

func (cfg DatabaseConfig) GetDSN() string

func (DatabaseConfig) Validate

func (cfg DatabaseConfig) Validate() error

type Export

type Export string
const (
	ExportOpenTelemetry Export = "opentelemetry"
)

type LogConfig

type LogConfig struct {
	BaseConfig
	Level   LogLevel  `yaml:"level" json:"level" default:"info"`
	Format  LogFormat `yaml:"format" json:"format" default:"text"`
	Colored bool      `yaml:"colored" json:"colored" default:"true"`
	File    string    `yaml:"file" json:"file"`
}

func (LogConfig) Validate

func (cfg LogConfig) Validate() error

type LogFormat

type LogFormat string
const (
	LogFormatText LogFormat = "text"
	LogFormatJson LogFormat = "json"
)

type LogLevel

type LogLevel string
const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
)

type MetricsConfig

type MetricsConfig struct {
	BaseConfig
	Attributes    types.Map            `yaml:"attributes" json:"attributes"`
	Exports       []Export             `yaml:"exports" json:"exports"`
	PushInterval  uint32               `yaml:"push_interval" json:"push_interval" default:"10" envconfig:"PUSH_INTERVAL"`
	Opentelemetry OpentelemetryMetrics `yaml:"opentelemetry" json:"opentelemetry"`
}

func (*MetricsConfig) Validate

func (cfg *MetricsConfig) Validate() error

type OpentelemetryMetrics

type OpentelemetryMetrics struct {
	Protocol OtlpProtocol `yaml:"protocol" json:"protocol" envconfig:"PROTOCOL" default:"http/protobuf"`
	Endpoint string       `yaml:"endpoint" json:"endpoint" envconfig:"ENDPOINT" default:"http://127.0.0.1:4318/v1/metrics"`
}

func (OpentelemetryMetrics) Validate

func (cfg OpentelemetryMetrics) Validate() error

type OpentelemetryTracing

type OpentelemetryTracing struct {
	Protocol OtlpProtocol `yaml:"protocol" json:"protocol" envconfig:"PROTOCOL" default:"http/protobuf"`
	Endpoint string       `yaml:"endpoint" json:"endpoint" envconfig:"ENDPOINT" default:"http://127.0.0.1:4318/v1/traces"`
}

func (OpentelemetryTracing) Validate

func (cfg OpentelemetryTracing) Validate() error

type OtlpProtocol

type OtlpProtocol string
const (
	OtlpProtocolGRPC OtlpProtocol = "grpc"
	OtlpProtocolHTTP OtlpProtocol = "http/protobuf"
)

type Pool

type Pool struct {
	Size        uint32 `yaml:"size" json:"size" default:"10000"`
	Concurrency uint32 `yaml:"concurrency" json:"concurrency"`
}

type ProxyConfig

type ProxyConfig struct {
	BaseConfig
	Listen             string        `yaml:"listen" json:"listen" default:"0.0.0.0:9600"`
	TLS                TLS           `yaml:"tls" json:"tls"`
	TimeoutRead        int64         `yaml:"timeout_read" json:"timeout_read" default:"10" envconfig:"TIMEOUT_READ"`
	TimeoutWrite       int64         `yaml:"timeout_write" json:"timeout_write" default:"10" envconfig:"TIMEOUT_WRITE"`
	MaxRequestBodySize int64         `yaml:"max_request_body_size" json:"max_request_body_size" default:"1048576" envconfig:"MAX_REQUEST_BODY_SIZE"`
	Response           ProxyResponse `yaml:"response" json:"response"`
	Queue              Queue         `yaml:"queue" json:"queue"`
}

func (ProxyConfig) IsEnabled

func (cfg ProxyConfig) IsEnabled() bool

func (ProxyConfig) URL added in v1.0.1

func (cfg ProxyConfig) URL() string

func (ProxyConfig) Validate

func (cfg ProxyConfig) Validate() error

type ProxyResponse

type ProxyResponse struct {
	Code        uint   `yaml:"code" json:"code" default:"200"`
	ContentType string `yaml:"content_type" json:"content_type" default:"application/json" envconfig:"CONTENT_TYPE"`
	Body        string `yaml:"body" json:"body" default:"{\"message\": \"OK\"}"`
}

type Queue

type Queue struct {
	Type  QueueType   `yaml:"type" json:"type" default:"redis"`
	Redis RedisConfig `yaml:"redis" json:"redis"`
}

func (Queue) Validate

func (cfg Queue) Validate() error

type QueueType

type QueueType string
const (
	QueueTypeOff   QueueType = "off"
	QueueTypeRedis QueueType = "redis"
)

type RedisConfig

type RedisConfig struct {
	BaseConfig
	Host        string         `yaml:"host" json:"host" default:"127.0.0.1"`
	Port        uint32         `yaml:"port" json:"port" default:"6379"`
	Password    types.Password `yaml:"password" json:"password" default:""`
	Database    uint32         `yaml:"database" json:"database" default:"0"`
	MaxPoolSize uint32         `yaml:"max_pool_size" json:"max_pool_size" default:"0"`
}

func (RedisConfig) GetClient

func (cfg RedisConfig) GetClient() *redis.Client

func (RedisConfig) Validate

func (cfg RedisConfig) Validate() error

type SecretConfig

type SecretConfig struct {
	BaseConfig
	Providers []string      `json:"providers" yaml:"providers" default:"[\"@default\"]"`
	TTL       uint32        `json:"ttl" yaml:"ttl"`
	Aws       AwsProvider   `json:"aws" yaml:"aws"`
	Vault     VaultProvider `json:"vault" yaml:"vault"`
}

func (*SecretConfig) Enabled

func (cfg *SecretConfig) Enabled() bool

func (*SecretConfig) GetProviderConfiguration

func (cfg *SecretConfig) GetProviderConfiguration(name string) map[string]interface{}

func (*SecretConfig) GetProviders

func (cfg *SecretConfig) GetProviders() []string

func (*SecretConfig) Validate

func (cfg *SecretConfig) Validate() error

type StatusConfig

type StatusConfig struct {
	BaseConfig
	Listen         string `yaml:"listen" json:"listen" default:"127.0.0.1:9602"`
	DebugEndpoints bool   `yaml:"debug_endpoints" json:"debug_endpoints" default:"true" envconfig:"DEBUG_ENDPOINTS"`
}

func (StatusConfig) IsEnabled

func (cfg StatusConfig) IsEnabled() bool

func (StatusConfig) URL added in v1.0.1

func (cfg StatusConfig) URL() string

func (StatusConfig) Validate

func (cfg StatusConfig) Validate() error

type TLS

type TLS struct {
	Cert string `yaml:"cert" json:"cert"`
	Key  string `yaml:"key" json:"key"`
}

func (TLS) Enabled

func (cfg TLS) Enabled() bool

type TracingConfig

type TracingConfig struct {
	BaseConfig
	InstanceID       string               `yaml:"-" json:"-"`
	Instrumentations []string             `yaml:"instrumentations" json:"instrumentations"`
	Attributes       types.Map            `yaml:"attributes" json:"attributes"`
	Opentelemetry    OpentelemetryTracing `yaml:"opentelemetry" json:"opentelemetry"`
	SamplingRate     float64              `yaml:"sampling_rate" json:"sampling_rate" default:"1.0" envconfig:"SAMPLING_RATE"`
}

func (*TracingConfig) Enabled

func (cfg *TracingConfig) Enabled() bool

func (*TracingConfig) Validate

func (cfg *TracingConfig) Validate() error

type VaultProvider

type VaultProvider struct {
	Address    string      `json:"address" yaml:"address" default:"http://127.0.0.1:8200"`
	MountPath  string      `json:"mount_path" yaml:"mount_path" default:"secret" split_words:"true"`
	Namespace  string      `json:"namespace" yaml:"namespace"`
	AuthMethod string      `json:"auth_method" yaml:"auth_method" default:"token" split_words:"true"`
	AuthN      vault.AuthN `json:"authn" yaml:"authn"`
}

func (*VaultProvider) Validate

func (cfg *VaultProvider) Validate() error

type WorkerConfig

type WorkerConfig struct {
	BaseConfig
	Enabled   bool            `yaml:"enabled" json:"enabled" default:"true"`
	Deliverer WorkerDeliverer `yaml:"deliverer" json:"deliverer"`
	Pool      Pool            `yaml:"pool" json:"pool"`
}

func (*WorkerConfig) Status added in v1.0.1

func (cfg *WorkerConfig) Status() string

func (*WorkerConfig) Validate

func (cfg *WorkerConfig) Validate() error

type WorkerDeliverer

type WorkerDeliverer struct {
	Timeout        int64     `yaml:"timeout" json:"timeout" default:"60000"`
	ACL            ACLConfig `yaml:"acl" json:"acl"`
	Proxy          string    `yaml:"proxy" json:"proxy"`
	ProxyTLSCert   string    `yaml:"proxy_tls_cert" json:"proxy_tls_cert" envconfig:"PROXY_TLS_CERT"`
	ProxyTLSKey    string    `yaml:"proxy_tls_key" json:"proxy_tls_key" envconfig:"PROXY_TLS_KEY"`
	ProxyTLSCaCert string    `yaml:"proxy_tls_ca_cert" json:"proxy_tls_ca_cert" envconfig:"PROXY_TLS_CA_CERT"`
	ProxyTLSVerify bool      `yaml:"proxy_tls_verify" json:"proxy_tls_verify" envconfig:"PROXY_TLS_VERIFY"`
}

func (*WorkerDeliverer) Validate

func (cfg *WorkerDeliverer) Validate() error

Jump to

Keyboard shortcuts

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