loader

package
v0.0.0-...-3674750 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidType = errors.New("invalid type")

ErrInvalidType indicates that results loaded is not the type expected

Functions

func GetChainByID

func GetChainByID(ctx context.Context, id string) (*commontypes.ChainStatus, error)

GetChainByID fetches the chain by it's id.

func GetEthTxAttemptsByEthTxID

func GetEthTxAttemptsByEthTxID(ctx context.Context, id string) ([]txmgr.TxAttempt, error)

GetEthTxAttemptsByEthTxID fetches the attempts for an eth transaction.

func GetJobByExternalJobID

func GetJobByExternalJobID(ctx context.Context, id string) (*job.Job, error)

GetJobByExternalJobID fetches the job proposals by external job ID

func GetJobByPipelineSpecID

func GetJobByPipelineSpecID(ctx context.Context, id string) (*job.Job, error)

GetJobByPipelineSpecID fetches the job by pipeline spec ID.

func GetJobRunsByIDs

func GetJobRunsByIDs(ctx context.Context, ids []int64) ([]pipeline.Run, error)

GetJobRunsByIDs fetches the job runs by their ID.

func GetJobSpecErrorsByJobID

func GetJobSpecErrorsByJobID(ctx context.Context, jobID int32) ([]job.SpecError, error)

GetJobSpecErrorsByJobID fetches the Spec Errors for a Job.

func GetNodesByChainID

func GetNodesByChainID(ctx context.Context, id string) ([]types.Node, error)

GetNodesByChainID fetches the nodes for a chain.

func InjectDataloader

func InjectDataloader(ctx context.Context, app erinaceus.Application) context.Context

InjectDataloader injects the dataloader into the context.

func Middleware

func Middleware(app erinaceus.Application) gin.HandlerFunc

Middleware injects the dataloader into a gin context.

Types

type Dataloader

type Dataloader struct {
	ChainsByIDLoader                *dataloader.Loader
	EthTxAttemptsByEthTxIDLoader    *dataloader.Loader
	JobProposalsByManagerIDLoader   *dataloader.Loader
	JobProposalSpecsByJobProposalID *dataloader.Loader
	JobRunsByIDLoader               *dataloader.Loader
	JobsByExternalJobIDs            *dataloader.Loader
	JobsByPipelineSpecIDLoader      *dataloader.Loader
	NodesByChainIDLoader            *dataloader.Loader
	SpecErrorsByJobIDLoader         *dataloader.Loader
	// contains filtered or unexported fields
}

func For

func For(ctx context.Context) *Dataloader

For returns the dataloader for a given context

func New

Jump to

Keyboard shortcuts

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