utils

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAttributeHeaderPrefix = "X-Attribute-"
)

Variables

This section is empty.

Functions

func BackwardTransformIfSystem

func BackwardTransformIfSystem(key string) string

func GetContextFromRequest added in v0.28.0

func GetContextFromRequest(c *fasthttp.RequestCtx) context.Context

GetContextFromRequest returns main context from fasthttp request context.

func PrepareExpirationHeader

func PrepareExpirationHeader(ctx context.Context, epochFetcher EpochInfoFetcher, headers map[string]string, now time.Time) error

func SetContextToRequest added in v0.28.0

func SetContextToRequest(ctx context.Context, c *fasthttp.RequestCtx)

SetContextToRequest adds new context to fasthttp request.

func SetHTTPTraceInfo added in v0.28.0

func SetHTTPTraceInfo(ctx context.Context, span trace.Span, req *fasthttp.RequestCtx)

SetHTTPTraceInfo saves trace headers to response.

func StartHTTPServerSpan added in v0.28.0

func StartHTTPServerSpan(ctx context.Context, req *fasthttp.RequestCtx, operationName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

StartHTTPServerSpan starts root HTTP server span.

func TransformIfSystem

func TransformIfSystem(key []byte) []byte

Types

type EpochDurations

type EpochDurations struct {
	CurrentEpoch  uint64
	MsPerBlock    int64
	BlockPerEpoch uint64
}

type EpochInfoFetcher added in v0.30.0

type EpochInfoFetcher interface {
	GetEpochDurations(context.Context) (*EpochDurations, error)
}

Jump to

Keyboard shortcuts

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