config

package
v0.0.0-...-e9a242d Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultOpenInterval = 100
View Source
const DefaultPort = 9199
View Source
const DefaultPreallocSlicePercentage = 2
View Source
const DefaultServiceNameOnO11y = "jiboia"

Variables

This section is empty.

Functions

func ToBytes

func ToBytes(sizeRep string) (int64, error)

Types

type APIConfig

type APIConfig struct {
	Port             int    `yaml:"port"`
	PayloadSizeLimit string `yaml:"payload_size_limit"`
}

func (APIConfig) PayloadSizeLimitInBytes

func (apiConf APIConfig) PayloadSizeLimitInBytes() (int64, error)

type AccumulatorConfig

type AccumulatorConfig struct {
	Size           string               `yaml:"size"`
	Separator      string               `yaml:"separator"`
	QueueCapacity  int                  `yaml:"queue_capacity"` //TODO: validate and test
	CircuitBreaker CircuitBreakerConfig `yaml:"circuit_breaker"`
}

func (AccumulatorConfig) SizeAsBytes

func (accConf AccumulatorConfig) SizeAsBytes() (int64, error)

type CircuitBreakerConfig

type CircuitBreakerConfig struct {
	Disable      bool  `yaml:"disable"`
	OpenInterval int64 `yaml:"open_interval_in_ms"`
}

func (CircuitBreakerConfig) OpenIntervalAsDuration

func (cbConf CircuitBreakerConfig) OpenIntervalAsDuration() time.Duration

type CompressionConfig

type CompressionConfig struct {
	Level                   string `yaml:"level"`
	Type                    string `yaml:"type"`
	PreallocSlicePercentage int    `yaml:"prealloc_slice_percentage"`
}

type Config

type Config struct {
	O11y            O11yConfig   `yaml:"o11y"`
	Version         string       `yaml:"version"` //FIXME: fill the version
	API             APIConfig    `yaml:"api"`
	Flows           []FlowConfig `yaml:"flows"`
	DisableMaxProcs bool         `yaml:"disable_max_procs"`
}

func New

func New(confData []byte) (*Config, error)

type DescompressionConfig

type DescompressionConfig struct {
	ActiveDecompressions []string `yaml:"active"`
	MaxConcurrency       int      `yaml:"max_concurrency"`
	InitialBufferSize    string   `yaml:"initial_buffer_size"`
}

func (DescompressionConfig) InitialBufferSizeAsBytes

func (decompConf DescompressionConfig) InitialBufferSizeAsBytes() (int64, error)

type ExternalQueueConfig

type ExternalQueueConfig struct {
	Type   string      `yaml:"type"`
	Config interface{} `yaml:"config"`
}

type FlowConfig

type FlowConfig struct {
	Name                 string              `yaml:"name"`
	QueueMaxSize         int                 `yaml:"in_memory_queue_max_size"`
	MaxConcurrentUploads int                 `yaml:"max_concurrent_uploads"`
	PathPrefixCount      int                 `yaml:"path_prefix_count"`
	Ingestion            IngestionConfig     `yaml:"ingestion"`
	Accumulator          AccumulatorConfig   `yaml:"accumulator"`
	ExternalQueue        ExternalQueueConfig `yaml:"external_queue"`
	ObjectStorage        ObjectStorageConfig `yaml:"object_storage"`
	Compression          CompressionConfig   `yaml:"compression"`
}

type IngestionConfig

type IngestionConfig struct {
	Token          string               `yaml:"token"`
	Decompression  DescompressionConfig `yaml:"decompress"`
	CircuitBreaker CircuitBreakerConfig `yaml:"circuit_breaker"`
}

type LogConfig

type LogConfig struct {
	Level  string `yaml:"level"`
	Format string `yaml:"format"`
}

type O11yConfig

type O11yConfig struct {
	Tracing TracingConfig `yaml:"tracing"`
	Log     LogConfig     `yaml:"log"`
}

type ObjectStorageConfig

type ObjectStorageConfig struct {
	Type   string      `yaml:"type"`
	Config interface{} `yaml:"config"`
}

type TracingConfig

type TracingConfig struct {
	Enabled     bool   `yaml:"enabled"`
	ServiceName string `yaml:"service_name"`
}

Jump to

Keyboard shortcuts

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