ctex

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogCanceled

func LogCanceled(ctx context.Context, action string)

func NewAfterFrame added in v0.18.0

func NewAfterFrame(ctx context.Context, inst string, group uint64) (context.Context, *shredder.AfterFrame)

func NewBatch added in v0.18.0

func NewBatch(ctx context.Context, id uint64) (context.Context, *shredder.ValveFrame)

func NewDetachedContext added in v0.18.0

func NewDetachedContext(ctx, runtime context.Context, fake bool) context.Context

func NewDocumentContext added in v0.18.0

func NewDocumentContext(ctx context.Context) context.Context

func NewInfectedContext added in v0.18.0

func NewInfectedContext(source, target context.Context) context.Context

func NewRenderContext added in v0.18.0

func NewRenderContext(system, user context.Context, keys WithValueKeys) context.Context

func NewReplaceContext added in v0.18.0

func NewReplaceContext(ctx context.Context) context.Context

func SyncFrameInsert added in v0.8.14

func SyncFrameInsert(ctx context.Context, sync shredder.ReleaseFrame, init shredder.ReleaseFrame) context.Context

func UserContext added in v0.18.0

func UserContext(ctx, parent context.Context) context.Context

Types

type Frames added in v0.8.14

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

func GetFrames added in v0.8.14

func GetFrames(ctx context.Context) Frames

func (Frames) AfterFrame added in v0.18.0

func (f Frames) AfterFrame() (*shredder.AfterFrame, bool)

func (Frames) Batch added in v0.18.0

func (f Frames) Batch() uint64

func (Frames) BatchFrame added in v0.18.0

func (f Frames) BatchFrame() (*shredder.ValveFrame, bool)

func (Frames) Call added in v0.10.0

func (f Frames) Call() shredder.Frame

func (Frames) Detached added in v0.18.0

func (f Frames) Detached() bool

func (Frames) Group added in v0.18.0

func (f Frames) Group() uint64

func (Frames) InitFrame added in v0.12.1

func (f Frames) InitFrame(ctx context.Context) shredder.ReleaseFrame

func (Frames) Inst added in v0.18.0

func (f Frames) Inst() string

func (Frames) Owner added in v0.18.0

func (f Frames) Owner() bool

func (Frames) Render added in v0.8.14

func (f Frames) Render() shredder.ReleaseFrame

func (Frames) Settle added in v0.18.0

func (f Frames) Settle() Frames

type Store

type Store = *store

Store is goroutine-safe key-value storage.

func NewStore

func NewStore() Store

NewStore returns an empty Store.

func (Store) Init

func (s Store) Init(key any, new func() any) any

Init returns the value stored under key, creating it with new if key is absent.

Init is single-flight: concurrent callers for the same key block until new returns. If new panics, the key is left absent.

func (Store) Load

func (s Store) Load(key any) any

Load returns the value stored under key, or nil if key is absent. It blocks while a concurrent Store.Init for the same key is still running.

func (Store) Remove

func (s Store) Remove(key any) any

Remove deletes the value stored under key and returns it, or nil if key was absent. It blocks while a concurrent Store.Init for the same key is still running.

func (Store) Save

func (s Store) Save(key any, value any) any

Save stores value under key and returns the previous value, or nil if key was absent. It blocks while a concurrent Store.Init for the same key is still running.

type WithValueKeys added in v0.18.0

type WithValueKeys interface {
	IsWithValueKey(key any) bool
}

Jump to

Keyboard shortcuts

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