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
Click to show internal directories.
Click to hide internal directories.