transport

package
v2.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 3 Imported by: 471

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, tr Transport) context.Context

NewContext returns a new Context that carries value.

Types

type Kind

type Kind string

Kind defines the type of Transport

const (
	KindGRPC Kind = "gRPC"
	KindHTTP Kind = "HTTP"
)

Defines a set of transport kind

type Server

type Server interface {
	Endpoint() (string, error)
	Start() error
	Stop() error
}

Server is transport server.

type Transport

type Transport struct {
	Kind Kind
}

Transport is transport context value.

func FromContext

func FromContext(ctx context.Context) (tr Transport, ok bool)

FromContext returns the Transport value stored in ctx, if any.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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