pausectl

package
v0.0.0-...-bafe0c7 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package pausectl provides functionality to manage pause locks with expiration.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLockExists   = errors.New("lock already exists")
	ErrLockNotFound = errors.New("lock not found")
)

Functions

This section is empty.

Types

type Lock

type Lock struct {
	ID   string `json:"-"`
	Stop bool   `json:"stop"`
}

Lock represents a pause lock with an identifier and stop status

type Manager

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

Manager handles the creation and management of pause locks

func NewManager

func NewManager(expiration, cleanupInterval time.Duration) *Manager

NewManager creates a new Manager with the specified expiration and cleanup intervals

func (*Manager) Delete

func (m *Manager) Delete(id string)

Delete removes a Lock from the manager

func (*Manager) Get

func (m *Manager) Get(id string) (*Lock, error)

Get retrieves an existing Lock by its ID

func (*Manager) New

func (m *Manager) New(id string) (*Lock, error)

New creates a new Lock with the specified ID

func (*Manager) Update

func (m *Manager) Update(id string) (*Lock, error)

Update sets the stop status of a Lock to true

Jump to

Keyboard shortcuts

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