local

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package local implements a scheduler that persists jobs on a local storage. The implementation currently uses BoltDB (https://github.com/etcd-io/bbolt).

Index

Constants

View Source
const Name = "local"

Name contains the adapter registered name

Variables

View Source
var (
	// ErrMarshalling occurs when a storage message cannot be marshalled
	ErrMarshalling = errors.New("schedule marshalling error")
	// ErrUnmarshalling occurs when a storage message cannot be unmarshalled
	ErrUnmarshalling = errors.New("schedule unmarshalling error")
)

Functions

func New

func New(tree config.Tree) (schedule.Scheduler, error)

New creates a scheduler that persists data locally. This scheduler cannot be used on a distributed setup. Use net/schedule when running multiple spine instances.

Types

type Config

type Config struct {
	// DB is the path to the database file
	DB string `toml:"db"`
	// Workers is the maximum number of goroutines that process jobs in parallel
	Workers int `toml:"workers"`
	// Encryption activates data encryption.
	// It is worth noting that once a database created, it is no longer possible
	// to change this option.
	Encryption *EncryptionConfig `toml:"encryption"`
}

Config is the local scheduler configuration

type EncryptionConfig

type EncryptionConfig struct {
	// Default is the key to use to encrypt new data
	Default uint32 `toml:"default"`
	// Keys contains all encryption keys available
	Keys []string `toml:"keys"`
}

EncryptionConfig is the configuration to encrypt data stored. The database encryption supports key rotation, so new keys can be added without affecting existing data. Old keys should be kept (almost) forever.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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