presenters

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: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmpCheckName

func CmpCheckName(a, b Check) int

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 bridges.BridgeType) *BridgeResource

NewBridgeResource constructs a new BridgeResource

func (BridgeResource) GetName

func (r BridgeResource) GetName() string

GetName implements the api2go EntityNamer interface

type CSAKeyResource

type CSAKeyResource struct {
	JAID
	PubKey  string `json:"publicKey"`
	Version int    `json:"version"`
}

CSAKeyResource represents a CSA key JSONAPI resource.

func NewCSAKeyResource

func NewCSAKeyResource(key csakey.KeyV2) *CSAKeyResource

func NewCSAKeyResources

func NewCSAKeyResources(keys []csakey.KeyV2) []CSAKeyResource

func (CSAKeyResource) GetName

func (CSAKeyResource) GetName() string

GetName implements the api2go EntityNamer interface

type ChainResource

type ChainResource struct {
	JAID
	Enabled bool   `json:"enabled"`
	Config  string `json:"config"` // TOML
}

type Check

type Check struct {
	JAID
	Name   string `json:"name"`
	Status string `json:"status"`
	Output string `json:"output"`
}

func (Check) GetName

func (c Check) GetName() string

type DKGEncryptKeyResource

type DKGEncryptKeyResource struct {
	JAID
	PublicKey string `json:"publicKey"`
}

DKGEncryptKeyResource is just that.

func NewDKGEncryptKeyResource

func NewDKGEncryptKeyResource(key dkgencryptkey.Key) *DKGEncryptKeyResource

NewDKGEncryptKeyResource creates a new DKGEncryptKeyResource from the given DKG sign key.

func NewDKGEncryptKeyResources

func NewDKGEncryptKeyResources(keys []dkgencryptkey.Key) (resources []DKGEncryptKeyResource)

NewDKGEncryptKeyResources creates many DKGEncryptKeyResource objects from the given DKG sign keys.

func (DKGEncryptKeyResource) GetName

func (DKGEncryptKeyResource) GetName() string

GetName implements jsonapi.EntityNamer

type DKGSignKeyResource

type DKGSignKeyResource struct {
	JAID
	PublicKey string `json:"publicKey"`
}

DKGSignKeyResource is just that.

func NewDKGSignKeyResource

func NewDKGSignKeyResource(key dkgsignkey.Key) *DKGSignKeyResource

NewDKGSignKeyResource creates a new DKGSignKeyResource from the given DKG sign key.

func NewDKGSignKeyResources

func NewDKGSignKeyResources(keys []dkgsignkey.Key) (resources []DKGSignKeyResource)

NewDKGSignKeyResources creates many DKGSignKeyResource objects from the given DKG sign keys.

func (DKGSignKeyResource) GetName

func (DKGSignKeyResource) GetName() string

GetName implements jsonapi.EntityNamer

type DirectRequestSpec

type DirectRequestSpec struct {
	ContractAddress          ethkey.EIP55Address      `json:"contractAddress"`
	MinIncomingConfirmations clnull.Uint32            `json:"minIncomingConfirmations"`
	MinContractPayment       *commonassets.Link       `json:"minContractPaymentLinkJuels"`
	Requesters               models.AddressCollection `json:"requesters"`
	Initiator                string                   `json:"initiator"`
	CreatedAt                time.Time                `json:"createdAt"`
	UpdatedAt                time.Time                `json:"updatedAt"`
	EVMChainID               *big.Big                 `json:"evmChainID"`
}

DirectRequestSpec defines the spec details of a DirectRequest Job

type ETHKeyResource

type ETHKeyResource struct {
	JAID
	EVMChainID     big.Big            `json:"evmChainID"`
	Address        string             `json:"address"`
	EthBalance     *assets.Eth        `json:"ethBalance"`
	LinkBalance    *commonassets.Link `json:"linkBalance"`
	Disabled       bool               `json:"disabled"`
	CreatedAt      time.Time          `json:"createdAt"`
	UpdatedAt      time.Time          `json:"updatedAt"`
	MaxGasPriceWei *big.Big           `json:"maxGasPriceWei"`
}

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

func NewETHKeyResource

