mem

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mem implements lease.Provider in memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	lease.Clock
	// contains filtered or unexported fields
}

Provider is a lease.Provider implemented in memory.

func New

func New() *Provider

New creates a new in-memory lease provider.

func (*Provider) Acquire

func (p *Provider) Acquire(ctx context.Context, name string, exp time.Time) (string, error)

func (*Provider) Release

func (p *Provider) Release(_ context.Context, name, secret string) error

func (*Provider) Renew

func (p *Provider) Renew(ctx context.Context, name, secret string, exp time.Time) error

Jump to

Keyboard shortcuts

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