web

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 12 Imported by: 1 module, 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

View Source
const (
	ApplicationWebSocketPath = "/api/aop/application/ws"
	NodeWebSocketPath        = "/api/aop/node/ws"
)

Variables

View Source
var ErrConnectionClosed = errors.New("AOP connection closed")

Functions

func RegisterConnectServices added in v0.4.0

func RegisterConnectServices(mux *http.ServeMux, service Service)

RegisterConnectServices mounts management RPCs and the AOP bidirectional stream using only the unified Service abstraction. The handler negotiates Connect, gRPC and gRPC-Web on the same paths.

Types

type Auth added in v0.4.0

type Auth interface {
	Enabled() bool
	Authenticate(*http.Request) bool
	Middleware(http.Handler) http.Handler
	RegisterRoutes(*http.ServeMux)
	ShareWithIOA(string, http.Handler) http.Handler
}

Auth is the authentication mechanism required by Web transports. The concrete policy and credential state are owned by the service package.

type Connection added in v0.4.0

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

Connection is the root Web mechanism for one duplex EnvelopeStream. It owns exactly one reader and one FIFO writer; protocol and business state remain behind the Service abstraction.

func NewConnection added in v0.4.0

func NewConnection(parent context.Context, stream aop.EnvelopeStream) (*Connection, error)

func (*Connection) Close added in v0.4.0

func (c *Connection) Close()

func (*Connection) Context added in v0.4.0

func (c *Connection) Context() context.Context

func (*Connection) Run added in v0.4.0

func (c *Connection) Run(first *aop.Envelope, handler func(context.Context, *aop.Envelope, aop.SendFunc) error) (runErr error)

Run receives and dispatches envelopes until the stream, writer, handler, or context terminates. A non-nil first envelope is dispatched before Recv.

func (*Connection) Send added in v0.4.0

func (c *Connection) Send(envelope *aop.Envelope) error

Send serializes an envelope through the writer and waits for the underlying stream write. Concurrent callers are safe and cannot create parallel writes.

type Handler

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

func NewHandler

func NewHandler(service Service, ioaHandler http.Handler, static http.Handler) *Handler

func (*Handler) ServeHTTP

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

type Service

type Service interface {
	API() *managementapi.API
	Auth() Auth
	ServeApplication(context.Context, aop.EnvelopeStream) error
	ApplicationWebSocketHandler() http.Handler
	NodeWebSocketHandler() http.Handler
}

Service is the single transport-facing abstraction for AIScan Web. The root package owns only this contract and transport mechanisms; business runtime, persistence, agents and authentication live in pkg/web/service.

Directories

Path Synopsis
Package api implements AIScan's protocol-neutral Web management API.
Package api implements AIScan's protocol-neutral Web management API.
Package service defines the transport-facing Web service contract and the service-owned authentication component.
Package service defines the transport-facing Web service contract and the service-owned authentication component.

Jump to

Keyboard shortcuts

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