gateway

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gateway provides implementations to send data through the transport (e.g. headers).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopTransport

type NoopTransport struct {
}

NoopTransport defines a no-op transport.

func NewNoopTransport

func NewNoopTransport() *NoopTransport

func (*NoopTransport) SetHeader

func (n *NoopTransport) SetHeader(_ context.Context, key, value string)

type RPCTransport

type RPCTransport struct {
	// contains filtered or unexported fields
}

RPCTransport defines a transport for gRPC.

func NewRPCTransport

func NewRPCTransport(l logger.Logger) *RPCTransport

NewRPCTransport returns a transport for gRPC.

func (*RPCTransport) SetHeader

func (g *RPCTransport) SetHeader(ctx context.Context, key, value string)

SetHeader tries to set a header. If an error occurred, it logs an error.

type Transport

type Transport interface {
	// SetHeader sets a response header with a key and a value.
	// It should not be called after a response has been sent.
	SetHeader(ctx context.Context, key, value string)
}

Transport is the interface to work with the transport layer.

Jump to

Keyboard shortcuts

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