func NewETHKeyResource(k ethkey.KeyV2, state ethkey.State, opts ...NewETHKeyOption) *ETHKeyResource

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 EVMChainResource

type EVMChainResource struct {
	ChainResource
}

EVMChainResource is an EVM chain JSONAPI resource.

func NewEVMChainResource

func NewEVMChainResource(chain types.ChainStatus) EVMChainResource

NewEVMChainResource returns a new EVMChainResource for chain.

func (EVMChainResource) GetName

func (r EVMChainResource) GetName() string

GetName implements the api2go EntityNamer interface

type EVMNodeResource

type EVMNodeResource struct {
	NodeResource
}

EVMNodeResource is an EVM node JSONAPI resource.

func NewEVMNodeResource

func NewEVMNodeResource(node types.NodeStatus) EVMNodeResource

NewEVMNodeResource returns a new EVMNodeResource for node.

func (EVMNodeResource) GetName

func (r EVMNodeResource) GetName() string

GetName implements the api2go EntityNamer interface

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"`
	EVMChainID big.Big         `json:"evmChainID"`
}

EthTxResource represents a Ethereum Transaction JSONAPI resource.

func NewEthTxResource

func NewEthTxResource(tx txmgr.Tx) 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 txmgr.TxAttempt) EthTxResource

func (EthTxResource) GetName

func (EthTxResource) GetName() string

GetName implements the api2go EntityNamer interface

type ExternalInitiatorAuthentication

type ExternalInitiatorAuthentication struct {
	Name           string        `json:"name,omitempty"`
	URL            models.WebURL `json:"url,omitempty"`
	AccessKey      string        `json:"incomingAccessKey,omitempty"`
	Secret         string        `json:"incomingSecret,omitempty"`
	OutgoingToken  string        `json:"outgoingToken,omitempty"`
	OutgoingSecret string        `json:"outgoingSecret,omitempty"`
}

ExternalInitiatorAuthentication includes initiator and authentication details.

func NewExternalInitiatorAuthentication

func NewExternalInitiatorAuthentication(
	ei bridges.ExternalInitiator,
	eia auth.Token,
) *ExternalInitiatorAuthentication

NewExternalInitiatorAuthentication creates an instance of ExternalInitiatorAuthentication.

func (*ExternalInitiatorAuthentication) GetID

GetID returns the jsonapi ID.

func (*ExternalInitiatorAuthentication) GetName

GetName returns the collection name for jsonapi.

func (*ExternalInitiatorAuthentication) SetID

SetID is used to conform to the UnmarshallIdentifier interface for deserializing from jsonapi documents.

type ExternalInitiatorResource

type ExternalInitiatorResource struct {
	JAID
	Name          string         `json:"name"`
	URL           *models.WebURL `json:"url"`
	AccessKey     string         `json:"accessKey"`
	OutgoingToken string         `json:"outgoingToken"`
	CreatedAt     time.Time      `json:"createdAt"`
	UpdatedAt     time.Time      `json:"updatedAt"`
}

func (ExternalInitiatorResource) GetName

GetName returns the collection name for jsonapi.

type FeatureResource

type FeatureResource struct {
	JAID
	Enabled bool `json:"enabled"`
}

FeatureResource represents a Feature JSONAPI resource.

func NewFeatureResource

func NewFeatureResource(name string, enabled bool) *FeatureResource

NewFeedsManagerResource constructs a new FeedsManagerResource.

func (FeatureResource) GetName

func (r FeatureResource) GetName() string

GetName implements the api2go EntityNamer interface

type GatewaySpec

type GatewaySpec struct {
	GatewayConfig map[string]interface{} `json:"gatewayConfig"`
	CreatedAt     time.Time              `json:"createdAt"`
	UpdatedAt     time.Time              `json:"updatedAt"`
}

func NewGatewaySpec

