Documentation ¶
Index ¶
Constants ¶
View Source
const ( FeedIDs = "feedIDs" // valid for v0.3 FeedIdHex = "feedIdHex" // valid for v0.2 BlockNumber = "blockNumber" // valid for v0.2 Timestamp = "timestamp" // valid for v0.3 )
Variables ¶
View Source
var CalculateRetryConfigFn = func(prk string, mercuryConfig MercuryConfigProvider) time.Duration { var retryInterval time.Duration var retries int totalAttempts, ok := mercuryConfig.GetPluginRetry(prk) if ok { retries = totalAttempts.(int) if retries < totalFastPluginRetries { retryInterval = 1 * time.Second } else if retries < totalMediumPluginRetries { retryInterval = 5 * time.Second } } else { retryInterval = 1 * time.Second } mercuryConfig.SetPluginRetry(prk, retries+1, cache.DefaultExpiration) return retryInterval }
CalculateRetryConfig returns plugin retry interval based on how many times plugin has retried this work
View Source
var GenerateHMACFn = func(method string, path string, body []byte, clientId string, secret string, ts int64) string { bodyHash := sha256.New() bodyHash.Write(body) hashString := fmt.Sprintf("%s %s %s %s %d", method, path, hex.EncodeToString(bodyHash.Sum(nil)), clientId, ts) signedMessage := hmac.New(sha256.New, []byte(secret)) signedMessage.Write([]byte(hashString)) userHmac := hex.EncodeToString(signedMessage.Sum(nil)) return userHmac }
Functions ¶
func NewAbiPacker ¶ added in v2.9.0
func NewAbiPacker() *abiPacker
Types ¶
type MercuryClient ¶
type MercuryClient interface {
DoRequest(ctx context.Context, streamsLookup *StreamsLookup, pluginRetryKey string) (encoding.PipelineExecutionState, encoding.UpkeepFailureReason, [][]byte, bool, time.Duration, error)
}
type MercuryConfigProvider ¶
type MercuryData ¶
type Packer ¶
type Packer interface { UnpackCheckCallbackResult(callbackResp []byte) (encoding.PipelineExecutionState, bool, []byte, encoding.UpkeepFailureReason, *big.Int, error) PackGetUpkeepPrivilegeConfig(upkeepId *big.Int) ([]byte, error) UnpackGetUpkeepPrivilegeConfig(resp []byte) ([]byte, error) DecodeStreamsLookupRequest(data []byte) (*StreamsLookupError, error) }
type StreamsLookup ¶
type StreamsLookup struct { *StreamsLookupError UpkeepId *big.Int Block uint64 }
func (*StreamsLookup) IsMercuryV02 ¶
func (l *StreamsLookup) IsMercuryV02() bool
func (*StreamsLookup) IsMercuryV03 ¶
func (l *StreamsLookup) IsMercuryV03() bool
func (*StreamsLookup) IsMercuryV03UsingBlockNumber ¶ added in v2.9.0
func (l *StreamsLookup) IsMercuryV03UsingBlockNumber() bool
IsMercuryV03UsingBlockNumber is used to distinguish the batch path. It is used for Mercury V03 only
Click to show internal directories.
Click to hide internal directories.