atomicTypes

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 2 Imported by: 4

Documentation

Overview

Package atomicTypes provides object locking / unlocking for setting and getting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicBool

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

AtomicBool provides an bool object that is lock safe.

func (*AtomicBool) Get

func (obj *AtomicBool) Get() (value bool)

Get returns the bool value

func (*AtomicBool) Set

func (obj *AtomicBool) Set(value bool)

Set sets the bool value

func (*AtomicBool) ToggleTrue

func (obj *AtomicBool) ToggleTrue() (changed bool)

ToggleTrue sets the bool value only if the check back true; return if the value was set

type AtomicBoolArray

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

AtomicBoolArray provides a []bool object that is lock safe.

func (*AtomicBoolArray) Get

func (obj *AtomicBoolArray) Get() (value []bool)

Get returns the []bool value

func (*AtomicBoolArray) Set

func (obj *AtomicBoolArray) Set(value []bool)

Set sets the []bool value

func (*AtomicBoolArray) SetByIndex

func (obj *AtomicBoolArray) SetByIndex(index int, value bool)

SetByIndex sets a bool by index value

type AtomicByteArray

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

AtomicByteArray provides a []byte object that is lock safe.

func (*AtomicByteArray) Get

func (obj *AtomicByteArray) Get() (value []byte)

Get returns the []byte value

func (*AtomicByteArray) Set

func (obj *AtomicByteArray) Set(value []byte)

Set sets the []byte value

type AtomicFloat64

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

AtomicFloat64 provides a float64 object that is lock safe.

func (*AtomicFloat64) Get

func (obj *AtomicFloat64) Get() (value float64)

Get returns the float64 value

func (*AtomicFloat64) Set

func (obj *AtomicFloat64) Set(value float64)

Set sets the float64 value

type AtomicInt

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

AtomicInt provides an int object that is lock safe.

func (*AtomicInt) Add added in v1.1.1

func (obj *AtomicInt) Add(n int) int

Add allows for the value to safely be add by n

func (*AtomicInt) Decrement

func (obj *AtomicInt) Decrement() int

Decrement allows for the value to safely be decreased by 1

func (*AtomicInt) Get

func (obj *AtomicInt) Get() (value int)

Get returns the int value

func (*AtomicInt) Increment

func (obj *AtomicInt) Increment() int

Increment allows for the value to safely be increased by 1

func (*AtomicInt) Set

func (obj *AtomicInt) Set(value int)

Set sets the int value

type AtomicString

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

AtomicString provides a string object that is lock safe.

func (*AtomicString) Get

func (obj *AtomicString) Get() (value string)

Get returns the string value

func (*AtomicString) Set

func (obj *AtomicString) Set(value string)

Set sets the string value

type AtomicTime

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

AtomicTime provides a time.Time object that is lock safe.

func (*AtomicTime) Get

func (obj *AtomicTime) Get() (value time.Time)

Get returns the time.Time value

func (*AtomicTime) Set

func (obj *AtomicTime) Set(value time.Time)

Set sets the time.Time value

type AtomicUInt16

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

AtomicUInt16 provides an uint16 object that is lock safe.

func (*AtomicUInt16) Get

func (obj *AtomicUInt16) Get() (value uint16)

Get returns the int value

func (*AtomicUInt16) Set

func (obj *AtomicUInt16) Set(value uint16)

Set sets the int value

type AtomicUInt32

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

AtomicUInt32 provides an uint16 object that is lock safe.

func (*AtomicUInt32) Get

func (obj *AtomicUInt32) Get() (value uint32)

Get returns the int value

func (*AtomicUInt32) Set

func (obj *AtomicUInt32) Set(value uint32)

Set sets the int value

Jump to

Keyboard shortcuts

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