sync

package
v3.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuseOpLimiter

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

FuseOpLimiter enforces multiple classes of limits, plus an optional global limit.

func NewFuseOpLimiter

func NewFuseOpLimiter(perClass map[FuseOpType]int64, global int64) *FuseOpLimiter

NewFuseOpLimiter creates a new MultiLimiter with the given per-class and global limits. A limit of 0 disables that limit.

func (*FuseOpLimiter) WithLimit

func (m *FuseOpLimiter) WithLimit(ctx context.Context, cl FuseOpType, fn func(context.Context) error) error

WithLimit applies the class (and global) limit. Reentrant-safe: if the context already holds the class token, it won't acquire again.

type FuseOpType

type FuseOpType uint8

FuseOpType represents the type of operation for limiting purposes.

e.g. upload vs download operations.

const (

	// FuseOpUpload represents upload operations.
	FuseOpUpload FuseOpType

	// FuseOpDownload represents download operations.
	FuseOpDownload

	// FuseOpOther represents other operations. e.g. list, find, delete, etc.
	FuseOpOther
)

Jump to

Keyboard shortcuts

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