simple_chat_api

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package simple_chat_api exposes Simple Chat over the network: the CRUD RPCs of artel_api.SimpleChatAPI here, and the live turn WebSocket in chat_ws.go. The two halves live in one package so the wire contract for a chat thread stays in one place.

Index

Constants

View Source
const (
	// ChatWsRoutePattern is the http.ServeMux pattern this handler is registered under in
	// internal/app/custom.go.
	//
	// It sits under "/api/" on purpose: the session cookie this handler authenticates with is
	// scoped to middleware.CookiePath ("/api/"), so a route outside that prefix would never
	// receive it. Being more specific than the grpc-gateway's "/api/simple-chats/" subtree
	// pattern, http.ServeMux routes a matching request here rather than to the gateway.
	ChatWsRoutePattern = "/api/simple-chats/{chatId}/ws"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatWsHandler

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

ChatWsHandler serves the live Simple Chat turn exchange. It speaks the same chatprotocol.Event envelope as the Docker workbench's in-container bridge, so the web client reuses its existing chat components unchanged — but the agent runs in this process rather than in a container.

Unlike the workbench bridge there is no in-memory backlog or JSONL replay: a reconnecting client rebuilds history from Postgres via the GetSimpleChat RPC, so this handler only ever streams events for turns it is currently running.

func NewChatWsHandler

func NewChatWsHandler(authSvc chatAuthService, simpleChatSvc service.SimpleChatService) *ChatWsHandler

func (*ChatWsHandler) ServeHTTP

func (h *ChatWsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SimpleChatImpl

type SimpleChatImpl struct {
	artel_api.UnimplementedSimpleChatAPIServer
	// contains filtered or unexported fields
}

func New

func New(simpleChatSvc service.SimpleChatService) *SimpleChatImpl

func (*SimpleChatImpl) CreateSimpleChat

func (*SimpleChatImpl) DeleteSimpleChat

func (*SimpleChatImpl) Gateway

func (s *SimpleChatImpl) Gateway(
	ctx context.Context, endpoint string, opts ...grpc.DialOption,
) (string, http.Handler)

func (*SimpleChatImpl) GetSimpleChat

func (*SimpleChatImpl) ListSimpleChats

func (*SimpleChatImpl) Register

func (s *SimpleChatImpl) Register(srv grpc.ServiceRegistrar)

Jump to

Keyboard shortcuts

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