slackcontext

package
v0.0.0-...-8c45bc1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package slackcontext defines getters and setters for execution-scoped values that are propagated through context.Context during the execution of a Slack command. These values may include unique identifiers, session metadata, host information, version details, and other execution data.

All values should be set in the context before a Slack command begins execution. The values can then be accessed throughout the command's execution lifecycle using the provided getter methods.

Each value is stored with an unexported key type to prevent collisions with other packages using context values. The package provides type-safe accessors for retrieving these values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockContext

func MockContext(ctx context.Context) context.Context

MockContext sets values in the context that are guaranteed to exist before the Cobra root command is executed.

func SessionID

func SessionID(ctx context.Context) (string, error)

SessionID returns the session ID associated with `ctx`, or `""` and `slackerror.ErrContextValueNotFound` if no session ID could be found.

func SetProjectID

func SetProjectID(ctx context.Context, projectID string) context.Context

SetProjectID returns a new `context.Context` that holds a reference to the `projectID` and sets the `project_id` attribute on the span in `ctx`.

func SetSessionID

func SetSessionID(ctx context.Context, sessionID string) context.Context

SetSessionID returns a new `context.Context` that holds a reference to the `sessionID`.

func SetSystemID

func SetSystemID(ctx context.Context, systemID string) context.Context

SetSystemID returns a new `context.Context` that holds a reference to the `systemID` and sets the `system_id` attribute on the span in `ctx`.

func SetTraceID

func SetTraceID(ctx context.Context, traceID string) context.Context

func SetVersion

func SetVersion(ctx context.Context, version string) context.Context

SetVersion adds the slack-cli version to Golang context for trace logging

func TraceID

func TraceID(ctx context.Context) (string, error)

func Version

func Version(ctx context.Context) (string, error)

Version returns the CLI version associated with `ctx`. If the version is not found in the context, it falls back to version.Raw() and returns an error to signal that the context was not properly initialized.

Types

This section is empty.

Jump to

Keyboard shortcuts

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