sync

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package sync define atomic file system base counter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	URL   string
	Data  interface{} `json:",omitempty"`
	Count int
	// contains filtered or unexported fields
}

Counter represents a sync counter

func NewCounter

func NewCounter(URL string, fs afs.Service) *Counter

NewCounter creates a fs based counter

func (*Counter) Decrement

func (g *Counter) Decrement(ctx context.Context) (int, error)

Decrement decrements counter

func (*Counter) Delete added in v1.6.0

func (g *Counter) Delete(ctx context.Context) error

Delete deletes counter

func (*Counter) Increment

func (g *Counter) Increment(ctx context.Context) (int, error)

Increment increments counter

Jump to

Keyboard shortcuts

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