server

package
v0.0.0-...-a1d8bd3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIdHeaderName = "x-request-id"

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcConnection

type GrpcConnection struct {
	Host         string
	Port         string
	Secure       bool
	GrpcHandlers []func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error
	HttpHandlers map[string]http.Handler
}

func (*GrpcConnection) Address

func (i *GrpcConnection) Address() string

type GrpcServer

type GrpcServer struct {
	Host             string
	Port             string
	RegisterServices func(server *grpc.Server)
	PreRequest       func(ctx context.Context, req any, info *grpc.UnaryServerInfo) (err error)
	PostRequest      func(ctx context.Context, req any, info *grpc.UnaryServerInfo) (err error)
}

func (*GrpcServer) Address

func (s *GrpcServer) Address() string

func (*GrpcServer) Run

func (s *GrpcServer) Run()

type Health

type Health struct {
	Status     string `json:"status"`
	Connection string `json:"connection"`
}

type HttpGateway

type HttpGateway struct {
	Host            string
	Port            string
	GrpcConnections map[string]GrpcConnection
	HttpHandlers    map[string]http.Handler
}

func (*HttpGateway) Address

func (g *HttpGateway) Address() string

func (*HttpGateway) Run

func (g *HttpGateway) Run(ctx context.Context)

Run starts a HTTP gateway that serves the gRPC server

Jump to

Keyboard shortcuts

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