live

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package live provides live accounting functionality. That is, it keeps track of deltas in the amount of storage used by each project relative to the last tally operation (see pkg/accounting/tally).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	StorageBackend string `help:"what to use for storing real-time accounting data" default:"plainmemory"`
}

Config contains configurable values for the live accounting service.

type Service

type Service interface {
	GetProjectStorageUsage(ctx context.Context, projectID uuid.UUID) (int64, int64, error)
	AddProjectStorageUsage(ctx context.Context, projectID uuid.UUID, inlineSpaceUsed, remoteSpaceUsed int64) error
	ResetTotals()
}

Service represents the external interface to the live accounting functionality.

func New

func New(log *zap.Logger, config Config) (Service, error)

New creates a new live.Service instance of the type specified in the provided config.

Jump to

Keyboard shortcuts

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