config

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxHTTPHeaderBytes = 1 << 12 // 4 KiB

	DefaultSeqDBClientID       = "default_seq_db"
	DefaultCHClientID          = "default_ch"
	DefaultInmemID             = "default_inmem"
	DefaultRedisWithInmemID    = "default_redis_with_inmem"
	DefaultRedisWithoutInmemID = "default_redis_without_inmem"
	DefaultMassExportRedisID   = "default_mass_export_redis"

	SeqDBClientModeGRPC = "grpc"

	MaskModeMask    = "mask"
	MaskModeReplace = "replace"
	MaskModeCut     = "cut"

	FieldFilterConditionAnd = "and"
	FieldFilterConditionOr  = "or"
	FieldFilterConditionNot = "not"

	FieldFilterModeEqual    = "equal"
	FieldFilterModeContains = "contains"
	FieldFilterModePrefix   = "prefix"
	FieldFilterModeSuffix   = "suffix"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Options    AdminOptions             `yaml:"options"`
	Envs       map[string]*AdminOptions `yaml:"envs,omitempty"`
	DefaultEnv string                   `yaml:"default_env,omitempty"`
}

type AdminOptions

type AdminOptions struct {
	SuperUsers []string      `yaml:"super_users,omitempty"`
	Cache      *HandlerCache `yaml:"cache,omitempty"`
}

type ApiToRateLimiters

type ApiToRateLimiters map[string]RateLimiters

type AsyncSearch

type AsyncSearch struct {
	Options    AsyncSearchOptions             `yaml:"options"`
	Envs       map[string]*AsyncSearchOptions `yaml:"envs,omitempty"`
	DefaultEnv string                         `yaml:"default_env,omitempty"`
}

type AsyncSearchOptions

type AsyncSearchOptions struct {
	SeqDBID              string   `yaml:"seq_db_id,omitempty"`
	AdminUsers           []string `yaml:"admin_users,omitempty"`
	ListQueryLengthLimit int      `yaml:"list_query_length_limit,omitempty"`
}

type Auth

type Auth struct {
	Options AuthOptions            `yaml:"options"`
	Envs    map[string]AuthOptions `yaml:"envs,omitempty"`
}

type AuthOptions

type AuthOptions struct {
	OIDC *OIDC `yaml:"oidc,omitempty"`
	JWT  *JWT  `yaml:"jwt,omitempty"`
}

type Backoff

type Backoff struct {
	InitialInterval time.Duration `yaml:"initial_interval,omitempty"`
	MaxInterval     time.Duration `yaml:"max_interval,omitempty"`
}

type CHClient

type CHClient struct {
	Addrs       []string      `yaml:"addrs"`
	Database    string        `yaml:"database,omitempty"`
	Username    string        `yaml:"username,omitempty"`
	Password    string        `yaml:"password,omitempty"`
	Sharded     bool          `yaml:"sharded,omitempty"`
	DialTimeout time.Duration `yaml:"dial_timeout,omitempty"`
	ReadTimeout time.Duration `yaml:"read_timeout,omitempty"`
}

type CORS

type CORS struct {
	AllowedOrigins     []string `yaml:"allowed_origins,omitempty"`
	AllowedMethods     []string `yaml:"allowed_methods,omitempty"`
	AllowedHeaders     []string `yaml:"allowed_headers,omitempty"`
	ExposedHeaders     []string `yaml:"exposed_headers,omitempty"`
	MaxAge             int      `yaml:"max_age,omitempty"`
	AllowCredentials   bool     `yaml:"allow_credentials,omitempty"`
	OptionsPassthrough bool     `yaml:"options_passthrough,omitempty"`
}

type Cache

type Cache struct {
	Inmemory map[string]*Inmemory `yaml:"inmemory,omitempty"`
	Redis    map[string]*Redis    `yaml:"redis,omitempty"`
}

type Clients

type Clients struct {
	SeqDB      map[string]*SeqDBClient `yaml:"seq_db"`
	ClickHouse map[string]*CHClient    `yaml:"clickhouse,omitempty"`
}

type Config

type Config struct {
	Version  int      `yaml:"version"`
	Server   Server   `yaml:"server"`
	Clients  Clients  `yaml:"clients"`
	Handlers Handlers `yaml:"handlers"`
	Cache    Cache    `yaml:"cache,omitempty"`
	DB       *DB      `yaml:"db,omitempty"`
}

