usage

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DAY = 24 * time.Hour

Variables

This section is empty.

Functions

func GetNamespacedName added in v0.0.2

func GetNamespacedName(project, workspace string) string

func GetObjectKey added in v0.0.2

func GetObjectKey(project, workspace, mcp string) client.ObjectKey

func MergeDailyUsages added in v0.0.2

func MergeDailyUsages(a []v1.DailyUsage, b []v1.DailyUsage) []v1.DailyUsage

merges two DailyUsages where no Date is double

Types

type UsageTracker

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

func NewUsageTracker

func NewUsageTracker(log *logging.Logger, client client.Client) (*UsageTracker, error)

func (*UsageTracker) CreateOrUpdateEvent added in v0.0.2

func (u *UsageTracker) CreateOrUpdateEvent(ctx context.Context, project string, workspace string, mcp_name string) error

func (*UsageTracker) DeletionEvent

func (u *UsageTracker) DeletionEvent(ctx context.Context, project string, workspace string, mcp_name string) error

func (*UsageTracker) ScheduledEvent

func (u *UsageTracker) ScheduledEvent(ctx context.Context) error

func (*UsageTracker) UpdateChargingTarget added in v0.0.2

func (u *UsageTracker) UpdateChargingTarget(ctx context.Context, mcpUsage *v1.MCPUsage) error

Jump to

Keyboard shortcuts

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