atomic

package
v0.0.0-...-4d950b6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultValue

func DefaultValue[T any]() T

Types

type Bool

type Bool struct {
	atomic.Bool
}

func NewBool

func NewBool(val bool) (i Bool)

func (*Bool) MarshalJSON

func (i *Bool) MarshalJSON() ([]byte, error)

func (*Bool) String

func (i *Bool) String() string

func (*Bool) UnmarshalJSON

func (i *Bool) UnmarshalJSON(b []byte) error

type Int32

type Int32 struct {
	atomic.Int32
}

func NewInt32

func NewInt32(val int32) (i Int32)

func (*Int32) MarshalJSON

func (i *Int32) MarshalJSON() ([]byte, error)

func (*Int32) String

func (i *Int32) String() string

func (*Int32) UnmarshalJSON

func (i *Int32) UnmarshalJSON(b []byte) error

type Int64

type Int64 struct {
	atomic.Int64
}

func NewInt64

func NewInt64(val int64) (i Int64)

func (*Int64) MarshalJSON

func (i *Int64) MarshalJSON() ([]byte, error)

func (*Int64) String

func (i *Int64) String() string

func (*Int64) UnmarshalJSON

func (i *Int64) UnmarshalJSON(b []byte) error

type Pointer

type Pointer[T any] struct {
	atomic.Pointer[T]
}

func NewPointer

func NewPointer[T any](v *T) (p Pointer[T])

func (*Pointer[T]) MarshalJSON

func (p *Pointer[T]) MarshalJSON() ([]byte, error)

func (*Pointer[T]) String

func (p *Pointer[T]) String() string

func (*Pointer[T]) UnmarshalJSON

func (p *Pointer[T]) UnmarshalJSON(b []byte) error

type TypedValue

type TypedValue[T any] struct {
	// contains filtered or unexported fields
}

func NewTypedValue

func NewTypedValue[T any](t T) (v TypedValue[T])

func (*TypedValue[T]) CompareAndSwap

func (t *TypedValue[T]) CompareAndSwap(old, new T) bool

func (*TypedValue[T]) Load

func (t *TypedValue[T]) Load() T

func (*TypedValue[T]) MarshalJSON

func (t *TypedValue[T]) MarshalJSON() ([]byte, error)

func (*TypedValue[T]) Store

func (t *TypedValue[T]) Store(value T)

func (*TypedValue[T]) Swap

func (t *TypedValue[T]) Swap(new T) T

func (*TypedValue[T]) UnmarshalJSON

func (t *TypedValue[T]) UnmarshalJSON(b []byte) error

type Uint32

type Uint32 struct {
	atomic.Uint32
}

func NewUint32

func NewUint32(val uint32) (i Uint32)

func (*Uint32) MarshalJSON

func (i *Uint32) MarshalJSON() ([]byte, error)

func (*Uint32) String

func (i *Uint32) String() string

func (*Uint32) UnmarshalJSON

func (i *Uint32) UnmarshalJSON(b []byte) error

type Uint64

type Uint64 struct {
	atomic.Uint64
}

func NewUint64

func NewUint64(val uint64) (i Uint64)

func (*Uint64) MarshalJSON

func (i *Uint64) MarshalJSON() ([]byte, error)

func (*Uint64) String

func (i *Uint64) String() string

func (*Uint64) UnmarshalJSON

func (i *Uint64) UnmarshalJSON(b []byte) error

type Uintptr

type Uintptr struct {
	atomic.Uintptr
}

func NewUintptr

func NewUintptr(val uintptr) (i Uintptr)

func (*Uintptr) MarshalJSON

func (i *Uintptr) MarshalJSON() ([]byte, error)

func (*Uintptr) String

func (i *Uintptr) String() string

func (*Uintptr) UnmarshalJSON

func (i *Uintptr) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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