...

Package xcontext

import "oss.terrastruct.com/util-go/xcontext"
Overview
Index

Overview ▾

Package xcontext implements indispensable context helpers.

func WithoutCancel

func WithoutCancel(ctx context.Context) context.Context

WithoutCancel returns a context derived from ctx that may never be cancelled.

func WithoutValues

func WithoutValues(ctx context.Context) context.Context

WithoutValues creates a new context derived from ctx that does not inherit its values but does pass on cancellation.

type Mutex

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

func NewMutex

func NewMutex() *Mutex

func (*Mutex) Lock

func (m *Mutex) Lock(ctx context.Context) error

func (*Mutex) TryLock

func (m *Mutex) TryLock() bool

func (*Mutex) Unlock

func (m *Mutex) Unlock()