Skip to content

Commit

Permalink
Remove doc links.
Browse files Browse the repository at this point in the history
Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
  • Loading branch information
ncruces committed Apr 6, 2024
1 parent 727f599 commit 9bcc7a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions experimental/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ type Snapshotter interface {
// The context.Context passed to a exported function invocation should have this key set
// to a non-nil value, and host functions will be able to retrieve it using SnapshotterKey.
//
// Deprecated: use [WithSnapshotter] to enable snapshots.
// Deprecated: use WithSnapshotter to enable snapshots.
type EnableSnapshotterKey = ctxkey.EnableSnapshotterKey

// WithSnapshotter enables snapshots.
// Passing the returned context to a exported function invocation enables snapshots,
// and allows host functions to retrieve the [Snapshotter] using [SnapshotterKey].
// and allows host functions to retrieve the Snapshotter using SnapshotterKey.
func WithSnapshotter(ctx context.Context) context.Context {
return context.WithValue(ctx, ctxkey.EnableSnapshotterKey{}, struct{}{})
}

// SnapshotterKey is a context key to access a Snapshotter from a host function.
// It is only present if EnableSnapshotter was set in the function invocation context.
//
// Deprecated: use [GetSnapshotter] to get the snapshotter.
// Deprecated: use GetSnapshotter to get the snapshotter.
type SnapshotterKey = ctxkey.SnapshotterKey

// GetSnapshotter gets the [Snapshotter] from a host function.
// It is only present if [WithSnapshotter] was called with the function invocation context.
// GetSnapshotter gets the Snapshotter from a host function.
// It is only present if WithSnapshotter was called with the function invocation context.
func GetSnapshotter(ctx context.Context) Snapshotter {
return ctx.Value(ctxkey.SnapshotterKey{}).(Snapshotter)
}
4 changes: 2 additions & 2 deletions experimental/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ type StackIterator interface {
// FunctionListenerFactoryKey is a context.Context Value key.
// Its associated value should be a FunctionListenerFactory.
//
// Deprecated: use [WithSnapshotter] to enable snapshots.
// Deprecated: use WithFunctionListenerFactory to enable snapshots.
type FunctionListenerFactoryKey = ctxkey.FunctionListenerFactoryKey

// WithFunctionListenerFactory registers a [FunctionListenerFactory]
// WithFunctionListenerFactory registers a FunctionListenerFactory
// with the context.
func WithFunctionListenerFactory(ctx context.Context, factory FunctionListenerFactory) context.Context {
return context.WithValue(ctx, ctxkey.FunctionListenerFactoryKey{}, factory)
Expand Down

0 comments on commit 9bcc7a0

Please sign in to comment.