func (*Config) Validate

func (cfg *Config) Validate() error

type DB

type DB struct {
	Name                   string        `yaml:"name"`
	Host                   string        `yaml:"host"`
	Port                   int64         `yaml:"port"`
	User                   string        `yaml:"user"`
	Pass                   string        `yaml:"pass"`
	RequestTimeout         time.Duration `yaml:"request_timeout"`
	ConnectionPoolCapacity int64         `yaml:"connection_pool_capacity"`
	UsePreparedStatements  *bool         `yaml:"use_prepared_statements,omitempty"`
}

func (*DB) ConnString

func (db *DB) ConnString() string

type Debug

type Debug struct {
	Addr              string        `yaml:"addr"`
	ReadHeaderTimeout time.Duration `yaml:"read_header_timeout,omitempty"`
	ReadTimeout       time.Duration `yaml:"read_timeout,omitempty"`
	WriteTimeout      time.Duration `yaml:"write_timeout,omitempty"`
	CORS              *CORS         `yaml:"cors,omitempty"`
}

type DownloadParams

type DownloadParams struct {
	BatchSize    uint64        `yaml:"batch_size,omitempty"`
	Delay        time.Duration `yaml:"delay,omitempty"`
	DelayBackoff Backoff       `yaml:"delay_backoff,omitempty"`
}

type ErrorGroups

type ErrorGroups struct {
	Options    ErrorGroupsOptions             `yaml:"options"`
	Envs       map[string]*ErrorGroupsOptions `yaml:"envs,omitempty"`
	DefaultEnv string                         `yaml:"default_env,omitempty"`
}

type ErrorGroupsOptions

type ErrorGroupsOptions struct {
	CHID           string            `yaml:"ch_id,omitempty"`
	LogTagsMapping LogTagsMapping    `yaml:"log_tags_mapping"`
	QueryFilter    map[string]string `yaml:"query_filter,omitempty"`
}

type Field

type Field struct {
	Name string `yaml:"name"`
	Type string `yaml:"type"`
}

type FieldFilter

type FieldFilter struct {
	Field  string   `yaml:"field"`
	Mode   string   `yaml:"mode"` // "equal" or "contains" or "prefix" or "suffix"
	Values []string `yaml:"values"`
}

type FieldFilterSet

type FieldFilterSet struct {
	Condition string        `yaml:"condition"` // "and" or "or" or "not"
	Filters   []FieldFilter `yaml:"filters"`   // max 1 if condition:not
}

type FileStore

type FileStore struct {
	S3 *S3 `yaml:"s3"`
}

type GRPC

type GRPC struct {
	Addr              string        `yaml:"addr"`
	ConnectionTimeout time.Duration `yaml:"connection_timeout,omitempty"`
}

type GRPCParams

type GRPCParams struct {
	Keepalive *KeepaliveParams `yaml:"keepalive,omitempty"`
}

type HTTP

type HTTP struct {
	Addr              string        `yaml:"addr"`
	ReadHeaderTimeout time.Duration `yaml:"read_header_timeout,omitempty"`
	ReadTimeout       time.Duration `yaml:"read_timeout,omitempty"`
	WriteTimeout      time.Duration `yaml:"write_timeout,omitempty"`
	CORS              *CORS         `yaml:"cors,omitempty"`
}

type HandlerCache

type HandlerCache struct {
	ID  string        `yaml:"id"`
	TTL time.Duration `yaml:"ttl,omitempty"`
}

type Handlers

type Handlers struct {
	SeqAPI      SeqAPI       `yaml:"seq_api"`
	MassExport  *MassExport  `yaml:"mass_export,omitempty"`
	AsyncSearch *AsyncSearch `yaml:"async_search,omitempty"`
	ErrorGroups *ErrorGroups `yaml:"error_groups,omitempty"`
	Admin       *Admin       `yaml:"admin,omitempty"`
}

type Inmemory

type Inmemory struct {
	NumCounters int64 `yaml:"num_counters,omitempty"`
	MaxCost     int64 `yaml:"max_cost,omitempty"`
	BufferItems int64 `yaml:"buffer_items,omitempty"`
}

