libsync

package
v0.0.0-...-c45f81d Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log LogConfig `yaml:"log" env-prefix:"LOG__"`
}

type IMutex

type IMutex interface {
	Lock()
	Unlock()
}

type IRWMutex

type IRWMutex interface {
	IMutex
	RLock()
	RUnlock()
}

type IWaitGroup

type IWaitGroup interface {
	Add(delta int)
	Done()
	Wait()
}

type LogConfig

type LogConfig struct {
	Debug     bool          `yaml:"debug"     env:"DEBUG"     env-default:"false" env-description:"Enable logging for sync."`
	Threshold time.Duration `yaml:"threshold" env:"THRESHOLD" env-default:"100ms" env-description:"Sync logs threshold."`
}

type LoggedMutex

type LoggedMutex struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLoggedMutex

func NewLoggedMutex(cfg *Config) *LoggedMutex

func (*LoggedMutex) Holders

func (m *LoggedMutex) Holders() string

func (*LoggedMutex) Lock

func (m *LoggedMutex) Lock()

func (*LoggedMutex) Unlock

func (m *LoggedMutex) Unlock()

type LoggedRWMutex

type LoggedRWMutex struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewLoggedRWMutex

func NewLoggedRWMutex(cfg *Config) *LoggedRWMutex

func (*LoggedRWMutex) Holders

func (m *LoggedRWMutex) Holders() string

func (*LoggedRWMutex) Lock

func (m *LoggedRWMutex) Lock()

func (*LoggedRWMutex) RLock

func (m *LoggedRWMutex) RLock()

func (*LoggedRWMutex) RUnlock

func (m *LoggedRWMutex) RUnlock()

func (*LoggedRWMutex) Unlock

func (m *LoggedRWMutex) Unlock()

type LoggedWaitGroup

type LoggedWaitGroup struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func NewLoggedWaitGroup

func NewLoggedWaitGroup(cfg *Config) *LoggedWaitGroup

func (*LoggedWaitGroup) Wait

func (wg *LoggedWaitGroup) Wait()

Jump to

Keyboard shortcuts

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