config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server            Server     `yaml:"server"`
	JobQueue          JobQueue   `yaml:"job_queue"`
	WorkerPool        WorkerPool `yaml:"worker_pool"`
	Scheduler         Scheduler  `yaml:"scheduler"`
	Consumer          Consumer   `yaml:"consumer"`
	Repository        Repository `yaml:"repository"`
	TimeoutUnitOption string     `yaml:"timeout_unit"`
	LoggingFormat     string     `yaml:"logging_format"`
	TimeoutUnit       time.Duration
}

func (*Config) Load

func (cfg *Config) Load(filepath string) error

type ConsumeParams

type ConsumeParams struct {
	Name      string `yaml:"name"`
	AutoACK   bool   `yaml:"auto_ack"`
	Exclusive bool   `yaml:"exclusive"`
	NoLocal   bool   `yaml:"no_local"`
	NoWait    bool   `yaml:"no_wait"`
}

type Consumer

type Consumer struct {
	JobQueuePollingInterval int `yaml:"job_queue_polling_interval"`
}

type GRPC

type GRPC struct {
	Port string `yaml:"port"`
}

type HTTP

type HTTP struct {
	Port string `yaml:"port"`
}

type JobQueue

type JobQueue struct {
	Option         string         `yaml:"option"`
	MemoryJobQueue MemoryJobQueue `yaml:"memory_job_queue"`
	RabbitMQ       RabbitMQ       `yaml:"rabbitmq"`
}

type MemoryJobQueue

type MemoryJobQueue struct {
	Capacity int `yaml:"capacity"`
}

type MySQL

type MySQL struct {
	DSN                   string
	CaPemFile             string
	ConnectionMaxLifetime int `yaml:"connection_max_lifetime"`
	MaxIdleConnections    int `yaml:"max_idle_connections"`
	MaxOpenConnections    int `yaml:"max_open_connections"`
}

type Postgres

type Postgres struct {
	DSN                   string
	ConnectionMaxLifetime int `yaml:"connection_max_lifetime"`
	MaxIdleConnections    int `yaml:"max_idle_connections"`
	MaxOpenConnections    int `yaml:"max_open_connections"`
}

type PublishParams

type PublishParams struct {
	Exchange   string `yaml:"exchange"`
	RoutingKey string `yaml:"routing_key"`
	Mandatory  bool   `yaml:"mandatory"`
	Immediate  bool   `yaml:"immediate"`
}

type QueueParams

type QueueParams struct {
	Name              string `yaml:"name"`
	Durable           bool   `yaml:"durable"`
	DeletedWhenUnused bool   `yaml:"deleted_when_unused"`
	Exclusive         bool   `yaml:"exclusive"`
	NoWait            bool   `yaml:"no_wait"`
}

type RabbitMQ

type RabbitMQ struct {
	QueueParams   QueueParams   `yaml:"queue_params"`
	ConsumeParams ConsumeParams `yaml:"consume_params"`
	PublishParams PublishParams `yaml:"publish_params"`
}

type Redis

type Redis struct {
	URL          string
	KeyPrefix    string `yaml:"key_prefix"`
	PoolSize     int    `yaml:"pool_size"`
	MinIdleConns int    `yaml:"min_idle_conns"`
}

type Repository

type Repository struct {
	Option   string   `yaml:"option"`
	MySQL    MySQL    `yaml:"mysql"`
	Postgres Postgres `yaml:"postgres"`
	Redis    Redis    `yaml:"redis"`
}

type Scheduler

type Scheduler struct {
	RepositoryPollingInterval int `yaml:"repository_polling_interval"`
}

type Server

type Server struct {
	Protocol string `yaml:"protocol"`
	HTTP     HTTP   `yaml:"http"`
	GRPC     GRPC   `yaml:"grpc"`
}

type WorkerPool

type WorkerPool struct {
	Concurrency int `yaml:"concurrency"`
	Backlog     int `yaml:"backlog"`
}

Jump to

Keyboard shortcuts

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