session

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

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