type JWT

type JWT struct {
	SecretKey string `yaml:"secret_key"`
}

type KeepaliveParams

type KeepaliveParams struct {
	// After a duration of this time if the client doesn't see any activity it
	// pings the server to see if the transport is still alive.
	// If set below 10s, a minimum value of 10s will be used instead.
	Time time.Duration `yaml:"time,omitempty"`
	// After having pinged for keepalive check, the client waits for a duration
	// of Timeout and if no activity is seen even after that the connection is
	// closed. If set below 1s, a minimum value of 1s will be used instead.
	Timeout time.Duration `yaml:"timeout,omitempty"`
	// If true, client sends keepalive pings even with no active RPCs. If false,
	// when there are no active RPCs, Time and Timeout will be ignored and no
	// keepalive pings will be sent. False by default.
	PermitWithoutStream bool `yaml:"permit_without_stream,omitempty"`
}

type LogTagsMapping

type LogTagsMapping struct {
	Release []string `yaml:"release,omitempty"`
	Service []string `yaml:"service,omitempty"`
	Env     []string `yaml:"env,omitempty"`
}

type Mask

type Mask struct {
	Re          string `yaml:"re"`
	Groups      []int  `yaml:"groups,omitempty"`
	Mode        string `yaml:"mode"`                   // "mask" or "replace" or "cut"
	ReplaceWord string `yaml:"replace_word,omitempty"` // for mode:replace

	ProcessFields []string `yaml:"process_fields,omitempty"`
	IgnoreFields  []string `yaml:"ignore_fields,omitempty"`

	FieldFilters *FieldFilterSet `yaml:"field_filters,omitempty"`
}

type Masking

type Masking struct {
	Masks         []Mask   `yaml:"masks"`
	ProcessFields []string `yaml:"process_fields,omitempty"`
	IgnoreFields  []string `yaml:"ignore_fields,omitempty"`
}

type MassExport

type MassExport struct {
	Options    MassExportOptions             `yaml:"options"`
	Envs       map[string]*MassExportOptions `yaml:"envs,omitempty"`
	DefaultEnv string                        `yaml:"default_env,omitempty"`
}

type MassExportOptions

type MassExportOptions struct {
	SeqDBID          string         `yaml:"seq_db_id,omitempty"`
	WorkersCount     int            `yaml:"workers_count"`
	TasksChannelSize int            `yaml:"tasks_channel_size,omitempty"`
	PartLength       time.Duration  `yaml:"part_length,omitempty"`
	URLPrefix        string         `yaml:"url_prefix"`
	AllowedUsers     []string       `yaml:"allowed_users,omitempty"`
	FileStore        FileStore      `yaml:"file_store"`
	SessionStore     SessionStore   `yaml:"session_store"`
	DownloadParams   DownloadParams `yaml:"download_params,omitempty"`
}

type OIDC

type OIDC struct {
	CacheID        string   `yaml:"cache_id,omitempty"`
	CacheSecretKey string   `yaml:"cache_secret_key,omitempty"`
	SkipVerify     bool     `yaml:"skip_verify,omitempty"`
	AuthURLs       []string `yaml:"auth_urls"`
	AllowedClients []string `yaml:"allowed_clients,omitempty"`
	TLS            *TLS     `yaml:"tls,omitempty"`
}

type RateLimiter

type RateLimiter struct {
	RatePerSec   int  `yaml:"rate_per_sec"`
	MaxBurst     int  `yaml:"max_burst,omitempty"`
	StoreMaxKeys int  `yaml:"store_max_keys,omitempty"`
	PerHandler   bool `yaml:"per_handler,omitempty"`
}

type RateLimiters

type RateLimiters struct {
	Default      RateLimiter            `yaml:"default"`
	SpecialUsers map[string]RateLimiter `yaml:"spec_users,omitempty"`
}

type RateLimiting

type RateLimiting struct {
	// rl options are optional, without them requests not covered by envs are not limited.
	Options ApiToRateLimiters            `yaml:"options,omitempty"`
	Envs    map[string]ApiToRateLimiters `yaml:"envs,omitempty"`
}

type Redis

