storage

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMigration

func AddMigration(obj interface{})

func MigrateDatabase

func MigrateDatabase(conn *Connection) error

func TruncateAll

func TruncateAll(conn *Connection) error

Types

type Connection

type Connection struct {
	*gorm.DB
	// contains filtered or unexported fields
}

Connection is the interface a storage provider must implement.

func Dial

func Dial(config *conf.GlobalConfiguration) (*Connection, error)

Dial will connect to that storage engine

func (*Connection) GetGlobalConfig

func (c *Connection) GetGlobalConfig(ctx context.Context) *conf.GlobalConfiguration

func (*Connection) GetInstanceID

func (c *Connection) GetInstanceID(ctx context.Context) uuid.UUID

GetInstanceID reads the instance id from the context.

func (*Connection) Transaction

func (c *Connection) Transaction(fn func(*Connection) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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