limiter

package
v1.0.0-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMaxNumReposReached = errors.New("maximum number of repositories reached")
View Source
var ErrMaxRepoSizeReached = errors.New("maximum size of repository reached")

Functions

This section is empty.

Types

type ResourceLimiter

type ResourceLimiter interface {
	// RepoCount allows the creation of a specified number of repositories.
	RepoCount(ctx context.Context, spaceID int64, count int) error

	// RepoSize allows repository growth up to a limit for the given repoID.
	RepoSize(ctx context.Context, repoID int64) error
}

ResourceLimiter is an interface for managing resource limitation.

func NewResourceLimiter

func NewResourceLimiter() ResourceLimiter

NewResourceLimiter creates a new instance of ResourceLimiter.

func ProvideLimiter

func ProvideLimiter() (ResourceLimiter, error)

type Unlimited

type Unlimited struct {
}

func (Unlimited) RepoCount

func (Unlimited) RepoCount(context.Context, int64, int) error

func (Unlimited) RepoSize

func (Unlimited) RepoSize(context.Context, int64) error

Jump to

Keyboard shortcuts

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