network

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(
		provideGRPCServer,
		provideMux,
		provideHTTPServer,
		provideRouter,
		provideHostAddress,
	),
	fx.Invoke(
		bindHTTPServer,
	),
)

Functions

func ErrorCode

func ErrorCode(err error) codes.Code

func GRPCCodeToHTTPStatus

func GRPCCodeToHTTPStatus(code codes.Code) int

func HTTPError

func HTTPError(err error, statusCode int) error

func HTTPHandle

func HTTPHandle(handler HttpHandlerWithError) http.Handler

Types

type ErrorWithStatusCode

type ErrorWithStatusCode interface {
	error
	StatusCode() int
}

type HostAddress

type HostAddress string

func (HostAddress) String

func (a HostAddress) String() string

type HttpHandlerWithError

type HttpHandlerWithError func(http.ResponseWriter, *http.Request) error

Jump to

Keyboard shortcuts

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