repository

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppRepository

type AppRepository struct {
	Db *sqlx.DB
}

func (*AppRepository) Close added in v0.0.2

func (a *AppRepository) Close() error

Close implements AppRepositoryInterface.

func (*AppRepository) FindAllByDA

func (*AppRepository) FindOneByContract

func (a *AppRepository) FindOneByContract(
	ctx context.Context,
	address common.Address,
) (*model.Application, error)

FindOneByContract returns a single application by contract address

func (*AppRepository) FindOneByID added in v0.0.2

func (a *AppRepository) FindOneByID(
	ctx context.Context,
	id int64,
) (*model.Application, error)

FindOneByID returns a single application by ID

func (*AppRepository) List

func (a *AppRepository) List(
	ctx context.Context,
) ([]model.Application, error)

func (*AppRepository) UpdateDA

func (a *AppRepository) UpdateDA(
	ctx context.Context,
	applicationId int64,
	da model.DataAvailabilitySelector,
) error

Update field DA

type AppRepositoryInterface

type AppRepositoryInterface interface {
	FindOneByContract(ctx context.Context, address common.Address) (*model.Application, error)
	FindOneByID(ctx context.Context, id int64) (*model.Application, error)
	FindAllByDA(ctx context.Context, da model.DataAvailabilitySelector) ([]model.Application, error)
	UpdateDA(ctx context.Context, applicationId int64, da model.DataAvailabilitySelector) error
	List(ctx context.Context) ([]model.Application, error)
	io.Closer
}

func NewAppRepository

func NewAppRepository(db *sqlx.DB) AppRepositoryInterface

type EpochRepository

type EpochRepository struct {
	Db *sqlx.DB
}

func (*EpochRepository) Close added in v0.0.2

func (e *EpochRepository) Close() error

Close implements EpochRepositoryInterface.

func (*EpochRepository) Create added in v0.0.2

func (e *EpochRepository) Create(ctx context.Context, epoch model.Epoch) (*model.Epoch, error)

func (*EpochRepository) FindOne

func (e *EpochRepository) FindOne(ctx context.Context, index uint64) (*model.Epoch, error)

FindOne retrieves a specific epoch by its index

func (*EpochRepository) GetLatestOpenEpochByAppID

func (e *EpochRepository) GetLatestOpenEpochByAppID(ctx context.Context, appID int64) (*model.Epoch, error)

type EpochRepositoryInterface

type EpochRepositoryInterface interface {
	GetLatestOpenEpochByAppID(ctx context.Context, appID int64) (*model.Epoch, error)
	FindOne(ctx context.Context, index uint64) (*model.Epoch, error)
	Create(ctx context.Context, epoch model.Epoch) (*model.Epoch, error)
	io.Closer
}

func NewEpochRepository

func NewEpochRepository(db *sqlx.DB) EpochRepositoryInterface

type InputRepository

type InputRepository struct {
	Db *sqlx.DB
}

func (*InputRepository) Close added in v0.0.2

func (i *InputRepository) Close() error

Close implements InputRepositoryInterface.

func (*InputRepository) Count

func (i *InputRepository) Count(
	ctx context.Context,
	filter []*cModel.ConvenienceFilter,
) (uint64, error)

func (*InputRepository) CountMap added in v0.0.2

func (i *InputRepository) CountMap(ctx context.Context) (map[int64]uint64, error)

func (*InputRepository) Create

func (i *InputRepository) Create(ctx context.Context, input model.Input) error

func (*InputRepository) FindAll

func (i *InputRepository) FindAll(
	ctx context.Context,
	first *int,
	last *int,
	after *string,
	before *string,
	filter []*cModel.ConvenienceFilter,
) (*commons.PageResult[model.Input], error)

func (*InputRepository) FindOne

func (i *InputRepository) FindOne(ctx context.Context, applicationId int64, index uint64) (*model.Input, error)

type InputRepositoryInterface

type InputRepositoryInterface interface {
	Create(ctx context.Context, input model.Input) error
	FindOne(ctx context.Context, applicationId int64, index uint64) (*model.Input, error)
	FindAll(
		ctx context.Context,
		first *int,
		last *int,
		after *string,
		before *string,
		filter []*cModel.ConvenienceFilter,
	) (*commons.PageResult[model.Input], error)
	Count(ctx context.Context, filter []*cModel.ConvenienceFilter) (uint64, error)
	CountMap(ctx context.Context) (map[int64]uint64, error)
	io.Closer
}

func NewInputRepository

func NewInputRepository(db *sqlx.DB) InputRepositoryInterface

Jump to

Keyboard shortcuts

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