client

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

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

Jump to

Keyboard shortcuts

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