func NewGatewaySpec(spec *job.GatewaySpec) *GatewaySpec

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"`
	GasLimit          clnull.Uint32   `json:"gasLimit"`
	ForwardingAllowed bool            `json:"forwardingAllowed"`
	MaxTaskDuration   models.Interval `json:"maxTaskDuration"`
	ExternalJobID     uuid.UUID       `json:"externalJobID"`
	VRFSpec           *VRFSpec        `json:"vrfSpec"`
	WebhookSpec       *WebhookSpec    `json:"webhookSpec"`
	GatewaySpec       *GatewaySpec    `json:"gatewaySpec"`
	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 (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     JobSpecType = "directrequest"
	FluxMonitorJobSpec       JobSpecType = "fluxmonitor"
	OffChainReportingJobSpec JobSpecType = "offchainreporting"
	KeeperJobSpec            JobSpecType = "keeper"
	CronJobSpec              JobSpecType = "cron"
	VRFJobSpec               JobSpecType = "vrf"
	WebhookJobSpec           JobSpecType = "webhook"
	BlockhashStoreJobSpec    JobSpecType = "blockhashstore"
	BlockHeaderFeederJobSpec JobSpecType = "blockheaderfeeder"
	BootstrapJobSpec         JobSpecType = "bootstrap"
	GatewayJobSpec           JobSpecType = "gateway"
)

func (JobSpecType) String

func (t JobSpecType) String() string

type NewETHKeyOption

type NewETHKeyOption func(*ETHKeyResource)

NewETHKeyOption defines a functional option which allows customisation of the EthKeyResource

func SetETHKeyEthBalance

func SetETHKeyEthBalance(ethBalance *assets.Eth) NewETHKeyOption

func SetETHKeyLinkBalance

func SetETHKeyLinkBalance(linkBalance *commonassets.Link) NewETHKeyOption

func SetETHKeyMaxGasPriceWei

func SetETHKeyMaxGasPriceWei(maxGasPriceWei *big.Big) NewETHKeyOption

type NodeResource

type NodeResource struct {
	JAID
	ChainID string `json:"chainID"`
	Name    string `json:"name"`
	Config  string `json:"config"` // TOML
	State   string `json:"state"`
}

type PipelineRunResource

type PipelineRunResource struct {
	JAID
	Outputs []*string `json:"outputs"`
	// XXX: Here for backwards compatibility, can be removed later
	// Deprecated: Errors
	Errors       []*string                 `json:"errors"`
	AllErrors    []*string                 `json:"allErrors"`
	FatalErrors  []*string                 `json:"fatalErrors"`
	Inputs       pipeline.JSONSerializable `json:"inputs"`
	TaskRuns     []PipelineTaskRunResource `json:"taskRuns"`
	CreatedAt    time.Time                 `json:"createdAt"`
	FinishedAt   null.Time                 `json:"finishedAt"`
	PipelineSpec PipelineSpec              `json:"pipelineSpec"`
}

Corresponds with models.d.ts PipelineRun

func NewPipelineRunResource

func NewPipelineRunResource(pr pipeline.Run, lggr logger.Logger) PipelineRunResource

func NewPipelineRunResources

func NewPipelineRunResources(prs []pipeline.Run, lggr logger.Logger) []PipelineRunResource

func (PipelineRunResource) GetName

func (r PipelineRunResource) GetName() string

GetName implements the api2go EntityNamer interface

type PipelineSpec

