limits

package
v0.4.44 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountAction

type AccountAction interface {
	HandleAccount(a *store.Account, rxBytes, txBytes int64, bwc store.BandwidthClass, ul *userLimits, trx *sqlx.Tx) error
}

type Agent

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

func NewAgent

func NewAgent(cfg *Config, ifxCfg *metrics.InfluxConfig, zCfg *zrokEdgeSdk.Config, emailCfg *emailUi.Config, str *store.Store) (*Agent, error)

func (*Agent) CanAccessShare

func (a *Agent) CanAccessShare(shrId int, trx *sqlx.Tx) (bool, error)

func (*Agent) CanCreateEnvironment

func (a *Agent) CanCreateEnvironment(acctId int, trx *sqlx.Tx) (bool, error)

func (*Agent) CanCreateShare

func (a *Agent) CanCreateShare(acctId, envId int, reserved, uniqueName bool, _ sdk.ShareMode, backendMode sdk.BackendMode, trx *sqlx.Tx) (bool, error)

func (*Agent) Handle

func (a *Agent) Handle(u *metrics.Usage) error

func (*Agent) Start

func (a *Agent) Start()

func (*Agent) Stop

func (a *Agent) Stop()

type Bandwidth

type Bandwidth struct {
	Rx    int64
	Tx    int64
	Total int64
}

type BandwidthPerPeriod

type BandwidthPerPeriod struct {
	Period  time.Duration
	Warning *Bandwidth
	Limit   *Bandwidth
}

func DefaultBandwidthPerPeriod

func DefaultBandwidthPerPeriod() *BandwidthPerPeriod

type Config

type Config struct {
	Environments   int
	Shares         int
	ReservedShares int
	UniqueNames    int
	ShareFrontends int
	Bandwidth      *BandwidthPerPeriod
	Cycle          time.Duration
	Enforcing      bool
}

func DefaultConfig

func DefaultConfig() *Config

Jump to

Keyboard shortcuts

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