Back to godoc.org
go.opentelemetry.io/collector/client

package client

v0.4.0
Latest Go to latest
Published: Jun 16, 2020 | License: Apache-2.0 | Module: go.opentelemetry.io/collector

Overview

Package client contains generic representations of clients connecting to different receivers

Index

func NewContext

func NewContext(ctx context.Context, c *Client) context.Context

NewContext takes an existing context and derives a new context with the client value stored on it

type Client

type Client struct {
	IP string
}

Client represents a generic client that sends data to any receiver supported by the OT receiver

func FromContext

func FromContext(ctx context.Context) (*Client, bool)

FromContext takes a context and returns a Client value from it, if present.

func FromGRPC

func FromGRPC(ctx context.Context) (*Client, bool)

FromGRPC takes a GRPC context and tries to extract client information from it

func FromHTTP

func FromHTTP(r *http.Request) (*Client, bool)

FromHTTP takes a net/http Request object and tries to extract client information from it

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier