model

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestLimits

type RequestLimits struct {
	WindowSeconds uint64
	Requests      *Requests `json:"requests_v2,omitempty"`
	Threshold     uint64
}

func (*RequestLimits) AddCounter

func (r *RequestLimits) AddCounter(counterTime time.Time)

func (*RequestLimits) CleanCounters added in v0.0.55

func (r *RequestLimits) CleanCounters() *Requests

func (*RequestLimits) Marshal

func (r *RequestLimits) Marshal() ([]byte, error)

func (*RequestLimits) ToCommon

func (r *RequestLimits) ToCommon() common.RequestLimitData

func (*RequestLimits) ToV2 added in v0.0.50

func (r *RequestLimits) ToV2() *RequestLimitsV2

func (*RequestLimits) Unmarshal

func (r *RequestLimits) Unmarshal(data []byte) error

type RequestLimitsV2

type RequestLimitsV2 struct {
	WindowSeconds uint64       `json:"window_seconds"`
	RequestsCount uint32       `json:"requests_count"`
	Requests      []RequestsV2 `json:"-"`
	Threshold     uint64       `json:"threshold"`
}

func (*RequestLimitsV2) AddCounter added in v0.1.14

func (r *RequestLimitsV2) AddCounter(counterTime time.Time)

func (*RequestLimitsV2) CleanCounters added in v0.1.14

func (r *RequestLimitsV2) CleanCounters() []RequestsV2

func (*RequestLimitsV2) Marshal added in v0.0.55

func (r *RequestLimitsV2) Marshal() ([]byte, error)

func (*RequestLimitsV2) Unmarshal added in v0.0.55

func (r *RequestLimitsV2) Unmarshal(data []byte) error

type RequestLimitsV2Debug added in v0.1.16

type RequestLimitsV2Debug struct {
	WindowSeconds uint64       `json:"window_seconds"`
	RequestsCount uint32       `json:"requests_count"`
	Requests      []RequestsV2 `json:"requests"`
	Threshold     uint64       `json:"threshold"`
}

type Requests

type Requests struct {
	Data  []int32   `json:"data"`
	Start time.Time `json:"start"`
}

type RequestsV2

type RequestsV2 struct {
	Data  []uint32  `json:"data"`
	Start time.Time `json:"start"`
}

func (*RequestsV2) Marshal added in v0.0.55

func (r *RequestsV2) Marshal() ([]byte, error)

func (*RequestsV2) Unmarshal added in v0.0.55

func (r *RequestsV2) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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