presenters

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeResource

type BridgeResource struct {
	JAID
	Name          string `json:"name"`
	URL           string `json:"url"`
	Confirmations uint32 `json:"confirmations"`
	// The IncomingToken is only provided when creating a Bridge
	IncomingToken          string       `json:"incomingToken,omitempty"`
	OutgoingToken          string       `json:"outgoingToken"`
	MinimumContractPayment *assets.Link `json:"minimumContractPayment"`
	CreatedAt              time.Time    `json:"createdAt"`
}

BridgeResource represents a Bridge JSONAPI resource.

func NewBridgeResource

func NewBridgeResource(b models.BridgeType) *BridgeResource

NewBridgeResource constructs a new BridgeResource

func (BridgeResource) GetName

func (r BridgeResource) GetName() string

GetName implements the api2go EntityNamer interface

type DirectRequestSpec

type DirectRequestSpec struct {
	ContractAddress  models.EIP55Address `json:"contractAddress"`
	OnChainJobSpecID string              `json:"onChainJobSpecId"`
	Initiator        string              `json:"initiator"`
	CreatedAt        time.Time           `json:"createdAt"`
	UpdatedAt        time.Time           `json:"updatedAt"`
}

DirectRequestSpec defines the spec details of a DirectRequest Job

func NewDirectRequestSpec

func NewDirectRequestSpec(spec *job.DirectRequestSpec) *DirectRequestSpec

NewDirectRequestSpec initializes a new DirectRequestSpec from a job.DirectRequestSpec

type ETHKeyResource

type ETHKeyResource struct {
	JAID
	Address     string         `json:"address"`
	EthBalance  *assets.Eth    `json:"ethBalance"`
	LinkBalance *assets.Link   `json:"linkBalance"`
	NextNonce   int64          `json:"nextNonce"`
	LastUsed    *time.Time     `json:"lastUsed"`
	IsFunding   bool           `json:"isFunding"`
	CreatedAt   time.Time      `json:"createdAt"`
	UpdatedAt   time.Time      `json:"updatedAt"`
	DeletedAt   gorm.DeletedAt `json:"deletedAt"`
}

ETHKeyResource represents a ETH key JSONAPI resource. It holds the hex representation of the address plus it's ETH & LINK balances

func NewETHKeyResource

func NewETHKeyResource(k models.Key, opts ...NewETHKeyOption) (*ETHKeyResource, error)

NewETHKeyResource constructs a new ETHKeyResource from a Key.

Use the functional options to inject the ETH and LINK balances

func (ETHKeyResource) GetName

func (r ETHKeyResource) GetName() string

GetName implements the api2go EntityNamer interface

This is named as such for backwards compatibility with the operator ui TODO - Standardise this to ethKeys

type EthTxResource

type EthTxResource struct {
	JAID
	State    string          `json:"state"`
	Data     hexutil.Bytes   `json:"data"`
	From     *common.Address `json:"from"`
	GasLimit string          `json:"gasLimit"`
	GasPrice string          `json:"gasPrice"`
	Hash     common.Hash     `json:"hash"`
	Hex      string          `json:"rawHex"`
	Nonce    string          `json:"nonce"`
	SentAt   string          `json:"sentAt"`
	To       *common.Address `json:"to"`
	Value    string          `json:"value"`
}

EthTxResource represents a Ethereum Transaction JSONAPI resource.

func NewEthTxResource

func NewEthTxResource(tx models.EthTx) EthTxResource

NewEthTxResource generates a EthTxResource from an Eth.Tx.

For backwards compatibility, there is no id set when initializing from an EthTx as the id being used was the EthTxAttempt Hash. This should really use it's proper id

func NewEthTxResourceFromAttempt

func NewEthTxResourceFromAttempt(txa models.EthTxAttempt) EthTxResource

func (EthTxResource) GetName

func (EthTxResource) GetName() string

GetName implements the api2go EntityNamer interface

type FluxMonitorSpec

type FluxMonitorSpec struct {
	ContractAddress   models.EIP55Address `json:"contractAddress"`
	Precision         int32               `json:"precision"`
	Threshold         float32             `json:"threshold"`
	AbsoluteThreshold float32             `json:"absoluteThreshold"`
	PollTimerPeriod   string              `json:"pollTimerPeriod"`
	PollTimerDisabled bool                `json:"pollTimerDisabled"`
	IdleTimerPeriod   string              `json:"idleTimerPeriod"`
	IdleTimerDisabled bool                `json:"idleTimerDisabled"`
	MinPayment        *assets.Link        `json:"minPayment"`
	CreatedAt         time.Time           `json:"createdAt"`
	UpdatedAt         time.Time           `json:"updatedAt"`
}

