Documentation
¶
Overview ¶
Package config holds server settings. Values come from defaults, then an optional config file ("key value" per line, like redis.conf), then command-line flags (--key value). CONFIG SET can change most values at runtime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseBytes ¶
ParseBytes accepts plain numbers or units: 100mb, 1gb, 512kb.
Types ¶
type Config ¶
type Config struct {
Bind string
Port int
HTTPPort int // REST + WebSocket + dashboard; 0 disables
Shards int // keyspace shards (power of two)
RequirePass string
MaxClients int
Timeout int // idle client timeout in seconds; 0 = never
MaxMemory int64 // bytes; 0 = unlimited
MaxMemoryPolicy string // noeviction, {allkeys,volatile}-{lru,lfu,tinylfu,random}, volatile-ttl
MaxMemorySamples int
HZ int // background task frequency (active expiry etc.)
Dir string
DBFilename string
Save []SaveRule
AppendOnly bool
AppendFilename string
AppendFsync string // always, everysec, no
AutoAOFRewritePercentage int
AutoAOFRewriteMinSize int64
CompressionThreshold int // compress string values >= this many bytes; 0 = off
HistoryDepth int // versions kept per string key; 0 = off
ReplicaOf string // "host port" or "" for leader
MasterAuth string // password used to authenticate to the leader
MasterUser string // ACL user for MasterAuth ("" = default)
// ReplBacklogSize is how many bytes of recent writes a leader keeps so a
// reconnecting replica can catch up without a full resync.
ReplBacklogSize int64
ClusterEnabled bool
ClusterNodeID string
ClusterNodes []string // "id host:port slotStart-slotEnd"
RaftPort int
RaftPeers []string // "id raftHost:raftPort dataHost:dataPort"
SlowlogLogSlowerThan int64 // microseconds; <0 disables
SlowlogMaxLen int
ScriptTimeoutMs int
LogLevel string
}