base

package
v1.21.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHandler

type BaseHandler struct {
	audit.AuditInterface
	authorization.PermissionManager
	DynamicConfig options.DynamicConfigurationProviderIface
	aaa.ContextUserOperator
	// contains filtered or unexported fields
}

BaseHandler is the base handler for all handlers

func NewHandler

func NewHandler(auditi audit.AuditInterface,
	permManager authorization.PermissionManager,
	userif aaa.ContextUserOperator,
	dynamicConfig options.DynamicConfigurationProviderIface,
	agents *agents.ClientSet,
	database *database.Database,
	redis *redis.Client,
	msgbuscli *msgclient.MsgBusClient,
	modelCache *cache.ModelCache,
) BaseHandler

func (BaseHandler) ClusterFunc

func (h BaseHandler) ClusterFunc(cluster string, fun OnClusterFunc) gin.HandlerFunc

func (BaseHandler) Execute

func (h BaseHandler) Execute(ctx context.Context, cluster string, fun func(ctx context.Context, cli agents.Client) error) error

func (*BaseHandler) GetAgents

func (h *BaseHandler) GetAgents() *agents.ClientSet

func (*BaseHandler) GetDB

func (h *BaseHandler) GetDB() *gorm.DB

func (*BaseHandler) GetDataBase

func (h *BaseHandler) GetDataBase() *database.Database

func (*BaseHandler) GetMessageBusClient

func (h *BaseHandler) GetMessageBusClient() *msgclient.MsgBusClient

func (*BaseHandler) GetRedis

func (h *BaseHandler) GetRedis() *redis.Client

func (*BaseHandler) ModelCache

func (h *BaseHandler) ModelCache() *cache.ModelCache

func (BaseHandler) SendToMsgbus

func (h BaseHandler) SendToMsgbus(c *gin.Context, mutateMsg func(msg *msgclient.MsgRequest))

type OnClusterFunc

type OnClusterFunc func(ctx context.Context, cli agents.Client) (interface{}, error)

OnClusterFunc is the function be called on cluster,the first return value is the http response data,the second is the error

Jump to

Keyboard shortcuts

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