gateway

package
v3.1.14 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EtcdEndpoints   []string      `yaml:"etcd_endpoints"`
	EtcdDialTimeout time.Duration `yaml:"etcd_dial_timeout"`
	RoutePrefix     string        `yaml:"route_prefix"`
	HTTPAddr        string        `yaml:"http_addr"`
}

type EtcdGateway

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

func NewEtcdGateway

func NewEtcdGateway(app *core.Core, config *Config) (*EtcdGateway, error)

func (*EtcdGateway) Close

func (gw *EtcdGateway) Close() error

type MethodDescriptor

type MethodDescriptor struct {
	FullMethod  string
	Package     string // proto package, e.g. "v1.auth"
	Service     string // service name, e.g. "UserService"
	Method      string // method name, e.g. "PostLogin"
	NewRequest  func() proto.Message
	NewResponse func() proto.Message
}

type ReflectionProxy

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

func NewReflectionProxy

func NewReflectionProxy(addr string) (*ReflectionProxy, error)

func (*ReflectionProxy) Close

func (p *ReflectionProxy) Close() error

func (*ReflectionProxy) Invoke

func (p *ReflectionProxy) Invoke(ctx context.Context, fullMethod string, jsonReq []byte) ([]byte, error)

func (*ReflectionProxy) Methods

func (p *ReflectionProxy) Methods() map[string]*MethodDescriptor

Methods 返回所有已注册的方法

type Route

type Route struct {
	ID          string            `json:"id"`
	Method      string            `json:"method"`
	Path        string            `json:"path"`
	ServiceName string            `json:"service_name"`
	GRPCMethod  string            `json:"grpc_method"`
	Description string            `json:"description"`
	Headers     map[string]string `json:"headers,omitempty"`
	Enabled     bool              `json:"enabled"`
	CreatedAt   time.Time         `json:"created_at"`
	UpdatedAt   time.Time         `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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