store

package
v0.2.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 8 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 set that initializes the Store and binds it to the IStore interface.

View Source
var (
	S *datastore
)

Functions

func NewStore

func NewStore(db *gorm.DB) *datastore

NewStore initializes a new datastore by using the given gorm.DB and returns it.

Types

type ChainExpansion

type ChainExpansion interface{}

ChainExpansion defines additional methods for chain operations.

type ChainStore

type ChainStore interface {
	// Create inserts a new chain into the database.
	Create(ctx context.Context, chain *model.ChainM) error

	// Update modifies an existing chain in the database.
	Update(ctx context.Context, chain *model.ChainM) error

	// Delete removes chains with the specified options.
	Delete(ctx context.Context, opts *where.Options) error

	// Get retrieves a chain with the specified options.
	Get(ctx context.Context, opts *where.Options) (*model.ChainM, error)

	// List returns a list of chains with the specified options.
	List(ctx context.Context, opts *where.Options) (int64, []*model.ChainM, error)

	ChainExpansion
}

ChainStore defines the interface for managing chains in the database.

type IStore

type IStore interface {
	DB(ctx context.Context) *gorm.DB
	TX(context.Context, func(ctx context.Context) error) error
	Chains() ChainStore
	Miners() MinerStore
	MinerSets() MinerSetStore
}

IStore is an interface defining the required methods for a Store.

type MinerExpansion

type MinerExpansion interface{}

MinerExpansion defines additional methods for miner operations.

type MinerSetExpansion

type MinerSetExpansion interface{}

MinerSetExpansion defines additional methods for minerSet operations.

type MinerSetStore

type MinerSetStore interface {
	// Create inserts a new minerSet into the database.
	Create(ctx context.Context, minerSet *model.MinerSetM) error

	// Update modifies an existing minerSet in the database.
	Update(ctx context.Context, minerSet *model.MinerSetM) error

	// Delete removes minerSets with the specified options.
	Delete(ctx context.Context, opts *where.Options) error

	// Get retrieves a minerSet with the specified options.
	Get(ctx context.Context, opts *where.Options) (*model.MinerSetM, error)

	// List returns a list of minerSets with the specified options.
	List(ctx context.Context, opts *where.Options) (int64, []*model.MinerSetM, error)

	MinerSetExpansion
}

MinerSetStore defines the interface for managing minerSets in the database.

type MinerStore

type MinerStore interface {
	// Create inserts a new miner into the database.
	Create(ctx context.Context, miner *model.MinerM) error

	// Update modifies an existing miner in the database.
	Update(ctx context.Context, miner *model.MinerM) error

	// Delete removes miners with the specified options.
	Delete(ctx context.Context, opts *where.Options) error

	// Get retrieves a miner with the specified options.
	Get(ctx context.Context, opts *where.Options) (*model.MinerM, error)

	// List returns a list of miners with the specified options.
	List(ctx context.Context, opts *where.Options) (int64, []*model.MinerM, error)

	MinerExpansion
}

MinerStore defines the interface for managing miners in the database.

Jump to

Keyboard shortcuts

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