Help us shape the future of Go! Take the 2026 Go Developer Survey

permits

package
v1.2.6 Latest Latest
Warning

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

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

Documentation

Overview

Package permits is used to provide permitGiver which maintains a sync map whose values can be deleted if not accessed for a configured time

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PermitGiver

type PermitGiver interface {
	RegisterPermits(key string, numPermits int)
	TryPermit(key string, timeout time.Duration) bool
	ReleasePermit(key string)
	DeletePermits(key string)
	Close()
}

PermitGiver provides different operations regarding permit for a given key

func NewPermitGiver

func NewPermitGiver(stalePermitKeyTimeout time.Duration, janitorFrequency time.Duration) PermitGiver

NewPermitGiver returns a new PermitGiver

Jump to

Keyboard shortcuts

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