rpc

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rpc provides RPC functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIncomingHeader

func GetIncomingHeader(ctx context.Context, key string) string

GetIncomingHeader gets the given header key.

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If the key is unset, this returns the empty string.

func GetIncomingHeaders

func GetIncomingHeaders(ctx context.Context) map[string]string

GetIncomingHeaders gets the headers..

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If there are no headers, returns an empty map.

func GetOutgoingHeader

func GetOutgoingHeader(ctx context.Context, key string) string

GetOutgoingHeader gets the given header key.

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If the key is unset, this returns the empty string.

func GetOutgoingHeaders

func GetOutgoingHeaders(ctx context.Context) map[string]string

GetOutgoingHeaders gets the headers..

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If there are no headers, returns an empty map.

func WithIncomingHeader

func WithIncomingHeader(ctx context.Context, key string, value string) context.Context

WithIncomingHeader adds the given header to the context.

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If the key or value is empty, this is a no-op. If the key was already set, this will overwrite the value for the key.

func WithIncomingHeaders

func WithIncomingHeaders(ctx context.Context, headers map[string]string) context.Context

WithIncomingHeaders adds the given headers to the context.

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If headers is empty or nil, this is a no-op. If a key or value is empty, this is a no-op for that key. If a key was already set, this will overwrite the value for the key.

func WithOutgoingHeader

func WithOutgoingHeader(ctx context.Context, key string, value string) context.Context

WithOutgoingHeader adds the given header to the context.

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If the key or value is empty, this is a no-op. If the key was already set, this will overwrite the value for the key.

func WithOutgoingHeaders

func WithOutgoingHeaders(ctx context.Context, headers map[string]string) context.Context

WithOutgoingHeaders adds the given headers to the context.

Headers are simple key/value with no differentiation between unset and nil. This is as opposed to i.e. grpc that does key/slice value with differentiation between unset and nil. Headers are case-insensitive.

If headers is empty or nil, this is a no-op. If a key or value is empty, this is a no-op for that key. If a key was already set, this will overwrite the value for the key.

Types

This section is empty.

Directories

Path Synopsis
Package rpcheader is a helper package.
Package rpcheader is a helper package.

Jump to

Keyboard shortcuts

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