config

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPoolName = "default"
)

Variables

View Source
var SpannerEmulator = &SpannerConfig{
	Project:   "test-project",
	Instance:  "test-instance",
	Database:  "test-db",
	TableName: "lmstfy_jobs",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Host             string
	Port             int
	AdminHost        string
	AdminPort        int
	LogLevel         string
	LogDir           string
	LogFormat        string
	Accounts         map[string]string
	EnableAccessLog  bool
	AdminRedis       RedisConf
	Pool             RedisPool
	SecondaryStorage *SecondaryStorage

	// Default publish params
	TTLSecond   int
	DelaySecond int
	TriesNum    int
	// Default consume params
	TTRSecond     int
	TimeoutSecond int
}

func MustLoad

func MustLoad(path string) (*Config, error)

MustLoad load config file with specified path, an error returned if any condition not met

func (*Config) HasSecondaryStorage added in v1.0.12

func (c *Config) HasSecondaryStorage() bool

type PresetConfigForTest added in v1.0.12

type PresetConfigForTest struct {
	*Config
	// contains filtered or unexported fields
}

func CreatePresetForTest added in v1.0.12

func CreatePresetForTest(version string, pools ...string) (*PresetConfigForTest, error)

func (*PresetConfigForTest) Destroy added in v1.0.12

func (presetConfig *PresetConfigForTest) Destroy()

type RedisConf

type RedisConf struct {
	Addr       string
	Password   string
	DB         int
	PoolSize   int
	MigrateTo  string // If this is not empty, all the PUBLISH will go to that pool
	MasterName string
	Version    string

	EnableSecondaryStorage bool

	// number of seconds. when job's delay second is greater than pumpStorageThresh,
	//it will be written to storage if enabled
	SecondaryStorageThresholdSeconds int64
}

func (*RedisConf) IsSentinel

func (rc *RedisConf) IsSentinel() bool

IsSentinel return whether the pool was running in sentinel mode

type RedisPool

type RedisPool map[string]RedisConf

type SecondaryStorage added in v1.0.12

type SecondaryStorage struct {
	Spanner *SpannerConfig
	// max number of jobs that storage pumps per batch
	MaxJobPumpBatchSize int64
}

type SpannerConfig added in v1.0.12

type SpannerConfig struct {
	Project         string
	Instance        string
	Database        string
	CredentialsFile string
	TableName       string
}

Jump to

Keyboard shortcuts

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