storage

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 3 Imported by: 9

Documentation

Overview

Package storage contains common definitions to be used across service storage interfaces

Index

Constants

This section is empty.

Variables

View Source
var (
	SQLDriver      = definitions.GetEnvWithDefault("SQL_DRIVER", "sqlite3")
	DatabaseSource = definitions.GetEnvWithDefault("DATABASE_SOURCE", ":memory:")
)

Functions

func IsTKLessThan

func IsTKLessThan(a TypeAndKey, b TypeAndKey) bool

Types

type IDGenerator

type IDGenerator interface {
	// New returns a new unique ID
	New() string
}

IDGenerator is an interface which wraps the creation of unique IDs

type IsolationLevel

type IsolationLevel int
const (
	LevelDefault IsolationLevel = iota
	LevelReadUncommitted
	LevelReadCommitted
	LevelWriteCommitted
	LevelRepeatableRead
	LevelSnapshot
	LevelSerializable
	LevelLinearizable
)

type TxOptions

type TxOptions struct {
	Isolation IsolationLevel
	ReadOnly  bool
}

TxOptions specifies options for transactions

type TypeAndKey

type TypeAndKey struct {
	Type string
	Key  string
}

func (TypeAndKey) String

func (tk TypeAndKey) String() string

type UUIDGenerator

type UUIDGenerator struct{}

UUIDGenerator is an implementation of IDGenerator which uses uuidv4

func (*UUIDGenerator) New

func (*UUIDGenerator) New() string

Jump to

Keyboard shortcuts

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