grpc

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 19 Imported by: 0

README

GRPC server

Environment based configuration

  • ADDR

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InternalServerError = errors.New("internal server error")

Functions

func Dial

func Dial(addr string) (*grpc.ClientConn, error)

func DialContext

func DialContext(ctx context.Context, addr string) (*grpc.ClientConn, error)

func ListenAndServe

func ListenAndServe(gs *grpc.Server) error

func Listener

func Listener() (net.Listener, error)

func Server

func Server(ab AuthBackend) *grpc.Server

Types

type AuthBackend

type AuthBackend interface {
	AuthorizeStream(ctx context.Context) (context.Context, error)
	AuthorizeUnary(ctx context.Context) (context.Context, error)
}

type Config

type Config struct {
	Address string `env:"GRPC_ADDR" envDefault:":3001"`
}

Jump to

Keyboard shortcuts

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