tasks

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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