boltprov

package
v0.0.0-...-08df64e Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package boltprov provides lease storage using a bolt database.

Index

Constants

View Source
const (
	// ResourcefulBucket is the default name of the resourceful boltdb bucket in
	// which the provider stores data.
	ResourcefulBucket = "resourceful"
	// LeaseBucket is the name of the resourceful lease bucket.
	LeaseBucket = "lease"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider provides boltdb-backed lease management.

func New

func New(db *bolt.DB) *Provider

New returns a new memory provider.

func (*Provider) Close

func (p *Provider) Close() error

Close releases any resources consumed by the provider.

func (*Provider) LeaseCommit

func (p *Provider) LeaseCommit(tx *lease.Tx) error

LeaseCommit will attempt to apply the operations described in the lease transaction.

func (*Provider) LeaseResources

func (p *Provider) LeaseResources() (resources []string, err error)

LeaseResources returns all of the resources with lease data.

func (*Provider) LeaseView

func (p *Provider) LeaseView(resource string) (revision uint64, leases lease.Set, err error)

LeaseView returns the current revision and lease set for the resource.

func (*Provider) ProviderName

func (p *Provider) ProviderName() string

ProviderName returns the name of the provider.

Jump to

Keyboard shortcuts

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