Documentation
¶
Index ¶
- Constants
- Variables
- func CloneArray[S ~[]E, E any](s S) S
- func SafeDeref[T any](t *T) T
- func WithContext(ctx context.Context, fn func() error, onStop ...func()) (err error)
- func WithContextPool(ctx context.Context, fn func() error, pool chan struct{}, onStop ...func()) (err error)
- type Arc
- type Enum
- type Error
- type Mutex
- type Nothing
- type Option
- type Pair
- type Result
- func (Result[V]) Err(err *Error) Result[V]
- func (Result[V]) ErrNew(code, extCode int, msg string) Result[V]
- func (Result[V]) ErrNewUnknown(msg string) Result[V]
- func (r Result[V]) Error() *Error
- func (r *Result[V]) Expect(msg string) V
- func (r Result[V]) IsErr() bool
- func (r Result[V]) IsOk() bool
- func (Result[V]) Ok(value V) Result[V]
- func (r Result[V]) Switch() switchOption
- func (r Result[V]) Unwrap() V
- func (r Result[V]) UnwrapOrDefault() V
- func (r Result[V]) UnwrapOrElse(fn func(err Error) V) V
- type RwLock
- type Scoped
- type SecureMutexLocked
- type SecureMutexUnlocked
- type Tuple
- type Variant
Constants ¶
View Source
const ( IsOk switchOption = true IsErr switchOption = false )
Variables ¶
View Source
var (
ErrMutexIsLocked = NewError(0, 0, "mutex is locked")
)
Functions ¶
func CloneArray ¶
func CloneArray[S ~[]E, E any](s S) S
func WithContext ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func NewErrorUnknown ¶ added in v0.0.6
func (*Error) ExtendedCode ¶
func (Error) MarshalJSON ¶
func (*Error) UnmarshalJSON ¶
type Mutex ¶
type Mutex[V any] struct { // contains filtered or unexported fields }
func (*Mutex[V]) SetWithLock ¶ added in v0.0.4
func (m *Mutex[V]) SetWithLock(fn func(v V) V)
func (*Mutex[V]) UpdateWithLock ¶ added in v0.0.4
func (m *Mutex[V]) UpdateWithLock(fn func(v *V))
type Option ¶
type Option[V any] struct { // contains filtered or unexported fields }
func (Option[V]) UnwrapOrDefault ¶
func (o Option[V]) UnwrapOrDefault() V
func (Option[V]) UnwrapOrElse ¶
func (o Option[V]) UnwrapOrElse(fn func() V) V
type Result ¶
type Result[V any] struct { // contains filtered or unexported fields }
func (Result[V]) ErrNewUnknown ¶ added in v0.0.6
func (Result[V]) UnwrapOrDefault ¶
func (r Result[V]) UnwrapOrDefault() V
func (Result[V]) UnwrapOrElse ¶
type RwLock ¶
type RwLock[V any] struct { // contains filtered or unexported fields }
func (*RwLock[V]) RTryBorrow ¶
func (*RwLock[V]) WTryBorrow ¶
type Scoped ¶
type Scoped interface {
Lock() func()
}
func NewDebugScopedLock ¶
func NewDebugScopedLock(log ...func()) Scoped
func NewScopedLock ¶
func NewScopedLock() Scoped
type SecureMutexLocked ¶ added in v0.0.3
type SecureMutexLocked[V any] struct { // contains filtered or unexported fields }
func (SecureMutexLocked[V]) Unlock ¶ added in v0.0.3
func (m SecureMutexLocked[V]) Unlock() SecureMutexUnlocked[V]
type SecureMutexUnlocked ¶ added in v0.0.3
type SecureMutexUnlocked[V any] struct { // contains filtered or unexported fields }
func NewSecureMutex ¶ added in v0.0.3
func NewSecureMutex[V any](v V) SecureMutexUnlocked[V]
func (SecureMutexUnlocked[V]) Lock ¶ added in v0.0.3
func (m SecureMutexUnlocked[V]) Lock() SecureMutexLocked[V]
Source Files
¶
Click to show internal directories.
Click to hide internal directories.