type Redis struct {
	WithInmemID     string        `yaml:"with_inmem_id,omitempty"`
	KeyPrefix       string        `yaml:"key_prefix,omitempty"`
	Addr            string        `yaml:"addr"`
	Username        string        `yaml:"username,omitempty"`
	Password        string        `yaml:"password,omitempty"`
	MaxRetries      int           `yaml:"max_retries,omitempty"`
	Timeout         time.Duration `yaml:"timeout,omitempty"`
	MinRetryBackoff time.Duration `yaml:"min_retry_backoff,omitempty"`
	MaxRetryBackoff time.Duration `yaml:"max_retry_backoff,omitempty"`
}

type S3

type S3 struct {
	Endpoint        string `yaml:"endpoint"`
	AccessKeyID     string `yaml:"access_key_id"`
	SecretAccessKey string `yaml:"secret_access_key"`
	BucketName      string `yaml:"bucket_name"`
	EnableSSL       bool   `yaml:"enable_ssl,omitempty"`
}

type SeqAPI

type SeqAPI struct {
	Options    SeqAPIOptions             `yaml:"options"`
	Envs       map[string]*SeqAPIOptions `yaml:"envs,omitempty"`
	DefaultEnv string                    `yaml:"default_env,omitempty"`
}

type SeqAPICaches

type SeqAPICaches struct {
	Events       *HandlerCache `yaml:"events,omitempty"`
	LogsLifespan *HandlerCache `yaml:"logs_lifespan,omitempty"`
	Fields       *HandlerCache `yaml:"fields,omitempty"`
}

type SeqAPILimits

type SeqAPILimits struct {
	MaxSearchLimit             int32 `yaml:"max_search_limit,omitempty"`
	MaxSearchTotal             int64 `yaml:"max_search_total,omitempty"`
	MaxSearchOffset            int32 `yaml:"max_search_offset,omitempty"`
	MaxExportLimit             int32 `yaml:"max_export_limit,omitempty"`
	SeqCLIMaxSearchLimit       int   `yaml:"seq_cli_max_search_limit,omitempty"`
	MaxParallelExportRequests  int   `yaml:"max_parallel_export_requests,omitempty"`
	MaxAggregationsPerRequest  int   `yaml:"max_aggregations_per_request,omitempty"`
	MaxBucketsPerAggregationTs int   `yaml:"max_buckets_per_aggregation_ts,omitempty"`
}

type SeqAPIOptions

type SeqAPIOptions struct {
	SeqDBID      string       `yaml:"seq_db_id,omitempty"`
	Limits       SeqAPILimits `yaml:"limits,omitempty"`
	Caches       SeqAPICaches `yaml:"caches,omitempty"`
	Masking      *Masking     `yaml:"masking,omitempty"`
	PinnedFields []Field      `yaml:"pinned_fields,omitempty"`
	SystemFields []Field      `yaml:"system_fields,omitempty"`
}

type SeqDBClient

type SeqDBClient struct {
	Timeout               time.Duration `yaml:"timeout"`
	AvgDocSize            int           `yaml:"avg_doc_size,omitempty"`
	Addrs                 []string      `yaml:"addrs"`
	RequestRetries        int           `yaml:"request_retries,omitempty"`
	RequestRetriesBackoff *Backoff      `yaml:"request_retries_backoff,omitempty"`
	ClientMode            string        `yaml:"client_mode,omitempty"`
	GRPCParams            *GRPCParams   `yaml:"grpc_params,omitempty"`
}

type Server

type Server struct {
	HTTP         *HTTP         `yaml:"http,omitempty"`
	GRPC         *GRPC         `yaml:"grpc,omitempty"`
	Debug        Debug         `yaml:"debug"`
	Auth         *Auth         `yaml:"auth,omitempty"`
	RateLimiting *RateLimiting `yaml:"rate_limiting,omitempty"`
}

type SessionStore

type SessionStore struct {
	RedisCacheID string        `yaml:"redis_cache_id"`
	Lifetime     time.Duration `yaml:"lifetime,omitempty"`
}

type TLS

type TLS struct {
	CACert     string `yaml:"ca_cert,omitempty"`
	ClientCert string `yaml:"client_cert,omitempty"`
	ClientKey  string `yaml:"client_key,omitempty"`
	Insecure   bool   `yaml:"insecure,omitempty"`
}

Jump to

Keyboard shortcuts

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