cfg

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cleanup = flag.Bool("cleanup", false, "Only cleanup marmot triggers and changelogs")
View Source
var Config = &Configuration{
	SeqMapPath: "/tmp/seq-map.cbor",
	DBPath:     "/tmp/marmot.db",
	NodeID:     1,

	Snapshot: SnapshotConfiguration{
		Enable:   true,
		Replicas: 1,
	},

	ReplicationLog: ReplicationLogConfiguration{
		Shards:     8,
		MaxEntries: 1024,
		Replicas:   1,
		Compress:   true,
	},

	NATS: NATSConfiguration{
		URLs:          []string{nats.DefaultURL},
		SubjectPrefix: "marmot-change-log",
		StreamPrefix:  "marmot-changes",
	},

	Logging: LoggingConfiguration{
		Verbose: false,
		Format:  "console",
	},
}
View Source
var ConfigPath = flag.String("config", "marmot.toml", "Path to configuration file")
View Source
var SaveSnapshot = flag.Bool("save-snapshot", false, "Only take snapshot and upload")

Functions

func Load added in v0.7.0

func Load(path string) error

Types

type Configuration added in v0.7.0

type Configuration struct {
	SeqMapPath string `toml:"seq_map_path"`
	DBPath     string `toml:"db_path"`
	NodeID     uint64 `toml:"node_id"`

	Snapshot       SnapshotConfiguration       `toml:"snapshot"`
	ReplicationLog ReplicationLogConfiguration `toml:"replication_log"`
	NATS           NATSConfiguration           `toml:"nats"`
	Logging        LoggingConfiguration        `toml:"logging"`
}

type LoggingConfiguration added in v0.7.0

type LoggingConfiguration struct {
	Verbose bool   `toml:"verbose"`
	Format  string `toml:"format"`
}

type NATSConfiguration added in v0.7.0

type NATSConfiguration struct {
	URLs          []string `toml:"urls"`
	SubjectPrefix string   `toml:"subject_prefix"`
	StreamPrefix  string   `toml:"stream_prefix"`
}

type ReplicationLogConfiguration added in v0.7.0

type ReplicationLogConfiguration struct {
	Shards     uint64 `toml:"shards"`
	MaxEntries int64  `toml:"max_entries"`
	Replicas   int    `toml:"replicas"`
	Compress   bool   `toml:"compress"`
}

type SnapshotConfiguration added in v0.7.0

type SnapshotConfiguration struct {
	Enable   bool `toml:"enabled"`
	Replicas int  `toml:"replicas"`
}

Jump to

Keyboard shortcuts

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