context

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package context contains the functions for storing extra information in the gRPC context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGrpcContext

func NewGrpcContext(ctx context.Context, r GrpcInfo) context.Context

NewGrpcContext returns a new context.Context that has the provided GrpcInfo attached.

Types

type GrpcInfo

type GrpcInfo struct {
	Token     string `json:"token"`      // auth token that was provided by the gRPC client
	IPAddress string `json:"ip_address"` // ip address of the agent
}

GrpcInfo for storing identity information for the gRPC client.

func GrpcInfoFromContext

func GrpcInfoFromContext(ctx context.Context) (GrpcInfo, bool)

GrpcInfoFromContext returns the GrpcInfo saved in ctx if it exists. Returns false if there's no GrpcInfo in the context.

Jump to

Keyboard shortcuts

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