grpc

package
v0.4.22 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 26 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 ContextWithUTMFromMetadata added in v0.2.7

func ContextWithUTMFromMetadata(parentCtx context.Context, md metadata.MD) context.Context

func Dial

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

func DialContext

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

func EncodeContextWithUTMData added in v0.2.7

func EncodeContextWithUTMData(parentCtx context.Context) context.Context

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