Documentation ¶
Overview ¶
Package presenters allow for the specification and result of a Job, its associated TaskSpecs, and every JobRun and TaskRun to be returned in a user friendly human readable format.
Index ¶
- func FriendlyBigInt(n *big.Int) string
- type ConfigPrinter
- type ETHKey
- type EnvPrinter
- type EthTx
- type ExplorerStatus
- type ExternalInitiatorAuthentication
- type Initiator
- type JobRun
- type JobSpec
- func (job JobSpec) FriendlyCreatedAt() string
- func (job JobSpec) FriendlyEndAt() string
- func (job JobSpec) FriendlyInitiators() string
- func (job JobSpec) FriendlyMinPayment() string
- func (job JobSpec) FriendlyStartAt() string
- func (job JobSpec) FriendlyTasks() string
- func (job JobSpec) MarshalJSON() ([]byte, error)
- type NewAccount
- type ServiceAgreement
- func (sa ServiceAgreement) FriendlyAggregator() string
- func (sa ServiceAgreement) FriendlyAggregatorFulfillMethod() string
- func (sa ServiceAgreement) FriendlyAggregatorInitMethod() string
- func (sa ServiceAgreement) FriendlyCreatedAt() string
- func (sa ServiceAgreement) FriendlyExpiration() string
- func (sa ServiceAgreement) FriendlyPayment() string
- func (sa ServiceAgreement) MarshalJSON() ([]byte, error)
- type ServiceAgreementPresentation
- type TaskSpec
- type UserPresenter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FriendlyBigInt ¶
FriendlyBigInt returns a string printing the integer in both decimal and hexadecimal formats.
Types ¶
type ConfigPrinter ¶ added in v0.8.17
type ConfigPrinter struct {
EnvPrinter
}
ConfigPrinter are the non-secret values of the node
If you add an entry here, you should update NewConfigPrinter and ConfigPrinter#String accordingly.
func NewConfigPrinter ¶ added in v0.8.17
func NewConfigPrinter(store *store.Store) (ConfigPrinter, error)
NewConfigPrinter creates an instance of ConfigPrinter
func (ConfigPrinter) GetID ¶ added in v0.8.17
func (c ConfigPrinter) GetID() string
GetID generates a new ID for jsonapi serialization.
func (*ConfigPrinter) SetID ¶ added in v0.8.17
func (c *ConfigPrinter) SetID(value string) error
SetID is used to conform to the UnmarshallIdentifier interface for deserializing from jsonapi documents.
func (ConfigPrinter) String ¶ added in v0.8.17
func (c ConfigPrinter) String() string
String returns the values as a newline delimited string
type ETHKey ¶ added in v0.9.3
type ETHKey struct { 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 null.Time `json:"deletedAt"` }
ETHKey holds the hex representation of the address plus it's ETH & LINK balances
type EnvPrinter ¶ added in v0.8.17
type EnvPrinter struct { AllowOrigins string `json:"allowOrigins"` BalanceMonitorEnabled bool `json:"balanceMonitorEnabled"` BlockBackfillDepth uint64 `json:"blockBackfillDepth"` BridgeResponseURL string `json:"bridgeResponseURL,omitempty"` ChainID *big.Int `json:"ethChainId"` ClientNodeURL string `json:"clientNodeUrl"` DatabaseTimeout models.Duration `json:"databaseTimeout"` DatabaseMaximumTxDuration time.Duration `json:"databaseMaximumTxDuration"` DefaultHTTPLimit int64 `json:"defaultHttpLimit"` DefaultHTTPTimeout models.Duration `json:"defaultHttpTimeout"` Dev bool `json:"chainlinkDev"` EnableExperimentalAdapters bool `json:"enableExperimentalAdapters"` EthBalanceMonitorBlockDelay uint16 `json:"ethBalanceMonitorBlockDelay"` EthereumDisabled bool `json:"ethereumDisabled"` EthFinalityDepth uint `json:"ethFinalityDepth"` EthGasBumpThreshold uint64 `json:"ethGasBumpThreshold"` EthGasBumpTxDepth uint16 `json:"ethGasBumpTxDepth"` EthGasBumpWei *big.Int `json:"ethGasBumpWei"` EthGasLimitDefault uint64 `json:"ethGasLimitDefault"` EthGasPriceDefault *big.Int `json:"ethGasPriceDefault"` EthHeadTrackerHistoryDepth uint `json:"ethHeadTrackerHistoryDepth"` EthHeadTrackerMaxBufferSize uint `json:"ethHeadTrackerMaxBufferSize"` EthMaxGasPriceWei *big.Int `json:"ethMaxGasPriceWei"` EthereumURL string `json:"ethUrl"` EthereumSecondaryURLs []string `json:"ethSecondaryUrls"` ExplorerURL string `json:"explorerUrl"` FeatureExternalInitiators bool `json:"featureExternalInitiators"` FeatureFluxMonitor bool `json:"featureFluxMonitor"` FeatureOffchainReporting bool `json:"featureOffchainReporting"` FlagsContractAddress string `json:"flagsContractAddress"` GasUpdaterBlockDelay uint16 `json:"gasUpdaterBlockDelay"` GasUpdaterBlockHistorySize uint16 `json:"gasUpdaterBlockHistorySize"` GasUpdaterEnabled bool `json:"gasUpdaterEnabled"` GasUpdaterTransactionPercentile uint16 `json:"gasUpdaterTransactionPercentile"` InsecureFastScrypt bool `json:"insecureFastScrypt"` TriggerFallbackDBPollInterval time.Duration `json:"jobPipelineDBPollInterval"` JobPipelineMaxTaskDuration time.Duration `json:"jobPipelineMaxTaskDuration"` JobPipelineParallelism uint8 `json:"jobPipelineParallelism"` JobPipelineReaperInterval time.Duration `json:"jobPipelineReaperInterval"` JobPipelineReaperThreshold time.Duration `json:"jobPipelineReaperThreshold"` JSONConsole bool `json:"jsonConsole"` LinkContractAddress string `json:"linkContractAddress"` LogLevel orm.LogLevel `json:"logLevel"` LogSQLMigrations bool `json:"logSqlMigrations"` LogSQLStatements bool `json:"logSqlStatements"` LogToDisk bool `json:"logToDisk"` MaximumServiceDuration models.Duration `json:"maximumServiceDuration"` MinIncomingConfirmations uint32 `json:"minIncomingConfirmations"` MinRequiredOutgoingConfirmations uint64 `json:"minOutgoingConfirmations"` MinimumServiceDuration models.Duration `json:"minimumServiceDuration"` MinimumContractPayment *assets.Link `json:"minimumContractPayment"` MinimumRequestExpiration uint64 `json:"minimumRequestExpiration"` OCRBootstrapCheckInterval time.Duration `json:"ocrBootstrapCheckInterval"` OCRContractTransmitterTransmitTimeout time.Duration `json:"ocrContractTransmitterTransmitTimeout"` OCRDatabaseTimeout time.Duration `json:"ocrDatabaseTimeout"` P2PListenIP string `json:"ocrListenIP"` P2PListenPort uint16 `json:"ocrListenPort"` OCRIncomingMessageBufferSize int `json:"ocrIncomingMessageBufferSize"` OCROutgoingMessageBufferSize int `json:"ocrOutgoingMessageBufferSize"` OCRNewStreamTimeout time.Duration `json:"ocrNewStreamTimeout"` OCRDHTLookupInterval int `json:"ocrDHTLookupInterval"` OCRTraceLogging bool `json:"ocrTraceLogging"` OperatorContractAddress common.Address `json:"oracleContractAddress"` Port uint16 `json:"chainlinkPort"` ReaperExpiration models.Duration `json:"reaperExpiration"` ReplayFromBlock int64 `json:"replayFromBlock"` RootDir string `json:"root"` SecureCookies bool `json:"secureCookies"` SessionTimeout models.Duration `json:"sessionTimeout"` TLSHost string `json:"chainlinkTLSHost"` TLSPort uint16 `json:"chainlinkTLSPort"` TLSRedirect bool `json:"chainlinkTLSRedirect"` TxAttemptLimit uint16 `json:"txAttemptLimit"` }
EnvPrinter contains the supported environment variables
type EthTx ¶ added in v0.9.6
type EthTx struct { ID int64 `json:"-"` State string `json:"state,omitempty"` Data hexutil.Bytes `json:"data,omitempty"` From *common.Address `json:"from,omitempty"` GasLimit string `json:"gasLimit,omitempty"` GasPrice string `json:"gasPrice,omitempty"` Hash common.Hash `json:"hash,omitempty"` Hex string `json:"rawHex,omitempty"` Nonce string `json:"nonce,omitempty"` SentAt string `json:"sentAt,omitempty"` To *common.Address `json:"to,omitempty"` Value string `json:"value,omitempty"` }
EthTx is a jsonapi wrapper for an Ethereum Transaction.
func NewEthTxFromAttempt ¶ added in v0.9.6
func NewEthTxFromAttempt(txa models.EthTxAttempt) EthTx
type ExplorerStatus ¶ added in v0.8.2
ExplorerStatus represents the connected server and status of the connection
func NewExplorerStatus ¶ added in v0.8.2
func NewExplorerStatus(statsPusher synchronization.StatsPusher) ExplorerStatus
NewExplorerStatus returns an initialized ExplorerStatus from the store
type ExternalInitiatorAuthentication ¶ added in v0.6.6
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 ¶ added in v0.6.6
func NewExternalInitiatorAuthentication( ei models.ExternalInitiator, eia auth.Token, ) *ExternalInitiatorAuthentication
NewExternalInitiatorAuthentication creates an instance of ExternalInitiatorAuthentication.
func (*ExternalInitiatorAuthentication) GetID ¶ added in v0.6.6
func (ei *ExternalInitiatorAuthentication) GetID() string
GetID returns the jsonapi ID.
func (*ExternalInitiatorAuthentication) GetName ¶ added in v0.6.6
func (*ExternalInitiatorAuthentication) GetName() string
GetName returns the collection name for jsonapi.
func (*ExternalInitiatorAuthentication) SetID ¶ added in v0.6.6
func (ei *ExternalInitiatorAuthentication) SetID(name string) error
SetID is used to conform to the UnmarshallIdentifier interface for deserializing from jsonapi documents.
type Initiator ¶
Initiator holds the Job definition's Initiator.
func (Initiator) FriendlyAddress ¶
FriendlyAddress returns the Ethereum address if present, and a blank string if not.
func (Initiator) FriendlyRunAt ¶
FriendlyRunAt returns a human-readable string for Cron Initiator types.
func (Initiator) MarshalJSON ¶
MarshalJSON returns the JSON data of the Initiator based on its Initiator Type.
type JobRun ¶
JobRun presents an API friendly version of the data.
func (JobRun) MarshalJSON ¶
MarshalJSON returns the JSON data of the JobRun and its Initiator.
type JobSpec ¶
type JobSpec struct { models.JobSpec Errors []models.JobSpecError `json:"errors"` Earnings *assets.Link `json:"earnings"` }
JobSpec holds the JobSpec definition together with the total link earned from that job
func (JobSpec) FriendlyCreatedAt ¶
FriendlyCreatedAt returns a human-readable string of the Job's CreatedAt field.
func (JobSpec) FriendlyEndAt ¶
FriendlyEndAt returns a human-readable string of the Job's EndAt field.
func (JobSpec) FriendlyInitiators ¶
FriendlyInitiators returns the list of Initiator types as a comma separated string.
func (JobSpec) FriendlyMinPayment ¶ added in v0.6.6
FriendlyMinPayment returns a formatted string of the Job's Minimum Link Payment threshold
func (JobSpec) FriendlyStartAt ¶
FriendlyStartAt returns a human-readable string of the Job's StartAt field.
func (JobSpec) FriendlyTasks ¶
FriendlyTasks returns the list of Task types as a comma separated string.
func (JobSpec) MarshalJSON ¶
MarshalJSON returns the JSON data of the Job and its Initiators.
type NewAccount ¶
NewAccount is a jsonapi wrapper for an Ethereum account.
func (NewAccount) GetName ¶
func (a NewAccount) GetName() string
GetName returns the collection name for jsonapi.
type ServiceAgreement ¶
type ServiceAgreement struct {
models.ServiceAgreement
}
ServiceAgreement presents an API friendly version of the data.
func (ServiceAgreement) FriendlyAggregator ¶ added in v0.6.8
func (sa ServiceAgreement) FriendlyAggregator() string
FriendlyAggregator returns the ServiceAgreement's aggregator address, in a human readable format.
func (ServiceAgreement) FriendlyAggregatorFulfillMethod ¶ added in v0.6.8
func (sa ServiceAgreement) FriendlyAggregatorFulfillMethod() string
FriendlyAggregatorFulfillMethod returns the ServiceAgreement's aggregator fulfillment (orcale reporting) method's function selector, in a human readable format.
func (ServiceAgreement) FriendlyAggregatorInitMethod ¶ added in v0.6.8
func (sa ServiceAgreement) FriendlyAggregatorInitMethod() string
FriendlyAggregator returns the ServiceAgreement's aggregator initialization method's function selector, in a human readable format.
func (ServiceAgreement) FriendlyCreatedAt ¶
func (sa ServiceAgreement) FriendlyCreatedAt() string
FriendlyCreatedAt returns the ServiceAgreement's created at time in a human readable format.
func (ServiceAgreement) FriendlyExpiration ¶
func (sa ServiceAgreement) FriendlyExpiration() string
FriendlyExpiration returns the ServiceAgreement's Encumbrance expiration time in a human readable format.
func (ServiceAgreement) FriendlyPayment ¶
func (sa ServiceAgreement) FriendlyPayment() string
FriendlyPayment returns the ServiceAgreement's Encumbrance payment amount in a human readable format.
func (ServiceAgreement) MarshalJSON ¶
func (sa ServiceAgreement) MarshalJSON() ([]byte, error)
MarshalJSON presents the ServiceAgreement as public JSON data
type ServiceAgreementPresentation ¶ added in v0.6.10
type ServiceAgreementPresentation struct { ID string `json:"id"` CreatedAt string `json:"createdAt"` Encumbrance models.Encumbrance `json:"encumbrance"` EncumbranceID int64 `json:"encumbranceID"` RequestBody string `json:"requestBody"` Signature string `json:"signature"` JobSpec models.JobSpec `json:"jobSpec"` JobSpecID string `json:"jobSpecId"` }
type TaskSpec ¶
TaskSpec holds a task specified in the Job definition.
func (TaskSpec) FriendlyParams ¶
FriendlyParams returns a map of the TaskSpec's parameters.
type UserPresenter ¶
UserPresenter wraps the user record for shipping as a jsonapi response in the API.
func (UserPresenter) GetName ¶
func (u UserPresenter) GetName() string
GetName returns the collection name for jsonapi.
func (UserPresenter) MarshalJSON ¶
func (u UserPresenter) MarshalJSON() ([]byte, error)
MarshalJSON returns the User as json.