callmark

package
v3.0.0-dev.5 Latest Latest
Warning

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

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

Documentation

Overview

Package callmark holds the request-context marks the root package sets or reads and the transport spends or sets: the write mark on a request that changes forge state, and the bound of reads one action may pass the mutation reserve with. The two packages cannot import each other, so the keys live here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionReadsLeft

func ActionReadsLeft(ctx context.Context) bool

ActionReadsLeft reports whether ctx carries a bound with a read left in it.

func IsWrite

func IsWrite(ctx context.Context) bool

IsWrite reports whether ctx carries WithWrite's mark.

func TakeActionRead

func TakeActionRead(ctx context.Context) bool

TakeActionRead spends one read of ctx's bound, and reports false where ctx carries none or it is spent.

func WithActionReads

func WithActionReads(ctx context.Context, n int) context.Context

WithActionReads gives ctx a bound of n reads, clamped to 1..[maxActionReads], shared by every request and goroutine under the returned context. A ctx that already carries a bound is returned unchanged, so a nested call cannot raise it.

func WithWrite

func WithWrite(ctx context.Context) context.Context

WithWrite marks ctx as the context of a request that changes forge state.

Types

This section is empty.

Jump to

Keyboard shortcuts

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