store

package
v0.0.0-...-b322d5c Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewStore, wire.Bind(new(IStore), new(*datastore)))

ProviderSet is a Wire provider set that initializes new datastore instances and binds the IStore interface to the actual datastore type.

View Source
var (
	S *datastore
)

Singleton instance variables.

Functions

func NewStore

func NewStore(db *gorm.DB) *datastore

NewStore initializes a new datastore instance using the provided DB gorm instance. It also creates a singleton instance for the datastore.

Types

type IStore

type IStore interface {
	DB(ctx context.Context) *gorm.DB
	TX(context.Context, func(ctx context.Context) error) error
}

IStore is an interface that represents methods required to be implemented by a Store implementation.

Jump to

Keyboard shortcuts

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