v1

package
v0.0.0-...-91e3901 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorDuplicateDebugRoute = errors.New("duplicate debug route")
)

Functions

func BuildClientBeat

func BuildClientBeat(req *restful.Request) (*model.ClientBeat, error)

func BuildInstance

func BuildInstance(namespace string, req *restful.Request) (*model.Instance, error)

func ParseJsonBody

func ParseJsonBody(req *restful.Request, value interface{}) error

ParseJsonBody parse http body as json object

func ParseQueryParams

func ParseQueryParams(req *restful.Request) map[string]string

ParseQueryParams 解析并获取HTTP的query params

func RegistryDebugRoute

func RegistryDebugRoute(name string, rb func(*restful.WebService) *restful.RouteBuilder) error

func WithAuthSvr

func WithAuthSvr(userSvr auth.UserServer, checkerSvr auth.StrategyServer) option

func WithConnLimitConfig

func WithConnLimitConfig(connLimitConfig *connlimit.Config) option

func WithDiscoverSvr

func WithDiscoverSvr(discoverSvr service.DiscoverServer) option

func WithHealthSvr

func WithHealthSvr(healthSvr *healthcheck.Server) option

func WithNamespaceSvr

func WithNamespaceSvr(namespaceSvr namespace.NamespaceOperateServer) option

func WithTLS

func WithTLS(tlsInfo *secure.TLSInfo) option

Types

type Handler

type Handler struct {
	Request  *restful.Request
	Response *restful.Response
}

Handler HTTP请求/回复处理器

func (*Handler) ParseHeaderContext

func (h *Handler) ParseHeaderContext() context.Context

ParseHeaderContext 将http请求header中携带的用户信息提取出来

type NacosV1Server

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

NacosV1Server HTTP API服务器

func NewNacosV1Server

func NewNacosV1Server(pushCenter core.PushCenter, store *core.NacosDataStorage,
	options ...option) *NacosV1Server

func (*NacosV1Server) DeRegisterInstance

func (n *NacosV1Server) DeRegisterInstance(req *restful.Request, rsp *restful.Response)

func (*NacosV1Server) GetAuthServer

func (n *NacosV1Server) GetAuthServer() (*restful.WebService, error)

func (*NacosV1Server) GetClientServer

func (n *NacosV1Server) GetClientServer() (*restful.WebService, error)

func (*NacosV1Server) GetDebugServer

func (n *NacosV1Server) GetDebugServer() (*restful.WebService, error)

func (*NacosV1Server) GetProtocol

func (h *NacosV1Server) GetProtocol() string

GetProtocol 获取Server的协议

func (*NacosV1Server) Heartbeat

func (n *NacosV1Server) Heartbeat(req *restful.Request, rsp *restful.Response)

func (*NacosV1Server) Initialize

func (h *NacosV1Server) Initialize(_ context.Context, option map[string]interface{}, port uint32,
	apiConf map[string]apiserver.APIConfig) error

Initialize 初始化HTTP API服务器

func (*NacosV1Server) ListInstances

func (n *NacosV1Server) ListInstances(req *restful.Request, rsp *restful.Response)

func (*NacosV1Server) Login

func (n *NacosV1Server) Login(req *restful.Request, rsp *restful.Response)

func (*NacosV1Server) RegisterInstance

func (n *NacosV1Server) RegisterInstance(req *restful.Request, rsp *restful.Response)

func (*NacosV1Server) Run

func (h *NacosV1Server) Run(errCh chan error)

Run 启动HTTP API服务器

func (*NacosV1Server) ServerHealthStatus

func (n *NacosV1Server) ServerHealthStatus(req *restful.Request, rsp *restful.Response)

func (*NacosV1Server) Stop

func (h *NacosV1Server) Stop()

Stop shutdown server

Jump to

Keyboard shortcuts

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