tasks

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DailyQuotaCollector

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

func NewDailyQuotaCollector

func NewDailyQuotaCollector(opts ...DailyQuotaCollectorOption) *DailyQuotaCollector

func (*DailyQuotaCollector) Task

func (d *DailyQuotaCollector) Task() (bool, error)

type DailyQuotaCollectorOption

type DailyQuotaCollectorOption func(collector *DailyQuotaCollector)

func DailyQuotaCollectorWithBundle

func DailyQuotaCollectorWithBundle(bndl *bundle.Bundle) DailyQuotaCollectorOption

func DailyQuotaCollectorWithCMPAPI

func DailyQuotaCollectorWithCMPAPI(cmp interface {
	ListSteveResource(ctx context.Context, req *apistructs.SteveRequest) ([]types.APIObject, error)
	GetNamespacesResources(ctx context.Context, nReq *pb.GetNamespacesResourcesRequest) (*pb.GetNamespacesResourcesResponse, error)
	GetClustersResources(ctx context.Context, cReq *pb.GetClustersResourcesRequest) (*pb.GetClusterResourcesResponse, error)
	GetAllClusters() []string
}) DailyQuotaCollectorOption

func DailyQuotaCollectorWithDBClient

func DailyQuotaCollectorWithDBClient(db *dbclient.DBClient) DailyQuotaCollectorOption

type ExitError

type ExitError struct {
	Message string
}

func (ExitError) Error

func (e ExitError) Error() string

type Task

type Task func() error

type Ticker

type Ticker struct {
	Name     string
	Interval time.Duration
	Task     func() (stop bool, err error)
	// contains filtered or unexported fields
}

func New

func New(interval time.Duration, task func() (bool, error)) *Ticker

func (*Ticker) Close

func (d *Ticker) Close()

func (*Ticker) Run

func (d *Ticker) Run() error

Jump to

Keyboard shortcuts

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