admin

package
v1.18.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(ctx context.Context, cfg *Config, namingService service.DiscoverServer,
	healthCheckServer *healthcheck.Server, cacheMgn *cache.CacheManager, storage store.Store) error

Initialize 初始化

Types

type AdminOperateServer

type AdminOperateServer 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 *apiservice.Instance) *apiservice.Response

	// BatchCleanInstances Batch clean deleted instances
	BatchCleanInstances(ctx context.Context, batchSize uint32) (uint32, error)
	// GetLastHeartbeat Get last heartbeat
	GetLastHeartbeat(ctx context.Context, req *apiservice.Instance) *apiservice.Response

	// GetLogOutputLevel Get log output level
	GetLogOutputLevel(ctx context.Context) ([]ScopeLevel, error)
	// SetLogOutputLevel Set log output level by scope
	SetLogOutputLevel(ctx context.Context, scope string, level string) error
	// ListLeaderElections
	ListLeaderElections(ctx context.Context) ([]*model.LeaderElection, error)
	// ReleaseLeaderElection
	ReleaseLeaderElection(ctx context.Context, electKey string) error
	// GetCMDBInfo get cmdb info
	GetCMDBInfo(ctx context.Context) ([]model.LocationView, error)
}

AdminOperateServer Maintain related operation

func GetServer

func GetServer() (AdminOperateServer, error)

GetServer 获取已经初始化好的Server

type Config

type Config struct {
	Jobs []job.JobConfig `yaml:"jobs"`
}

Config maintain configuration

func DefaultConfig added in v1.17.3

func DefaultConfig() *Config

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 ScopeLevel added in v1.17.3

type ScopeLevel struct {
	Name  string
	Level string
}

type Server

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

func GetOriginServer

func GetOriginServer() (*Server, error)

GetOriginServer 获取已经初始化好的Server

func (*Server) BatchCleanInstances

func (s *Server) BatchCleanInstances(ctx context.Context, batchSize uint32) (uint32, error)

func (*Server) CleanInstance

func (s *Server) CleanInstance(ctx context.Context, req *apiservice.Instance) *apiservice.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) GetCMDBInfo

func (svr *Server) GetCMDBInfo(ctx context.Context) ([]model.LocationView, error)

func (*Server) GetLastHeartbeat

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

func (*Server) GetLogOutputLevel

func (s *Server) GetLogOutputLevel(_ context.Context) ([]ScopeLevel, 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) ListLeaderElections

func (s *Server) ListLeaderElections(_ context.Context) ([]*model.LeaderElection, error)

func (*Server) ReleaseLeaderElection

func (s *Server) ReleaseLeaderElection(_ context.Context, electKey string) error

func (*Server) SetLogOutputLevel

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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