Documentation ¶
Overview ¶
Package web handles receiving and supplying information within the node.
AccountBalanceController ¶
AccountBalanceController allows for the display of the active accounts ETH and LINK balances.
API ¶
API contains logic for the web interface to display items.
BridgeTypesController ¶
BridgeTypesController allows for the creation of BridgeTypes on the node. BridgeTypes are the external adapters which add functionality not available in the core, from outside the node.
JobRunsController ¶
JobRunsController allows for the creation of JobRuns within a given Job on the node.
JobSpecsController ¶
JobSpecsController allows for the creation of specs to be added to the node, and shows the current specs which have already been added.
JobSpecErrorsController ¶
JobSpecErrorsController allows for errors to be dismissed ¶
Router ¶
Router defines the valid paths for the node and responds to requests.
Index ¶
- Constants
- Variables
- func AuthenticateBySession(store AuthStorer, c *gin.Context) error
- func AuthenticateByToken(store AuthStorer, c *gin.Context) error
- func AuthenticateExternalInitiator(store AuthStorer, c *gin.Context) error
- func BuildFMTaskDAG(js models.JobSpec) (string, pipeline.TaskDAG, error)
- func FindSessionCookie(cookies []*http.Cookie) *http.Cookie
- func GzipFileServer(root ServeFileSystem) http.Handler
- func MigrateJobSpec(c *orm.Config, js models.JobSpec) (job.Job, error)
- func NewJSONAPIResponse(resource interface{}) ([]byte, error)
- func NewPaginatedResponse(url url.URL, size, page, count int, resource interface{}) ([]byte, error)
- func NewPaginatedResponseWithMeta(url url.URL, size, page, count int, resource interface{}, ...) ([]byte, error)
- func ParseJSONAPIResponse(input []byte, resource interface{}) error
- func ParsePaginatedRequest(sizeParam, pageParam string) (int, int, int, error)
- func ParsePaginatedResponse(input []byte, resource interface{}, links *jsonapi.Links) error
- func ParsePaginatedResponseWithMeta(input []byte, resource interface{}, links *jsonapi.Links, meta *jsonapi.Meta) error
- func RequireAuth(store AuthStorer, methods ...authType) gin.HandlerFunc
- func Router(app chainlink.Application) *gin.Engine
- func ServeGzippedAssets(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc
- func StatusCodeForError(err interface{}) int
- type AuthStorer
- type BoxFileSystem
- type BridgeTypesController
- func (btc *BridgeTypesController) Create(c *gin.Context)
- func (btc *BridgeTypesController) Destroy(c *gin.Context)
- func (btc *BridgeTypesController) Index(c *gin.Context, size, page, offset int)
- func (btc *BridgeTypesController) Show(c *gin.Context)
- func (btc *BridgeTypesController) Update(c *gin.Context)
- type BulkDeletesController
- type Change
- type ConfigController
- type ConfigPatchResponse
- type CreateJobRequest
- type ETHKeysController
- type ExternalInitiatorsController
- type GenericJobSpec
- type JobRunsController
- type JobSpecErrorsController
- type JobSpecsController
- type JobsController
- type LogController
- type LogPatchRequest
- type MigrateController
- type OCRKeysController
- type P2PKeysController
- type PingController
- type PipelineRunsController
- type ServeFileSystem
- type ServiceAgreementsController
- type Session
- type SessionsController
- type TransactionsController
- type TransfersController
- type TxAttemptsController
- type UpdatePasswordRequest
- type UserController
Constants ¶
const ( // PaginationDefault is the number of records to supply from a paginated // request when no size param is supplied. PaginationDefault = 25 // MediaType is the response header for JSONAPI documents. MediaType = "application/vnd.api+json" // KeyNextLink is the name of the key that contains the HREF for the next // document in a paginated response. KeyNextLink = "next" // KeyPreviousLink is the name of the key that contains the HREF for the // previous document in a paginated response. KeyPreviousLink = "prev" )
const ( // APIKey is the header name for the API token identifier for user authentication. APIKey = "X-API-KEY" // APISecret is the header name for the API token secret for user authentication. APISecret = "X-API-SECRET" )
const ( // SessionName is the session name SessionName = "clsession" // SessionIDKey is the session ID key in the session map SessionIDKey = "clsession_id" // SessionUserKey is the User key in the session map SessionUserKey = "user" // SessionExternalInitiatorKey is the External Initiator key in the session map SessionExternalInitiatorKey = "external_initiator" )
Variables ¶
var (
ErrInvalidInitiatorType = errors.New("invalid initiator type")
)
Functions ¶
func AuthenticateBySession ¶ added in v0.8.2
func AuthenticateBySession(store AuthStorer, c *gin.Context) error
func AuthenticateByToken ¶ added in v0.8.2
func AuthenticateByToken(store AuthStorer, c *gin.Context) error
AuthenticateByToken authenticates a User by their API token.
func AuthenticateExternalInitiator ¶ added in v0.8.2
func AuthenticateExternalInitiator(store AuthStorer, c *gin.Context) error
func BuildFMTaskDAG ¶ added in v0.10.6
func FindSessionCookie ¶ added in v0.8.2
FindSessionCookie returns the cookie with the "clsession" name
func GzipFileServer ¶ added in v0.10.6
func GzipFileServer(root ServeFileSystem) http.Handler
GzipFileServer is a drop-in replacement for Go's standard http.FileServer which adds support for static resources precompressed with gzip, at the cost of removing the support for directory browsing.
func MigrateJobSpec ¶ added in v0.10.6
Does not support mixed initiator types.
func NewJSONAPIResponse ¶
NewJSONAPIResponse returns a JSONAPI response for a single resource.
func NewPaginatedResponse ¶
NewPaginatedResponse returns a jsonapi.Document with links to next and previous collection pages
func NewPaginatedResponseWithMeta ¶ added in v0.10.5
func ParseJSONAPIResponse ¶
ParseJSONAPIResponse parses the bytes of the root document and unmarshals it into the given resource.
func ParsePaginatedRequest ¶
ParsePaginatedRequest parses the parameters that control pagination for a collection request, returning the size and offset if specified, or a sensible default.
func ParsePaginatedResponse ¶
ParsePaginatedResponse parse a JSONAPI response for a document with links
func ParsePaginatedResponseWithMeta ¶ added in v0.10.5
func ParsePaginatedResponseWithMeta(input []byte, resource interface{}, links *jsonapi.Links, meta *jsonapi.Meta) error
ParsePaginatedResponse parse a JSONAPI response for a document with links
func RequireAuth ¶ added in v0.8.2
func RequireAuth(store AuthStorer, methods ...authType) gin.HandlerFunc
func Router ¶
func Router(app chainlink.Application) *gin.Engine
Router listens and responds to requests to the node for valid paths.
func ServeGzippedAssets ¶ added in v0.10.6
func ServeGzippedAssets(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc
Static returns a middleware handler that serves static files in the given directory.
func StatusCodeForError ¶
func StatusCodeForError(err interface{}) int
StatusCodeForError returns an http status code for an error type.
Types ¶
type AuthStorer ¶ added in v0.8.2
type BoxFileSystem ¶ added in v0.10.6
BoxFileSystem implements ServeFileSystem with a packr box
type BridgeTypesController ¶
type BridgeTypesController struct {
App chainlink.Application
}
BridgeTypesController manages BridgeType requests in the node.
func (*BridgeTypesController) Create ¶
func (btc *BridgeTypesController) Create(c *gin.Context)
Create adds the BridgeType to the given context.
func (*BridgeTypesController) Destroy ¶
func (btc *BridgeTypesController) Destroy(c *gin.Context)
Destroy removes a specific Bridge.
func (*BridgeTypesController) Index ¶
func (btc *BridgeTypesController) Index(c *gin.Context, size, page, offset int)
Index lists Bridges, one page at a time.
func (*BridgeTypesController) Show ¶
func (btc *BridgeTypesController) Show(c *gin.Context)
Show returns the details of a specific Bridge.
func (*BridgeTypesController) Update ¶
func (btc *BridgeTypesController) Update(c *gin.Context)
Update can change the restricted attributes for a bridge
type BulkDeletesController ¶
type BulkDeletesController struct {
App chainlink.Application
}
BulkDeletesController manages background tasks that delete resources given a query
func (*BulkDeletesController) Delete ¶
func (bdc *BulkDeletesController) Delete(c *gin.Context)
Delete removes all runs given a query Example:
"<application>/bulk_delete_runs"
type Change ¶ added in v0.6.6
Change represents the old value and the new value after a PATH request has been made
type ConfigController ¶
type ConfigController struct {
App chainlink.Application
}
ConfigController manages config variables
func (*ConfigController) Patch ¶ added in v0.6.6
func (cc *ConfigController) Patch(c *gin.Context)
Patch updates one or more configuration options
func (*ConfigController) Show ¶
func (cc *ConfigController) Show(c *gin.Context)
Show returns the whitelist of config variables Example:
"<application>/config"
type ConfigPatchResponse ¶ added in v0.6.6
type ConfigPatchResponse struct {
EthGasPriceDefault Change `json:"ethGasPriceDefault"`
}
ConfigPatchResponse represents the change to the configuration made due to a PATCH to the config endpoint
func (ConfigPatchResponse) GetID ¶ added in v0.6.6
func (c ConfigPatchResponse) GetID() string
GetID returns the jsonapi ID.
func (*ConfigPatchResponse) SetID ¶ added in v0.6.6
func (*ConfigPatchResponse) SetID(string) error
SetID is used to conform to the UnmarshallIdentifier interface for deserializing from jsonapi documents.
type CreateJobRequest ¶ added in v0.10.6
type CreateJobRequest struct {
TOML string `json:"toml"`
}
CreateJobRequest represents a request to create and start a job (V2).
type ETHKeysController ¶ added in v0.9.9
type ETHKeysController struct {
App chainlink.Application
}
KeysController manages account keys
func (*ETHKeysController) Create ¶ added in v0.9.9
func (ekc *ETHKeysController) Create(c *gin.Context)
Create adds a new account Example:
"<application>/keys/eth"
func (*ETHKeysController) Delete ¶ added in v0.9.9
func (ekc *ETHKeysController) Delete(c *gin.Context)
Delete an ETH key bundle Example: "DELETE <application>/keys/eth/:keyID" "DELETE <application>/keys/eth/:keyID?hard=true"
func (*ETHKeysController) Export ¶ added in v0.9.9
func (ekc *ETHKeysController) Export(c *gin.Context)
func (*ETHKeysController) Import ¶ added in v0.9.9
func (ekc *ETHKeysController) Import(c *gin.Context)
func (*ETHKeysController) Index ¶ added in v0.9.9
func (ekc *ETHKeysController) Index(c *gin.Context)
Index returns the node's Ethereum keys and the account balances of ETH & LINK. Example:
"<application>/keys/eth"
type ExternalInitiatorsController ¶
type ExternalInitiatorsController struct {
App chainlink.Application
}
ExternalInitiatorsController manages external initiators
func (*ExternalInitiatorsController) Create ¶
func (eic *ExternalInitiatorsController) Create(c *gin.Context)
Create builds and saves a new service agreement record.
func (*ExternalInitiatorsController) Destroy ¶
func (eic *ExternalInitiatorsController) Destroy(c *gin.Context)
Destroy deletes an ExternalInitiator
type GenericJobSpec ¶ added in v0.9.7
type JobRunsController ¶
type JobRunsController struct {
App chainlink.Application
}
JobRunsController manages JobRun requests in the node.
func (*JobRunsController) Cancel ¶ added in v0.8.2
func (jrc *JobRunsController) Cancel(c *gin.Context)
Cancel stops a Run from continuing. Example:
"<application>/runs/:RunID/cancellation"
func (*JobRunsController) Create ¶
func (jrc *JobRunsController) Create(c *gin.Context)
Create starts a new Run for the requested JobSpec. Example:
"<application>/specs/:SpecID/runs"
func (*JobRunsController) Index ¶
func (jrc *JobRunsController) Index(c *gin.Context, size, page, offset int)
Index returns paginated JobRuns for a given JobSpec Example:
"<application>/runs?jobSpecId=:jobSpecId&size=1&page=2"
func (*JobRunsController) Show ¶
func (jrc *JobRunsController) Show(c *gin.Context)
Show returns the details of a JobRun. Example:
"<application>/runs/:RunID"
func (*JobRunsController) Update ¶
func (jrc *JobRunsController) Update(c *gin.Context)
Update allows external adapters to resume a JobRun, reporting the result of the task and marking it no longer pending. Example:
"<application>/runs/:RunID"
type JobSpecErrorsController ¶ added in v0.8.9
type JobSpecErrorsController struct {
App chainlink.Application
}
JobSpecErrorsController manages JobSpecError requests
func (*JobSpecErrorsController) Destroy ¶ added in v0.8.9
func (jsec *JobSpecErrorsController) Destroy(c *gin.Context)
Destroy deletes a JobSpecError record from the database, effectively silencing the error notification
type JobSpecsController ¶
type JobSpecsController struct {
App chainlink.Application
}
JobSpecsController manages JobSpec requests.
func (*JobSpecsController) Create ¶
func (jsc *JobSpecsController) Create(c *gin.Context)
Create adds validates, saves, and starts a new JobSpec. Example:
"<application>/specs"
func (*JobSpecsController) Destroy ¶
func (jsc *JobSpecsController) Destroy(c *gin.Context)
Destroy soft deletes a job spec. Example:
"<application>/specs/:SpecID"
func (*JobSpecsController) Index ¶
func (jsc *JobSpecsController) Index(c *gin.Context, size, page, offset int)
Index lists JobSpecs, one page at a time. Example:
"<application>/specs?size=1&page=2"
func (*JobSpecsController) Show ¶
func (jsc *JobSpecsController) Show(c *gin.Context)
Show returns the details of a JobSpec. Example:
"<application>/specs/:SpecID"
type JobsController ¶ added in v0.9.7
type JobsController struct {
App chainlink.Application
}
JobsController manages jobs
func (*JobsController) Create ¶ added in v0.9.7
func (jc *JobsController) Create(c *gin.Context)
Create validates, saves and starts a new job. Example: "POST <application>/jobs"
func (*JobsController) Delete ¶ added in v0.9.7
func (jc *JobsController) Delete(c *gin.Context)
Delete soft deletes a job spec. Example: "DELETE <application>/specs/:ID"
func (*JobsController) Index ¶ added in v0.9.7
func (jc *JobsController) Index(c *gin.Context)
Index lists all jobs Example: "GET <application>/jobs"
func (*JobsController) Show ¶ added in v0.9.7
func (jc *JobsController) Show(c *gin.Context)
Show returns the details of a job Example: "GET <application>/jobs/:ID"
type LogController ¶ added in v0.10.4
type LogController struct {
App chainlink.Application
}
LogController manages the logger config
func (*LogController) Get ¶ added in v0.10.4
func (cc *LogController) Get(c *gin.Context)
Get retrieves the current log config settings
func (*LogController) Patch ¶ added in v0.10.4
func (cc *LogController) Patch(c *gin.Context)
Patch sets a log level and enables sql logging for the logger
type LogPatchRequest ¶ added in v0.10.4
type MigrateController ¶ added in v0.10.6
type MigrateController struct {
App chainlink.Application
}
func (*MigrateController) Migrate ¶ added in v0.10.6
func (mc *MigrateController) Migrate(c *gin.Context)
Creates a v2 job from a v1 job ID. Example:
"POST <application>/migrate/123e4567-e89b-12d3-a456-426614174000"
Where "123e4567-e89b-12d3-a456-426614174000" is a v1 job ID.
type OCRKeysController ¶ added in v0.9.9
type OCRKeysController struct {
App chainlink.Application
}
OCRKeysController manages OCR key bundles
func (*OCRKeysController) Create ¶ added in v0.9.9
func (ocrkc *OCRKeysController) Create(c *gin.Context)
Create and return an OCR key bundle Example: "POST <application>/keys/ocr"
func (*OCRKeysController) Delete ¶ added in v0.9.9
func (ocrkc *OCRKeysController) Delete(c *gin.Context)
Delete an OCR key bundle Example: "DELETE <application>/keys/ocr/:keyID" "DELETE <application>/keys/ocr/:keyID?hard=true"
func (*OCRKeysController) Export ¶ added in v0.9.9
func (ocrkc *OCRKeysController) Export(c *gin.Context)
Export exports an OCR key bundle Example: "Post <application>/keys/ocr/export"
func (*OCRKeysController) Import ¶ added in v0.9.9
func (ocrkc *OCRKeysController) Import(c *gin.Context)
Import imports an OCR key bundle Example: "Post <application>/keys/ocr/import"
func (*OCRKeysController) Index ¶ added in v0.9.9
func (ocrkc *OCRKeysController) Index(c *gin.Context)
Index lists OCR key bundles Example: "GET <application>/keys/ocr"
type P2PKeysController ¶ added in v0.9.3
type P2PKeysController struct {
App chainlink.Application
}
P2PKeysController manages P2P keys
func (*P2PKeysController) Create ¶ added in v0.9.3
func (p2pkc *P2PKeysController) Create(c *gin.Context)
Create and return a P2P key Example: "POST <application>/keys/p2p"
func (*P2PKeysController) Delete ¶ added in v0.9.3
func (p2pkc *P2PKeysController) Delete(c *gin.Context)
Delete a P2P key Example: "DELETE <application>/keys/p2p/:keyID" "DELETE <application>/keys/p2p/:keyID?hard=true"
func (*P2PKeysController) Export ¶ added in v0.9.9
func (p2pkc *P2PKeysController) Export(c *gin.Context)
Export exports a P2P key Example: "Post <application>/keys/p2p/export"
func (*P2PKeysController) Import ¶ added in v0.9.9
func (p2pkc *P2PKeysController) Import(c *gin.Context)
Import imports a P2P key Example: "Post <application>/keys/p2p/import"
func (*P2PKeysController) Index ¶ added in v0.9.3
func (p2pkc *P2PKeysController) Index(c *gin.Context)
Index lists P2P keys Example: "GET <application>/keys/p2p"
type PingController ¶ added in v0.6.6
type PingController struct {
App chainlink.Application
}
PingController has the ping endpoint.
func (*PingController) Show ¶ added in v0.6.6
func (eic *PingController) Show(c *gin.Context)
Show returns pong.
type PipelineRunsController ¶ added in v0.9.7
type PipelineRunsController struct {
App chainlink.Application
}
PipelineRunsController manages V2 job run requests.
func (*PipelineRunsController) Create ¶ added in v0.9.7
func (prc *PipelineRunsController) Create(c *gin.Context)
Create triggers a pipeline run for a job. Example: "POST <application>/jobs/:ID/runs"
func (*PipelineRunsController) Index ¶ added in v0.9.7
func (prc *PipelineRunsController) Index(c *gin.Context, size, page, offset int)
Index returns all pipeline runs for a job. Example: "GET <application>/jobs/:ID/runs"
func (*PipelineRunsController) Show ¶ added in v0.9.7
func (prc *PipelineRunsController) Show(c *gin.Context)
Show returns a specified pipeline run. Example: "GET <application>/jobs/:ID/runs/:runID"
type ServeFileSystem ¶ added in v0.10.6
type ServeFileSystem interface { http.FileSystem Exists(prefix string, path string) bool }
ServeFileSystem wraps a http.FileSystem with an additional file existence check
type ServiceAgreementsController ¶
type ServiceAgreementsController struct {
App chainlink.Application
}
ServiceAgreementsController manages service agreements.
func (*ServiceAgreementsController) Create ¶
func (sac *ServiceAgreementsController) Create(c *gin.Context)
Create builds and saves a new service agreement record.
func (*ServiceAgreementsController) Show ¶
func (sac *ServiceAgreementsController) Show(c *gin.Context)
Show returns the details of a ServiceAgreement. Example:
"<application>/service_agreements/:SAID"
type Session ¶
type Session struct {
Authenticated bool `json:"authenticated"`
}
type SessionsController ¶
type SessionsController struct {
App chainlink.Application
}
SessionsController manages session requests.
func (*SessionsController) Create ¶
func (sc *SessionsController) Create(c *gin.Context)
Create creates a session ID for the given user credentials, and returns it in a cookie.
func (*SessionsController) Destroy ¶
func (sc *SessionsController) Destroy(c *gin.Context)
Destroy erases the session ID for the sole API user.
type TransactionsController ¶
type TransactionsController struct {
App chainlink.Application
}
TransactionsController displays Ethereum transactions requests.
func (*TransactionsController) Index ¶
func (tc *TransactionsController) Index(c *gin.Context, size, page, offset int)
Index returns paginated transactions
func (*TransactionsController) Show ¶
func (tc *TransactionsController) Show(c *gin.Context)
Show returns the details of a Ethereum Transasction details. Example:
"<application>/transactions/:TxHash"
type TransfersController ¶
type TransfersController struct {
App chainlink.Application
}
TransfersController can send LINK tokens to another address
func (*TransfersController) Create ¶
func (tc *TransfersController) Create(c *gin.Context)
Create sends ETH from the Chainlink's account to a specified address.
Example: "<application>/withdrawals"
type TxAttemptsController ¶
type TxAttemptsController struct {
App chainlink.Application
}
TxAttemptsController lists TxAttempts requests.
type UpdatePasswordRequest ¶ added in v0.10.5
type UpdatePasswordRequest struct { OldPassword string `json:"oldPassword"` NewPassword string `json:"newPassword"` }
UpdatePasswordRequest defines the request to set a new password for the current session's User.
type UserController ¶
type UserController struct {
App chainlink.Application
}
UserController manages the current Session's User User.
func (*UserController) DeleteAPIToken ¶ added in v0.8.2
func (c *UserController) DeleteAPIToken(ctx *gin.Context)
DeleteAPIToken deletes and disables a user's API token.
func (*UserController) NewAPIToken ¶ added in v0.8.2
func (c *UserController) NewAPIToken(ctx *gin.Context)
NewAPIToken generates a new API token for a user overwriting any pre-existing one set.
func (*UserController) UpdatePassword ¶
func (c *UserController) UpdatePassword(ctx *gin.Context)
UpdatePassword changes the password for the current User.
Source Files ¶
- api.go
- authentication.go
- bridge_types_controller.go
- bulk_deletes_controller.go
- config_controller.go
- cookies.go
- doc.go
- eth_keys_controller.go
- external_initiators_controller.go
- helpers.go
- job_runs_controller.go
- job_spec_errors_controller.go
- job_specs_controller.go
- jobs_controller.go
- log_controller.go
- middleware.go
- migrate_controller.go
- ocr_keys_controller.go
- p2p_keys_controller.go
- ping_controller.go
- pipeline_runs_controller.go
- router.go
- service_agreements_controller.go
- sessions_controller.go
- transactions_controller.go
- transfer_controller.go
- tx_attempts_controller.go
- user_controller.go