quota

package
Version: v0.0.0-...-afa1830 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, exec boil.ContextExecutor, quotum *Quotum) error

Create quotum generating the id

func DeleteBoxUsedSpace

func DeleteBoxUsedSpace(ctx context.Context, exec boil.ContextExecutor, boxID string) error

DeleteBoxUsedSpace ...

func UpdateBoxUsedSpace

func UpdateBoxUsedSpace(ctx context.Context, exec boil.ContextExecutor, BoxID string, incrementValue int64, decrementValue int64) error

UpdateBoxUsedSpace ...

Types

type Quotum

type Quotum struct {
	ID         string    `json:"id"`
	CreatedAt  time.Time `json:"created_at"`
	IdentityID string    `json:"identity_id"`
	Value      int64     `json:"value"`
	Origin     string    `json:"origin"`
}

Quotum model

func List

func List(ctx context.Context, exec boil.ContextExecutor, id string) ([]Quotum, error)

List quota for a given identityID

func ToDomain

func ToDomain(dbQuotum sqlboiler.StorageQuotum) Quotum

ToDomain ...

func (Quotum) ToSQLBoiler

func (q Quotum) ToSQLBoiler() *sqlboiler.StorageQuotum

ToSQLBoiler ...

type UsedSpace

type UsedSpace struct {
	BoxID string `json:"box_id"`
	Value int64  `json:"value"`
	ID    string `json:"-"`
}

UsedSpace model

func ListBoxUsedSpaces

func ListBoxUsedSpaces(ctx context.Context, exec boil.ContextExecutor, boxIds []string) ([]UsedSpace, error)

ListBoxUsedSpaces for an array of boxes ids

type VaultUsedSpace

type VaultUsedSpace struct {
	Value int64 `json:"value" boil:"total"`
}

VaultUsedSpace model

func GetVault

func GetVault(ctx context.Context, exec boil.ContextExecutor, id string) (*VaultUsedSpace, error)

GetVault used space

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL