storage

package
v5.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSQLStorageRequiresPath          = errors.New("sql storage requires a non-empty path to be defined")
	ErrMemoryStorageDoesNotSupportPath = errors.New("memory storage does not support persistence, use sqlite if you want persistence on file")
)

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
	Path string `yaml:"path"`

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

	// Caching is whether to enable caching.
	// This is used to drastically decrease read latency by pre-emptively caching writes
	// as they happen, also known as the write-through caching strategy.
	// Does not apply if Config.Type is not TypePostgres or TypeSQLite.
	Caching bool `yaml:"caching,omitempty"`
}

Config is the configuration for storage

func (*Config) ValidateAndSetDefaults

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