Documentation ¶
Index ¶
- Variables
- func BlockHeightFromContext(ctx context.Context) (int64, error)
- func RemoteIPAddrFromContext(ctx context.Context) (string, bool)
- func TraceIDFromContext(ctx context.Context) (context.Context, string)
- func WithBlockHeight(ctx context.Context, h int64) context.Context
- func WithRemoteIPAddr(ctx context.Context, addr string) context.Context
- func WithTraceID(ctx context.Context, tID string) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrBlockHeightMissing = errors.New("no or invalid block height set on context")
)
Functions ¶
func RemoteIPAddrFromContext ¶
RemoteIPAddrFromContext returns the remote IP addr value stored in ctx, if any.
func TraceIDFromContext ¶
TraceIDFromContext get traceID from context (add one if none is set).
func WithRemoteIPAddr ¶
WithRemoteIPAddr wrap the context into a new context and embed the ip addr as a key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.