threadsafe

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Bytes returns a new SafeBytes instance
	Bytes = NewSafeBytes
	// BytesS returns a new SafeBytes instance (from string)
	BytesS = NewSafeBytesFromString
)
View Source
var (
	// Bool returns a new SafeBytes instance
	Bool = NewSafeBool
)
View Source
var (
	// Int32 returns a new SafeInt32 instance
	Int32 = NewSafeInt32
)
View Source
var (
	// Uint64 returns a new SafeUint64 instance
	Uint64 = NewSafeUint64
)

Functions

This section is empty.

Types

type SafeBool added in v0.1.5

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

SafeBool is a thread safe []byte

func NewSafeBool added in v0.1.5

func NewSafeBool() *SafeBool

NewSafeBool returns a new SafeBytes from []byte

func (*SafeBool) Get added in v0.1.5

func (s *SafeBool) Get() bool

Get returns thread safe []bytes

func (*SafeBool) Set added in v0.1.5

func (s *SafeBool) Set(value bool)

Set sets []byte, thread safe

type SafeBytes

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

SafeBytes is a thread safe []byte

func NewSafeBytes

func NewSafeBytes(value []byte) *SafeBytes

NewSafeBytes returns a new SafeBytes from []byte

func NewSafeBytesFromString

func NewSafeBytesFromString(s string) *SafeBytes

NewSafeBytesFromString returns a new SafeBytes from string

func (*SafeBytes) Get

func (s *SafeBytes) Get() []byte

Get returns thread safe []bytes

func (*SafeBytes) Set

func (s *SafeBytes) Set(value []byte)

Set sets []byte, thread safe

type SafeInt32

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

SafeInt32 is a thread safe int32 equivalent

func NewSafeInt32

func NewSafeInt32(value int32) *SafeInt32

NewSafeInt32 returns a new SafeInt32 instance

func (*SafeInt32) Get

func (s *SafeInt32) Get() int32

Get returns thread safe int32

func (*SafeInt32) Set

func (s *SafeInt32) Set(value int32)

Set sets int32, thread safe

type SafeInt64

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

SafeInt64 is a thread safe int64 equivalent

func NewSafeInt64

func NewSafeInt64(value int64) *SafeInt64

NewSafeInt64 returns a new SafeInt64 instance

func (*SafeInt64) Get

func (s *SafeInt64) Get() int64

Get returns thread safe int64

func (*SafeInt64) Set

func (s *SafeInt64) Set(value int64)

Set sets int64, thread safe

type SafeUint64

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

SafeUint64 is a thread safe uint64 equivalent

func NewSafeUint64

func NewSafeUint64(value uint64) *SafeUint64

NewSafeUint64 returns a new SafeUint64 instance

func (*SafeUint64) Get

func (s *SafeUint64) Get() uint64

Get returns thread safe uint64

func (*SafeUint64) Set

func (s *SafeUint64) Set(value uint64)

Set sets uint64, thread safe

Jump to

Keyboard shortcuts

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