store

package
v0.2.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package store defines the storage interface for nightwatch.

Index

Constants

This section is empty.

Variables

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

ProviderSet contains providers for creating instances of the datastore struct using Google Wire.

View Source
var (

	// S is a global variable that holds the initialized instance of datastore for convenient access by other packages.
	S *datastore
)

Functions

func NewStore

func NewStore(db *gorm.DB) *datastore

NewStore creates a new instance of the datastore struct, implementing the IStore interface.

Types

type CronJobExpansion

type CronJobExpansion interface{}

CronJobExpansion defines additional methods for cronjob operations.

type CronJobStore

type CronJobStore interface {
	// Create inserts a new cron job into the database.
	Create(ctx context.Context, cronJob *model.CronJobM) error

	// Update modifies an existing cron job in the database.
	Update(ctx context.Context, cronJob *model.CronJobM) error

	// Delete removes cron jobs with the specified options.
	Delete(ctx context.Context, opts *where.WhereOptions) error

	// Get retrieves a cron job with the specified options.
	Get(ctx context.Context, opts *where.WhereOptions) (*model.CronJobM, error)

	// List returns a list of cron jobs with the specified options.
	List(ctx context.Context, opts *where.WhereOptions) (int64, []*model.CronJobM, error)

	CronJobExpansion
}

CronJobStore defines the interface for managing cron jobs in the database.

type IStore

type IStore interface {
	DB(ctx context.Context) *gorm.DB
	TX(ctx context.Context, fn func(ctx context.Context) error) error
	CronJobs() CronJobStore
	Jobs() JobStore
}

IStore defines the interface for the store layer, specifying the methods that need to be implemented.

type JobExpansion

type JobExpansion interface{}

JobExpansion defines additional methods for job operations.

type JobStore

type JobStore interface {
	// Create inserts a new job into the database.
	Create(ctx context.Context, job *model.JobM) error

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

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

	// Get retrieves a job with the specified options..
	Get(ctx context.Context, opts *where.WhereOptions) (*model.JobM, error)

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

	JobExpansion
}

JobStore defines the interface for managing jobs in the database.

Jump to

Keyboard shortcuts

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