sctx

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sctx provides convenience methods for context value injection and extraction.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTargetPrefix is returned when target prefix decoding fails.
	ErrTargetPrefix = errors.New("error decoding prefix string")
)

Functions

func GetGasLimit

func GetGasLimit(ctx context.Context) uint64

func GetGasPrice

func GetGasPrice(ctx context.Context) *big.Int

func GetHost

func GetHost(ctx context.Context) string

GetHost gets the request host from the context

func GetOracle added in v1.2.3

func GetOracle(ctx context.Context) ([]boson.Address, error)

GetTargets returns the specific target pinners for a corresponding chunk by reading the prefix targets sent in the download API.

func GetRootHash

func GetRootHash(ctx context.Context) boson.Address

func GetRootLen

func GetRootLen(ctx context.Context) int64

func GetTargets

func GetTargets(ctx context.Context) ([]boson.Address, error)

GetTargets returns the specific target pinners for a corresponding chunk by reading the prefix targets sent in the download API.

func SetGasLimit

func SetGasLimit(ctx context.Context, limit uint64) context.Context

func SetGasPrice

func SetGasPrice(ctx context.Context, price *big.Int) context.Context

func SetHost

func SetHost(ctx context.Context, domain string) context.Context

SetHost sets the http request host in the context

func SetOracle added in v1.2.3

func SetOracle(ctx context.Context, targets string) context.Context

func SetRootHash

func SetRootHash(ctx context.Context, rootHash boson.Address) context.Context

func SetRootLen

func SetRootLen(ctx context.Context, len int64) context.Context

func SetTargets

func SetTargets(ctx context.Context, targets string) context.Context

SetTargets set the target string in the context to be used downstream in netstore

Types

type HTTPRequestIDKey

type HTTPRequestIDKey struct{}

Jump to

Keyboard shortcuts

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