context

package
v0.1.15-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package context provides internal context helpers for MCP sessions.

Index

Constants

View Source
const (
	SNCloudOrganizationContextKey contextKey = "sncloud_organization"
	SNCloudInstanceContextKey     contextKey = "sncloud_instance"
	SNCloudClusterContextKey      contextKey = "sncloud_cluster"
	SNCloudSessionContextKey      contextKey = "sncloud_session"
	PulsarSessionContextKey       contextKey = "pulsar_session"
	KafkaSessionContextKey        contextKey = "kafka_session"
)

Context keys for StreamNative sessions and identifiers.

Variables

This section is empty.

Functions

func GetKafkaSession

func GetKafkaSession(ctx context.Context) *kafka.Session

GetKafkaSession gets the Kafka session from the context

func GetPulsarSession

func GetPulsarSession(ctx context.Context) *pulsar.Session

GetPulsarSession gets the Pulsar session from the context

func GetSNCloudCluster

func GetSNCloudCluster(ctx context.Context) string

GetSNCloudCluster gets the SNCloud cluster from the context

func GetSNCloudInstance

func GetSNCloudInstance(ctx context.Context) string

GetSNCloudInstance gets the SNCloud instance from the context

func GetSNCloudOrganization

func GetSNCloudOrganization(ctx context.Context) string

GetSNCloudOrganization gets the SNCloud organization from the context

func GetSNCloudSession

func GetSNCloudSession(ctx context.Context) *config.Session

GetSNCloudSession gets the SNCloud session from the context

func WithKafkaSession

func WithKafkaSession(ctx context.Context, session *kafka.Session) context.Context

WithKafkaSession sets the Kafka session in the context

func WithPulsarSession

func WithPulsarSession(ctx context.Context, session *pulsar.Session) context.Context

WithPulsarSession sets the Pulsar session in the context

func WithSNCloudCluster

func WithSNCloudCluster(ctx context.Context, cluster string) context.Context

WithSNCloudCluster sets the SNCloud cluster in the context

func WithSNCloudInstance

func WithSNCloudInstance(ctx context.Context, instance string) context.Context

WithSNCloudInstance sets the SNCloud instance in the context

func WithSNCloudOrganization

func WithSNCloudOrganization(ctx context.Context, organization string) context.Context

WithSNCloudOrganization sets the SNCloud organization in the context

func WithSNCloudSession

func WithSNCloudSession(ctx context.Context, session *config.Session) context.Context

WithSNCloudSession sets the SNCloud session in the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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