utils

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-3.0 Imports: 21 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, p *pool.Pool, 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 AppParams

type AppParams struct {
	Logger   *zap.Logger
	Pool     *pool.Pool
	Owner    *user.ID
	Resolver *resolver.ContainerResolver
	Cache    *cache.BucketCache
}

type EpochDurations

type EpochDurations struct {
	CurrentEpoch  uint64
	MsPerBlock    int64
	BlockPerEpoch uint64
}

func GetEpochDurations

func GetEpochDurations(ctx context.Context, p *pool.Pool) (*EpochDurations, error)

Jump to

Keyboard shortcuts

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