base

package
v1.21.2-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 8 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 {
	// contains filtered or unexported fields
}

BaseHandler is the base handler for all handlers

func NewBaseHandler

func NewBaseHandler(agents *agents.ClientSet, redis *redis.Client, db *database.Database) BaseHandler

func (*BaseHandler) Agents

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

func (BaseHandler) ClusterFunc

func (h BaseHandler) ClusterFunc(cluster string, fun OnClusterFunc) restful.RouteFunction

func (*BaseHandler) DB

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

func (*BaseHandler) DBWithContext

func (h *BaseHandler) DBWithContext(req *restful.Request) *gorm.DB

func (*BaseHandler) Database

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

func (BaseHandler) Execute

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

func (*BaseHandler) GetByName

func (h *BaseHandler) GetByName(ctx context.Context, obj interface{}, name string) error

func (*BaseHandler) List

func (h *BaseHandler) List(obj interface{}, opts ...client.Option)

func (*BaseHandler) Redis

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

type OnClusterFunc

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

Jump to

Keyboard shortcuts

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