maintain

package
v1.13.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(ctx context.Context, namingService service.DiscoverServer, healthCheckServer *healthcheck.Server) error

Initialize 初始化

Types

type ConnCountResp

type ConnCountResp struct {
	Protocol string
	Total    int32
	Host     map[string]int32
}

type ConnReq

type ConnReq struct {
	Protocol string
	Host     string
	Port     int
	Amount   int
}

type ConnStatsResp

type ConnStatsResp struct {
	Protocol        string
	ActiveConnTotal int32
	StatsTotal      int
	StatsSize       int
	Stats           []*connlimit.HostConnStat
}

type MaintainOperateServer

type MaintainOperateServer interface {

	// GetServerConnections Get connection count
	GetServerConnections(ctx context.Context, req *ConnReq) (*ConnCountResp, error)

	// GetServerConnStats 获取连接缓存里面的统计信息
	GetServerConnStats(ctx context.Context, req *ConnReq) (*ConnStatsResp, error)

	// CloseConnections Close connection by ip
	CloseConnections(ctx context.Context, reqs []ConnReq) error

	// FreeOSMemory Free system memory
	FreeOSMemory(ctx context.Context) error

	// CleanInstance Clean deleted instance
	CleanInstance(ctx context.Context, req *api.Instance) *api.Response

	// GetLastHeartbeat Get last heartbeat
	GetLastHeartbeat(ctx context.Context, req *api.Instance) *api.Response

	// GetLogOutputLevel Get log output level
	GetLogOutputLevel(ctx context.Context) (map[string]string, error)

	// SetLogOutputLevel Set log output level by scope
	SetLogOutputLevel(ctx context.Context, scope string, level string) error
}

MaintainOperateServer Maintain related operation

func GetServer

func GetServer() (MaintainOperateServer, error)

GetServer 获取已经初始化好的Server

type Server

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

func GetOriginServer

func GetOriginServer() (*Server, error)

GetOriginServer 获取已经初始化好的Server

func (*Server) CleanInstance

func (s *Server) CleanInstance(ctx context.Context, req *api.Instance) *api.Response

func (*Server) CloseConnections

func (s *Server) CloseConnections(_ context.Context, reqs []ConnReq) error

func (*Server) FreeOSMemory

func (s *Server) FreeOSMemory(_ context.Context) error

func (*Server) GetLastHeartbeat

func (s *Server) GetLastHeartbeat(_ context.Context, req *api.Instance) *api.Response

func (*Server) GetLogOutputLevel

func (s *Server) GetLogOutputLevel(_ context.Context) (map[string]string, error)

func (*Server) GetServerConnStats

func (s *Server) GetServerConnStats(_ context.Context, req *ConnReq) (*ConnStatsResp, error)

func (*Server) GetServerConnections

func (s *Server) GetServerConnections(_ context.Context, req *ConnReq) (*ConnCountResp, error)

func (*Server) SetLogOutputLevel

func (s *Server) SetLogOutputLevel(_ context.Context, scope string, level string) error

Jump to

Keyboard shortcuts

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