sctx

package
v1.17.6-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: BSD-3-Clause Imports: 3 Imported by: 8

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 added in v0.5.3

func GetGasLimit(ctx context.Context) uint64

func GetGasLimitWithDefault added in v1.9.0

func GetGasLimitWithDefault(ctx context.Context, defaultLimit uint64) uint64

func GetGasPrice added in v0.5.3

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

func GetHost

func GetHost(ctx context.Context) string

GetHost gets the request host from the context

func SetGasLimit added in v0.5.3

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

func SetGasPrice added in v0.5.3

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

Types

type HTTPRequestIDKey

type HTTPRequestIDKey struct{}

Jump to

Keyboard shortcuts

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