Documentation ¶
Index ¶
- type ORM
- func (orm *ORM) AddAttempt(tx *models.Tx, etx *types.Transaction, blkNum uint64) (*models.TxAttempt, error)
- func (orm *ORM) AnyJobWithType(taskTypeName string) (bool, error)
- func (orm *ORM) AttemptsFor(id uint64) ([]models.TxAttempt, error)
- func (orm *ORM) AuthorizedUserWithSession(sessionID string, sessionDuration time.Duration) (models.User, error)
- func (orm *ORM) ConfirmTx(tx *models.Tx, txat *models.TxAttempt) error
- func (orm *ORM) CreateSession(sr models.SessionRequest) (string, error)
- func (orm *ORM) CreateTx(from common.Address, nonce uint64, to common.Address, data []byte, ...) (*models.Tx, error)
- func (orm *ORM) DeleteUser() (models.User, error)
- func (orm *ORM) DeleteUserSession(sessionID string) error
- func (orm *ORM) FindBridge(name string) (models.BridgeType, error)
- func (orm *ORM) FindJob(id string) (models.JobSpec, error)
- func (orm *ORM) FindJobRun(id string) (models.JobRun, error)
- func (orm *ORM) FindServiceAgreement(id string) (models.ServiceAgreement, error)
- func (orm *ORM) FindUser() (models.User, error)
- func (orm *ORM) GetBolt() *bolt.DB
- func (orm *ORM) GetLastNonce(address common.Address) (uint64, error)
- func (orm *ORM) InitBucket(model interface{}) error
- func (orm *ORM) InitializeModel(klass interface{}) error
- func (orm *ORM) JobRunsCountFor(jobID string) (int, error)
- func (orm *ORM) JobRunsFor(jobID string) ([]models.JobRun, error)
- func (orm *ORM) JobRunsWithStatus(statuses ...models.RunStatus) ([]models.JobRun, error)
- func (orm *ORM) Jobs() ([]models.JobSpec, error)
- func (orm *ORM) MarkRan(i *models.Initiator) error
- func (orm *ORM) PendingBridgeType(jr models.JobRun) (models.BridgeType, error)
- func (orm *ORM) SaveCreationHeight(jr models.JobRun, bn *models.IndexableBlockNumber) (models.JobRun, error)
- func (orm *ORM) SaveJob(job *models.JobSpec) error
- func (orm *ORM) SaveServiceAgreement(sa *models.ServiceAgreement) error
- func (orm *ORM) Where(field string, value interface{}, instance interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ORM ¶
ORM contains the database object used by Chainlink.
func (*ORM) AddAttempt ¶
func (orm *ORM) AddAttempt( tx *models.Tx, etx *types.Transaction, blkNum uint64, ) (*models.TxAttempt, error)
AddAttempt creates a new transaction attempt and stores it in the database.
func (*ORM) AnyJobWithType ¶
AnyJobWithType returns true if there is at least one job associated with the type name specified and false otherwise
func (*ORM) AttemptsFor ¶
AttemptsFor returns the Transaction Attempts (TxAttempt) for a given Transaction ID (TxID).
func (*ORM) AuthorizedUserWithSession ¶
func (orm *ORM) AuthorizedUserWithSession(sessionID string, sessionDuration time.Duration) (models.User, error)
AuthorizedUserWithSession will return the one API user if the Session ID exists and hasn't expired, and update session's LastUsed field.
func (*ORM) ConfirmTx ¶
ConfirmTx updates the database for the given transaction to show that the transaction has been confirmed on the blockchain.
func (*ORM) CreateSession ¶
func (orm *ORM) CreateSession(sr models.SessionRequest) (string, error)
CreateSession will check the password in the SessionRequest against the hashed API User password in the db.
func (*ORM) CreateTx ¶
func (orm *ORM) CreateTx( from common.Address, nonce uint64, to common.Address, data []byte, value *big.Int, gasLimit uint64, ) (*models.Tx, error)
CreateTx saves the properties of an Ethereum transaction to the database.
func (*ORM) DeleteUser ¶
DeleteUser will delete the API User in the db.
func (*ORM) DeleteUserSession ¶
DeleteUserSession will erase the session ID for the sole API User.
func (*ORM) FindBridge ¶
func (orm *ORM) FindBridge(name string) (models.BridgeType, error)
FindBridge looks up a Bridge by its Name.
func (*ORM) FindJobRun ¶
FindJobRun looks up a JobRun by its ID.
func (*ORM) FindServiceAgreement ¶
func (orm *ORM) FindServiceAgreement(id string) (models.ServiceAgreement, error)
FindServiceAgreement looks up a ServiceAgreement by its ID.
func (*ORM) GetLastNonce ¶
GetLastNonce retrieves the last known nonce in the database for an account
func (*ORM) InitBucket ¶
InitBucket initializes buckets and indexes before saving an object.
func (*ORM) InitializeModel ¶
InitializeModel uses reflection on the passed klass to generate a bucket of the same type name.
func (*ORM) JobRunsCountFor ¶
JobRunsCountFor returns the current number of runs for the job
func (*ORM) JobRunsFor ¶
JobRunsFor fetches all JobRuns with a given Job ID, sorted by their created at time.
func (*ORM) JobRunsWithStatus ¶
JobRunsWithStatus returns the JobRuns which have the passed statuses.
func (*ORM) PendingBridgeType ¶
PendingBridgeType returns the bridge type of the current pending task, or error if not pending bridge.
func (*ORM) SaveCreationHeight ¶
func (orm *ORM) SaveCreationHeight(jr models.JobRun, bn *models.IndexableBlockNumber) (models.JobRun, error)
SaveCreationHeight stores the JobRun in the database with the given block number.
func (*ORM) SaveServiceAgreement ¶
func (orm *ORM) SaveServiceAgreement(sa *models.ServiceAgreement) error
SaveServiceAgreement saves a service agreement and it's associations to the database.