Documentation

Overview

Package client contains generic representations of clients connecting to different receivers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

Types

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

Source Files