feeds

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	JobTypeFluxMonitor       = "fluxmonitor"
	JobTypeOffchainReporting = "offchainreporting"
)

We only support OCR and FM for the feeds manager

Variables

This section is empty.

Functions

func NewORM

func NewORM(db *gorm.DB) *orm

Types

type FeedsManager

type FeedsManager struct {
	ID        int64
	Name      string
	URI       string
	PublicKey crypto.PublicKey
	JobTypes  pq.StringArray `gorm:"type:text[]"`
	Network   string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (FeedsManager) TableName

func (FeedsManager) TableName() string

type JobProposal

type JobProposal struct {
	ID             int64
	Spec           string
	Status         JobProposalStatus
	JobID          uuid.NullUUID
	FeedsManagerID int64
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type JobProposalStatus

type JobProposalStatus string

JobProposalStatus are the status codes that define the stage of a proposal

const (
	JobProposalStatusPending  JobProposalStatus = "pending"
	JobProposalStatusApproved JobProposalStatus = "approved"
	JobProposalStatusRejected JobProposalStatus = "rejected"
)

type ORM

type ORM interface {
	CountJobProposals() (int64, error)
	CountManagers() (int64, error)
	CreateJobProposal(ctx context.Context, jp *JobProposal) (int64, error)
	CreateManager(ctx context.Context, ms *FeedsManager) (int64, error)
	GetJobProposal(ctx context.Context, id int64) (*JobProposal, error)
	GetManager(ctx context.Context, id int64) (*FeedsManager, error)
	ListJobProposals(ctx context.Context) ([]JobProposal, error)
	ListManagers(ctx context.Context) ([]FeedsManager, error)
}

type RPCHandlers

type RPCHandlers struct {
	// contains filtered or unexported fields
}

RPCHandlers define handlers for RPC method calls from the Feeds Manager

func NewRPCHandlers

func NewRPCHandlers(svc Service, feedsManagerID int64) *RPCHandlers

func (*RPCHandlers) ProposeJob

ProposeJob creates a new job proposal record for the feeds manager

type Service

type Service interface {
	Start() error
	Close() error

	CountManagers() (int64, error)
	CreateJobProposal(jp *JobProposal) (int64, error)
	GetManager(id int64) (*FeedsManager, error)
	ListManagers() ([]FeedsManager, error)
	RegisterManager(ms *FeedsManager) (int64, error)
}

func NewService

func NewService(orm ORM, ks keystore.CSAKeystoreInterface) Service

NewService constructs a new feeds service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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