type PipelineSpec struct {
	ID           int32  `json:"id"`
	JobID        int32  `json:"jobID"`
	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 PipelineTaskRunResource

type PipelineTaskRunResource struct {
	Type       pipeline.TaskType `json:"type"`
	CreatedAt  time.Time         `json:"createdAt"`
	FinishedAt null.Time         `json:"finishedAt"`
	Output     *string           `json:"output"`
	Error      *string           `json:"error"`
	DotID      string            `json:"dotId"`
}

Corresponds with models.d.ts PipelineTaskRun

func NewPipelineTaskRunResource

func NewPipelineTaskRunResource(tr pipeline.TaskRun) PipelineTaskRunResource

func (PipelineTaskRunResource) GetName

func (r PipelineTaskRunResource) GetName() string

GetName implements the api2go EntityNamer interface

type RegistrationSettings

type RegistrationSettings struct {
	JAID
	Settings protocol.CredentialCreation `json:"settings"`
}

RegistrationSettings represents an enrollment settings object

func NewRegistrationSettings

func NewRegistrationSettings(settings protocol.CredentialCreation) *RegistrationSettings

NewRegistrationSettings creates a new structure to enroll a new hardware key for authentication

func (RegistrationSettings) GetName

func (r RegistrationSettings) GetName() string

GetName implements the api2go EntityNamer interface

type ServiceLogConfigResource

type ServiceLogConfigResource struct {
	JAID
	ServiceName     []string `json:"serviceName"`
	LogLevel        []string `json:"logLevel"`
	DefaultLogLevel string   `json:"defaultLogLevel"`
}

func (ServiceLogConfigResource) GetName

func (r ServiceLogConfigResource) GetName() string

GetName implements the api2go EntityNamer interface

type UserResource

type UserResource struct {
	JAID
	Email             string            `json:"email"`
	Role              sessions.UserRole `json:"role"`
	HasActiveApiToken string            `json:"hasActiveApiToken"`
	CreatedAt         time.Time         `json:"createdAt"`
	UpdatedAt         time.Time         `json:"updatedAt"`
}

UserResource represents a User JSONAPI resource.

func NewUserResource

func NewUserResource(u sessions.User) *UserResource

NewUserResource constructs a new UserResource.

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

func NewUserResources

func NewUserResources(users []sessions.User) []UserResource

func (UserResource) GetName

func (r UserResource) GetName() string

GetName implements the api2go EntityNamer interface

type VRFKeyResource

type VRFKeyResource struct {
	JAID
	Compressed   string `json:"compressed"`
	Uncompressed string `json:"uncompressed"`
	Hash         string `json:"hash"`
}

func NewVRFKeyResource

func NewVRFKeyResource(key vrfkey.KeyV2, lggr logger.Logger) *VRFKeyResource

func NewVRFKeyResources

func NewVRFKeyResources(keys []vrfkey.KeyV2, lggr logger.Logger) []VRFKeyResource

func (VRFKeyResource) GetName

func (VRFKeyResource) GetName() string

GetName implements the api2go EntityNamer interface

type VRFSpec

type VRFSpec struct {
	BatchCoordinatorAddress       *ethkey.EIP55Address  `json:"batchCoordinatorAddress"`
	BatchFulfillmentEnabled       bool                  `json:"batchFulfillmentEnabled"`
	CustomRevertsPipelineEnabled  *bool                 `json:"customRevertsPipelineEnabled,omitempty"`
	BatchFulfillmentGasMultiplier float64               `json:"batchFulfillmentGasMultiplier"`
	CoordinatorAddress            ethkey.EIP55Address   `json:"coordinatorAddress"`
	PublicKey                     secp256k1.PublicKey   `json:"publicKey"`
	FromAddresses                 []ethkey.EIP55Address `json:"fromAddresses"`
	PollPeriod                    models.Duration       `json:"pollPeriod"`
	MinIncomingConfirmations      uint32                `json:"confirmations"`
	CreatedAt                     time.Time             `json:"createdAt"`
	UpdatedAt                     time.Time             `json:"updatedAt"`
	EVMChainID                    *big.Big              `json:"evmChainID"`
	ChunkSize                     uint32                `json:"chunkSize"`
	RequestTimeout                models.Duration       `json:"requestTimeout"`
	BackoffInitialDelay           models.Duration       `json:"backoffInitialDelay"`
	BackoffMaxDelay               models.Duration       `json:"backoffMaxDelay"`
	GasLanePrice                  *assets.Wei           `json:"gasLanePrice"`
	RequestedConfsDelay           int64                 `json:"requestedConfsDelay"`
	VRFOwnerAddress               *ethkey.EIP55Address  `json:"vrfOwnerAddress,omitempty"`
}

func NewVRFSpec

func NewVRFSpec(spec *job.VRFSpec) *VRFSpec

type WebhookSpec

type WebhookSpec struct {
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

WebhookSpec defines the spec details of a Webhook Job

func NewWebhookSpec

func NewWebhookSpec(spec *job.WebhookSpec) *WebhookSpec

NewWebhookSpec generates a new WebhookSpec from a job.WebhookSpec

Jump to

Keyboard shortcuts

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