gateway

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadRequestError = Response{
	Success: false,
	Code:    "400",
	Message: "Bad Request",
	Data:    nil,
}
View Source
var InternalError = Response{
	Success: false,
	Code:    "500",
	Message: "Internal Error",
	Data:    nil,
}
View Source
var NotFoundError = Response{
	Success: false,
	Code:    "404",
	Message: "Not Found",
	Data:    nil,
}

Functions

func HandleCaptureMetadata

func HandleCaptureMetadata(h http.Handler) http.HandlerFunc

func HandleForwardMetadataResponse

func HandleForwardMetadataResponse(ctx context.Context, w http.ResponseWriter, _ proto.Message) error

func NewGrpcErrorHandler

func NewGrpcErrorHandler(debugErr bool) runtime.ErrorHandlerFunc

func RegisterEndpoints

func RegisterEndpoints(ctx context.Context, gw *runtime.ServeMux, endpoints []GrpcEndpoint) error

Types

type EndpointRegisterHandlerFunc

type EndpointRegisterHandlerFunc = func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

type ErrorData

type ErrorData struct {
	Debug *ErrorDebugData `json:"debug,omitempty"`
}

type ErrorDebugData

type ErrorDebugData struct {
	Message  string            `json:"message"`
	Traces   []string          `json:"traces"`
	Metadata map[string]string `json:"metadata"`
}

type GrpcEndpoint

type GrpcEndpoint struct {
	Name            string
	RegisterHandler EndpointRegisterHandlerFunc
	Hostname        string
	Insecure        bool
	SSLCertificate  string
}

type Response

type Response struct {
	Success bool   `json:"success"`
	Code    string `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

Jump to

Keyboard shortcuts

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