Documentation ¶
Index ¶
- func TestGetMyTypeValue(t *testing.T)
- func TestMultiMustSetMyTypeValue(t *testing.T)
- func TestMultiSetMyTypeValue(t *testing.T)
- func TestMustGetMyTypeValue(t *testing.T)
- func TestMustSetMyTypeValue(t *testing.T)
- func TestSetMyTypeValue(t *testing.T)
- func TestSyncMultiSetMyTypeValue(t *testing.T)
- type OnceBool
- type OnceComplex128
- type OnceComplex64
- type OnceFloat32
- type OnceFloat64
- type OnceInt
- type OnceInt16
- type OnceInt32
- type OnceInt64
- type OnceInt8
- type OnceMyType
- type OnceString
- type OnceUint
- type OnceUint16
- type OnceUint32
- type OnceUint64
- type OnceUint8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestGetMyTypeValue ¶
func TestMultiSetMyTypeValue ¶
func TestMustGetMyTypeValue ¶
func TestMustSetMyTypeValue ¶
func TestSetMyTypeValue ¶
Types ¶
type OnceBool ¶
type OnceBool struct {
// contains filtered or unexported fields
}
OnceBool wraps a bool and enforces at runtime that the value is set at most once.
func (*OnceBool) MustSetValue ¶
MustSetValue sets the value of the bool to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceBool) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set
type OnceComplex128 ¶
type OnceComplex128 struct {
// contains filtered or unexported fields
}
OnceComplex128 wraps a complex128 and enforces at runtime that the value is set at most once.
func (*OnceComplex128) MustSetValue ¶
func (o *OnceComplex128) MustSetValue(value complex128)
MustSetValue sets the value of the complex128 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceComplex128) MustValue ¶
func (o *OnceComplex128) MustValue() complex128
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceComplex128) SetValue ¶
func (o *OnceComplex128) SetValue(value complex128) error
SetValue sets the value of the complex128 to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceComplex128) Value ¶
func (o *OnceComplex128) Value() (retval complex128, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceComplex64 ¶
type OnceComplex64 struct {
// contains filtered or unexported fields
}
OnceComplex64 wraps a complex64 and enforces at runtime that the value is set at most once.
func (*OnceComplex64) MustSetValue ¶
func (o *OnceComplex64) MustSetValue(value complex64)
MustSetValue sets the value of the complex64 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceComplex64) MustValue ¶
func (o *OnceComplex64) MustValue() complex64
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceComplex64) SetValue ¶
func (o *OnceComplex64) SetValue(value complex64) error
SetValue sets the value of the complex64 to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceComplex64) Value ¶
func (o *OnceComplex64) Value() (retval complex64, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceFloat32 ¶
type OnceFloat32 struct {
// contains filtered or unexported fields
}
OnceFloat32 wraps a float32 and enforces at runtime that the value is set at most once.
func (*OnceFloat32) MustSetValue ¶
func (o *OnceFloat32) MustSetValue(value float32)
MustSetValue sets the value of the float32 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceFloat32) MustValue ¶
func (o *OnceFloat32) MustValue() float32
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceFloat32) SetValue ¶
func (o *OnceFloat32) SetValue(value float32) error
SetValue sets the value of the float32 to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceFloat32) Value ¶
func (o *OnceFloat32) Value() (retval float32, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceFloat64 ¶
type OnceFloat64 struct {
// contains filtered or unexported fields
}
OnceFloat64 wraps a float64 and enforces at runtime that the value is set at most once.
func (*OnceFloat64) MustSetValue ¶
func (o *OnceFloat64) MustSetValue(value float64)
MustSetValue sets the value of the float64 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceFloat64) MustValue ¶
func (o *OnceFloat64) MustValue() float64
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceFloat64) SetValue ¶
func (o *OnceFloat64) SetValue(value float64) error
SetValue sets the value of the float64 to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceFloat64) Value ¶
func (o *OnceFloat64) Value() (retval float64, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceInt ¶
type OnceInt struct {
// contains filtered or unexported fields
}
OnceInt wraps a int and enforces at runtime that the value is set at most once.
func (*OnceInt) MustSetValue ¶
MustSetValue sets the value of the int to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceInt) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set
type OnceInt16 ¶
type OnceInt16 struct {
// contains filtered or unexported fields
}
OnceInt16 wraps a int16 and enforces at runtime that the value is set at most once.
func (*OnceInt16) MustSetValue ¶
MustSetValue sets the value of the int16 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceInt16) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set
type OnceInt32 ¶
type OnceInt32 struct {
// contains filtered or unexported fields
}
OnceInt32 wraps a int32 and enforces at runtime that the value is set at most once.
func (*OnceInt32) MustSetValue ¶
MustSetValue sets the value of the int32 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceInt32) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set
type OnceInt64 ¶
type OnceInt64 struct {
// contains filtered or unexported fields
}
OnceInt64 wraps a int64 and enforces at runtime that the value is set at most once.
func (*OnceInt64) MustSetValue ¶
MustSetValue sets the value of the int64 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceInt64) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set
type OnceInt8 ¶
type OnceInt8 struct {
// contains filtered or unexported fields
}
OnceInt8 wraps a int8 and enforces at runtime that the value is set at most once.
func (*OnceInt8) MustSetValue ¶
MustSetValue sets the value of the int8 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceInt8) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set
type OnceMyType ¶
type OnceMyType struct {
// contains filtered or unexported fields
}
OnceMyType wraps a myType and enforces at runtime that the value is set at most once.
func (*OnceMyType) MustSetValue ¶
func (o *OnceMyType) MustSetValue(value myType)
MustSetValue sets the value of the myType to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceMyType) MustValue ¶
func (o *OnceMyType) MustValue() myType
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceMyType) SetValue ¶
func (o *OnceMyType) SetValue(value myType) error
SetValue sets the value of the myType to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceMyType) Value ¶
func (o *OnceMyType) Value() (retval myType, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceString ¶
type OnceString struct {
// contains filtered or unexported fields
}
OnceString wraps a string and enforces at runtime that the value is set at most once.
func (*OnceString) MustSetValue ¶
func (o *OnceString) MustSetValue(value string)
MustSetValue sets the value of the string to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceString) MustValue ¶
func (o *OnceString) MustValue() string
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceString) SetValue ¶
func (o *OnceString) SetValue(value string) error
SetValue sets the value of the string to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceString) Value ¶
func (o *OnceString) Value() (retval string, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceUint ¶
type OnceUint struct {
// contains filtered or unexported fields
}
OnceUint wraps a uint and enforces at runtime that the value is set at most once.
func (*OnceUint) MustSetValue ¶
MustSetValue sets the value of the uint to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set
type OnceUint16 ¶
type OnceUint16 struct {
// contains filtered or unexported fields
}
OnceUint16 wraps a uint16 and enforces at runtime that the value is set at most once.
func (*OnceUint16) MustSetValue ¶
func (o *OnceUint16) MustSetValue(value uint16)
MustSetValue sets the value of the uint16 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint16) MustValue ¶
func (o *OnceUint16) MustValue() uint16
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceUint16) SetValue ¶
func (o *OnceUint16) SetValue(value uint16) error
SetValue sets the value of the uint16 to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint16) Value ¶
func (o *OnceUint16) Value() (retval uint16, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceUint32 ¶
type OnceUint32 struct {
// contains filtered or unexported fields
}
OnceUint32 wraps a uint32 and enforces at runtime that the value is set at most once.
func (*OnceUint32) MustSetValue ¶
func (o *OnceUint32) MustSetValue(value uint32)
MustSetValue sets the value of the uint32 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint32) MustValue ¶
func (o *OnceUint32) MustValue() uint32
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceUint32) SetValue ¶
func (o *OnceUint32) SetValue(value uint32) error
SetValue sets the value of the uint32 to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint32) Value ¶
func (o *OnceUint32) Value() (retval uint32, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceUint64 ¶
type OnceUint64 struct {
// contains filtered or unexported fields
}
OnceUint64 wraps a uint64 and enforces at runtime that the value is set at most once.
func (*OnceUint64) MustSetValue ¶
func (o *OnceUint64) MustSetValue(value uint64)
MustSetValue sets the value of the uint64 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint64) MustValue ¶
func (o *OnceUint64) MustValue() uint64
MustValue returns the value stored in the cell or panics if it has not yet been set
func (*OnceUint64) SetValue ¶
func (o *OnceUint64) SetValue(value uint64) error
SetValue sets the value of the uint64 to the provided value. This function will return an error if called more than once. This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint64) Value ¶
func (o *OnceUint64) Value() (retval uint64, err error)
Value returns the value stored in the cell or an error if it has not yet been set
type OnceUint8 ¶
type OnceUint8 struct {
// contains filtered or unexported fields
}
OnceUint8 wraps a uint8 and enforces at runtime that the value is set at most once.
func (*OnceUint8) MustSetValue ¶
MustSetValue sets the value of the uint8 to the provided value. This function will panic if the value has already been set This is thread-safe as the isSet flag is atomically set, thus ensuring that no two callers can check the flag at the same time.
func (*OnceUint8) MustValue ¶
MustValue returns the value stored in the cell or panics if it has not yet been set