session

package
v0.3.0 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: 7 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithHTTPSession

func ContextWithHTTPSession(store Store) func(ctx context.Context, _ *http.Request) context.Context

func ContextWithStdioSession

func ContextWithStdioSession(ctx context.Context) context.Context

Types

type InMemorySession

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

func (*InMemorySession) GetWorkspace

func (h *InMemorySession) GetWorkspace(_ context.Context) (string, error)

func (*InMemorySession) SetWorkspace

func (h *InMemorySession) SetWorkspace(_ context.Context, s string) error

type RedisSession

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

func (*RedisSession) GetWorkspace

func (r *RedisSession) GetWorkspace(ctx context.Context) (string, error)

func (*RedisSession) SetWorkspace

func (r *RedisSession) SetWorkspace(ctx context.Context, s string) error

type Session

type Session interface {
	GetWorkspace(context.Context) (string, error)
	SetWorkspace(context.Context, string) error
}

func FromContext

func FromContext(ctx context.Context) Session

type StdioSession

type StdioSession struct{}

func (*StdioSession) GetWorkspace

func (h *StdioSession) GetWorkspace(_ context.Context) (string, error)

func (*StdioSession) SetWorkspace

func (h *StdioSession) SetWorkspace(_ context.Context, s string) error

type Store

type Store interface {
	Get(ctx context.Context, sessionID string) (Session, error)
}

func NewInMemoryStore

func NewInMemoryStore() Store

func NewRedisStore

func NewRedisStore(addr string) (Store, error)

Jump to

Keyboard shortcuts

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