FluxMonitorSpec defines the spec details of a FluxMonitor Job

func NewFluxMonitorSpec

func NewFluxMonitorSpec(spec *job.FluxMonitorSpec) *FluxMonitorSpec

NewFluxMonitorSpec initializes a new DirectFluxMonitorSpec from a job.FluxMonitorSpec

type JAID

type JAID struct {
	ID string `json:"-"`
}

JAID represents a JSON API ID. It implements the api2go MarshalIdentifier and UnmarshalIdentitier interface.

func NewJAID

func NewJAID(id string) JAID

func NewJAIDInt32

func NewJAIDInt32(id int32) JAID

NewJAIDInt32 converts an int32 into a JAID

func NewJAIDInt64

func NewJAIDInt64(id int64) JAID

NewJAIDInt64 converts an int64 into a JAID

func (JAID) GetID

func (jaid JAID) GetID() string

GetID implements the api2go MarshalIdentifier interface.

func (*JAID) SetID

func (jaid *JAID) SetID(value string) error

SetID implements the api2go UnmarshalIdentitier interface.

type JobError

type JobError struct {
	ID          int64     `json:"id"`
	Description string    `json:"description"`
	Occurrences uint      `json:"occurrences"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

JobError represents errors on the job

func NewJobError

func NewJobError(e job.SpecError) JobError

type JobResource

type JobResource struct {
	JAID
	Name                  string                 `json:"name"`
	Type                  JobSpecType            `json:"type"`
	SchemaVersion         uint32                 `json:"schemaVersion"`
	MaxTaskDuration       models.Interval        `json:"maxTaskDuration"`
	DirectRequestSpec     *DirectRequestSpec     `json:"directRequestSpec"`
	FluxMonitorSpec       *FluxMonitorSpec       `json:"fluxMonitorSpec"`
	OffChainReportingSpec *OffChainReportingSpec `json:"offChainReportingOracleSpec"`
	KeeperSpec            *KeeperSpec            `json:"keeperSpec"`
	PipelineSpec          PipelineSpec           `json:"pipelineSpec"`
	Errors                []JobError             `json:"errors"`
}

JobResource represents a JobResource

func NewJobResource

func NewJobResource(j job.Job) *JobResource

NewJobResource initializes a new JSONAPI job resource

func NewJobResources

func NewJobResources(js []job.Job) []JobResource

NewJobResources initializes a slice of JSONAPI job resources

func (JobResource) GetName

func (r JobResource) GetName() string

GetName implements the api2go EntityNamer interface

type JobSpecType

type JobSpecType string

JobSpecType defines the the the spec type of the job

const (
	// DirectRequestJobSpec defines a Direct Request Job
	DirectRequestJobSpec JobSpecType = "directrequest"
	// FluxMonitorJobSpec defines a Flux Monitor Job
	FluxMonitorJobSpec JobSpecType = "fluxmonitor"
	// OffChainReportingJobSpec defines an OCR Job
	OffChainReportingJobSpec JobSpecType = "offchainreporting"
	// Keeper defines a Keeper Job
	KeeperJobSpec JobSpecType = "keeper"
)

func (JobSpecType) String

func (t JobSpecType) String() string

type KeeperSpec

type KeeperSpec struct {
	ContractAddress models.EIP55Address `json:"contractAddress"`
	FromAddress     models.EIP55Address `json:"fromAddress"`
	CreatedAt       time.Time           `json:"createdAt"`
	UpdatedAt       time.Time           `json:"updatedAt"`
}

KeeperSpec defines the spec details of a Keeper Job

func NewKeeperSpec

func NewKeeperSpec(spec *job.KeeperSpec) *KeeperSpec

NewKeeperSpec generates a new KeeperSpec from a job.KeeperSpec

type LogResource

type LogResource struct {
	JAID
	Level      string `json:"level"`
	SqlEnabled bool   `json:"sqlEnabled"`
}

func (LogResource) GetName

func (r LogResource) GetName() string

GetName implements the api2go EntityNamer interface

type NewETHKeyOption

type NewETHKeyOption func(*ETHKeyResource) error

NewETHKeyOption defines a functional option which allows customisation of the EthKeyResource

func SetETHKeyEthBalance

func SetETHKeyEthBalance(ethBalance *assets.Eth) NewETHKeyOption

func SetETHKeyLinkBalance

func SetETHKeyLinkBalance(linkBalance *assets.Link) NewETHKeyOption

type OCRKeysBundleResource

type OCRKeysBundleResource struct {
	JAID
	OnChainSigningAddress ocrkey.OnChainSigningAddress `json:"onChainSigningAddress"`
	OffChainPublicKey     ocrkey.OffChainPublicKey     `json:"offChainPublicKey"`
	ConfigPublicKey       ocrkey.ConfigPublicKey       `json:"configPublicKey"`
	CreatedAt             time.Time                    `json:"createdAt"`
	UpdatedAt             time.Time                    `json:"updatedAt"`
	DeletedAt             *time.Time                   `json:"deletedAt"`
}

OCRKeysBundleResource represents a bundle of OCRs keys as JSONAPI resource

func NewOCRKeysBundleResource

func NewOCRKeysBundleResource(bundle ocrkey.EncryptedKeyBundle) *OCRKeysBundleResource

func NewOCRKeysBundleResources

func NewOCRKeysBundleResources(keys []ocrkey.EncryptedKeyBundle) []OCRKeysBundleResource

func (OCRKeysBundleResource) GetName

func (r OCRKeysBundleResource) GetName() string

GetName implements the api2go EntityNamer interface

type OffChainReportingSpec

type OffChainReportingSpec struct {
	ContractAddress                        models.EIP55Address  `json:"contractAddress"`
	P2PPeerID                              *models.PeerID       `json:"p2pPeerID"`
	P2PBootstrapPeers                      pq.StringArray       `json:"p2pBootstrapPeers"`
	IsBootstrapPeer                        bool                 `json:"isBootstrapPeer"`
	EncryptedOCRKeyBundleID                *models.Sha256Hash   `json:"keyBundleID"`
	TransmitterAddress                     *models.EIP55Address `json:"transmitterAddress"`
	ObservationTimeout                     models.Interval      `json:"observationTimeout"`
	BlockchainTimeout                      models.Interval      `json:"blockchainTimeout"`
	ContractConfigTrackerSubscribeInterval models.Interval      `json:"contractConfigTrackerSubscribeInterval"`
	ContractConfigTrackerPollInterval      models.Interval      `json:"contractConfigTrackerPollInterval"`
	ContractConfigConfirmations            uint16               `json:"contractConfigConfirmations"`
	CreatedAt                              time.Time            `json:"createdAt"`
	UpdatedAt                              time.Time            `json:"updatedAt"`
}

OffChainReportingSpec defines the spec details of a OffChainReporting Job

func NewOffChainReportingSpec

func NewOffChainReportingSpec(spec *job.OffchainReportingOracleSpec) *OffChainReportingSpec

NewOffChainReportingSpec initializes a new OffChainReportingSpec from a job.OffchainReportingOracleSpec

type P2PKeyResource

type P2PKeyResource struct {
	JAID
	PeerID    string     `json:"peerId"`
	PubKey    string     `json:"publicKey"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt"`
}

P2PKeyResource represents a P2P key JSONAPI resource.

func NewP2PKeyResource

func NewP2PKeyResource(key p2pkey.EncryptedP2PKey) *P2PKeyResource

func NewP2PKeyResources

func NewP2PKeyResources(keys []p2pkey.EncryptedP2PKey) []P2PKeyResource

func (P2PKeyResource) GetName

func (P2PKeyResource) GetName() string

GetName implements the api2go EntityNamer interface

type PipelineSpec

type PipelineSpec struct {
	ID           int32  `json:"id"`
	DotDAGSource string `json:"dotDagSource"`
}

PipelineSpec defines the spec details of the pipeline

func NewPipelineSpec

func NewPipelineSpec(spec *pipeline.Spec) PipelineSpec

NewPipelineSpec generates a new PipelineSpec from a pipeline.Spec

type UserResource

type UserResource struct {
	JAID
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
}

UserResource represents a User JSONAPI resource.

func NewUserResource

func NewUserResource(u models.User) *UserResource

NewUserResource constructs a new UserResource.

A User does not have an ID primary key, so we must use the email

func (UserResource) GetName

func (r UserResource) GetName() string

GetName implements the api2go EntityNamer interface

Jump to

Keyboard shortcuts

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