gateway

package
v0.0.0-...-c188a41 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MICRO_SERVICE_NAME   = "micro-service-name"
	MICRO_SERVICE_PATH   = "micro-service-path"
	MICRO_SERVICE_SCHEMA = "micro-service-schema"

	CONTENT_TYPE = "application/json"
)

Variables

This section is empty.

Functions

func RetFailed

func RetFailed(ctx *fasthttp.RequestCtx, code int, msg ...string)

Types

type Doer

type Doer interface {
	LBName() string
	ServiceName() string
	Do(ctx context.Context, method, path string, in []byte) (out []byte, err error)
}

type GatewayServer

type GatewayServer struct {
	// contains filtered or unexported fields
}

func NewGateway

func NewGateway() *GatewayServer

func (*GatewayServer) AddInterceptor

func (s *GatewayServer) AddInterceptor(i int32, n func(next fasthttp.RequestHandler) fasthttp.RequestHandler) *GatewayServer

func (*GatewayServer) AddRpcEndpoint

func (s *GatewayServer) AddRpcEndpoint(d Doer) *GatewayServer

func (*GatewayServer) Init

func (s *GatewayServer) Init()

func (*GatewayServer) Run

func (s *GatewayServer) Run()

func (*GatewayServer) Stop

func (s *GatewayServer) Stop()

type Route

type Route struct {
	Id     string `yaml:"id"`
	Path   string `yaml:"path"`
	Schema string `yaml:"schema"`
}

func (*Route) String

func (r *Route) String() string

Jump to

Keyboard shortcuts

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