gorm

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStorage

func NewStorage(opts ...StorageOption) (s persistence.Storage, err error)

NewStorage creates a new storage using GORM (which DB to use depends on the StorageOption)

Types

type StorageOption

type StorageOption func(*storage)

StorageOption is a functional option type to configure the GORM storage. E.g. WithInMemory or WithPostgres

func WithInMemory

func WithInMemory() StorageOption

WithInMemory is an option to configure Storage to use an in memory DB

func WithPostgres

func WithPostgres(host string, port int16) StorageOption

WithPostgres is an option to configure Storage to use a Postgres DB

Jump to

Keyboard shortcuts

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