Versions in this module Expand all Collapse all v1 v1.0.0 Aug 2, 2026 Changes in this version + const ErrCodeInternal + const ErrCodeInvalidParams + const ErrCodeInvalidReq + const ErrCodeMethodNotFound + const ErrCodeParse + func HandleMessage(raw []byte, session Session, methods map[string]Handler) []byte + func MarshalNotification(n Notification) ([]byte, error) + type BaseSession struct + func NewBaseSession(id, workspaceID string) *BaseSession + func (s *BaseSession) Get(key string) (any, bool) + func (s *BaseSession) ID() string + func (s *BaseSession) Set(key string, value any) + func (s *BaseSession) WorkspaceID() string + type Handler func(session Session, params json.RawMessage) (any, *RPCError) + type Notification struct + JSONRPC string + Method string + Params any + type RPCError struct + Code int + Data any + Message string + type Request struct + ID json.RawMessage + JSONRPC string + Method string + Params json.RawMessage + type Response struct + Error *RPCError + ID json.RawMessage + JSONRPC string + Result any + type Session interface + Get func(key string) (any, bool) + ID func() string + Set func(key string, value any) + WorkspaceID func() string