storage

package
v3.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSQLStorageRequiresFile          = errors.New("sql storage requires a non-empty file to be defined")
	ErrMemoryStorageDoesNotSupportFile = errors.New("memory storage does not support persistence, use sqlite if you want persistence on file")
	ErrCannotSetBothFileAndPath        = errors.New("file has been deprecated in favor of path: you cannot set both of them")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path is the path used by the store to achieve persistence
	// If blank, persistence is disabled.
	// Note that not all Type support persistence
	//
	// XXX: Rename to path for v4.0.0
	Path string `yaml:"path"`

	// File is the path of the file to use for persistence
	// If blank, persistence is disabled
	//
	// Deprecated
	File string `yaml:"file"`

	// Type of store
	// If blank, uses the default in-memory store
	Type Type `yaml:"type"`
}

Config is the configuration for storage

func (*Config) ValidateAndSetDefaults added in v3.3.2

func (c *Config) ValidateAndSetDefaults() error

ValidateAndSetDefaults validates the configuration and sets the default values (if applicable)

type Type

type Type string

Type of the store.

const (
	TypeMemory   Type = "memory"   // In-memory store
	TypeSQLite   Type = "sqlite"   // SQLite store
	TypePostgres Type = "postgres" // Postgres store
)

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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