Documentation ¶
Overview ¶
Package rpc provides RPC functionality.
Index ¶
- func GetIncomingHeader(ctx context.Context, key string) string
- func GetIncomingHeaders(ctx context.Context) map[string]string
- func GetOutgoingHeader(ctx context.Context, key string) string
- func GetOutgoingHeaders(ctx context.Context) map[string]string
- func WithIncomingHeader(ctx context.Context, key string, value string) context.Context
- func WithIncomingHeaders(ctx context.Context, headers map[string]string) context.Context
- func WithOutgoingHeader(ctx context.Context, key string, value string) context.Context
- func WithOutgoingHeaders(ctx context.Context, headers map[string]string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIncomingHeader ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.