config

package
v0.0.0-...-8f072b4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_FILE_LINUX = "/etc/ghostdb/ghostdbConf.json"

	DEFAULT_KEYSPACE_SIZE       = 65536
	DEFAULT_SYS_METRIC_INTERVAL = 300  // 5 minutes
	DEFAULT_APP_METRIC_INTERVAL = 300  // 5 minutes
	DEFAULT_TTL                 = -1   // Never Expire
	DEFAULT_CRAWLER_INTERVAL    = 300  // 5 minutes
	DEFAULT_SNAPSHOT_INTERVAL   = 3600 // 1 hour
	DEFAULT_SNAPSHOT_ENABLED    = true
	DEFAULT_AOF_PERSISTENCE     = false
	DEFAULT_AOF_MAX_BYTES       = 50000000 // 50MB
	DEFAULT_ENTRY_TIMESTAMP     = true     // Enable timestamps in appMetrics logs
	DEFAULT_ENABLE_ENCRYPTION   = true
	DEFAULT_PASSPHRASE          = "SUPPLY_ME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// KeyspaceSize represents the maximum number
	// of key-value pairs allowed in the cache
	KeyspaceSize int32

	// SysMetricInterval represents the interval
	// in seconds of when the sys metrics logging subsystem
	// should output to the log file.
	SysMetricInterval int32

	// AppMetricInterval represents the interval
	// in seconds of when the app metrics logging subsystem
	// should output to the log file.
	AppMetricInterval int32

	// DefaultTTL represents the default time-to-live
	// for key-value pairs in the cache. If set to -1
	// the key-value pair will never expire
	DefaultTTL int32

	// CrawlerInterval is the time, in seconds, of how
	// often the crawlers should crawl the cache to remove
	// stale key-value pairs.
	CrawlerInterval int32

	// SnapshotInterval is the time, in seconds, of how
	// often the snapshot scheduler should create a
	// point-in-time snapshot of the cache.
	SnapshotInterval int32

	// Snapshot enabled is a bool which enables snapshotting.
	// It takes precedence over AOF persistence.
	SnapshotEnabled bool

	// PersistenceAOF is a bool which enables AOF persistence.
	// Snapshots take precedence if both are enabled.
	PersistenceAOF bool

	// AOFMaxBytes represents the maximum number of bytes to be
	// written to the append-only-file log before an AOF log
	// rotation takes place.
	AofMaxBytes int64

	// EntryTimestamp is a boolean which enables timestamping for
	// entries in the appMetrics logging subsystem.
	EntryTimestamp bool

	// EnableEncryption is a bool that enables encryption of
	// snapshots using 128-bit AES.
	EnableEncryption bool

	// Passphrase is the passphrase to be used for snapshot encryption
	// should it be enabled.
	Passphrase string
}

func InitializeConfiguration

func InitializeConfiguration() Configuration

InitializeConfiguration initializes the cache configuration object

func InitializeFromConfig

func InitializeFromConfig() (Configuration, error)

InitializeFromConfig initializes a configuration object from a configuration file.

func (*Configuration) SetDefaultParams

func (conf *Configuration) SetDefaultParams()

SetDefaultParams will set default parameters for the cache configuration object if the initializer was unable to initialize from a config file.

Jump to

Keyboard shortcuts

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