appwire

package
v1.162.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package appwire assembles applications (#2411, #2412) from the platform's stores: the service the manage_application tool and the portal routes share, over the application store, the script and asset stores, the webhook sources and the live application database toolkit, and the bundler that exports and imports them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bundler

func Bundler(svc *appsvc.Service, d Deps) *appbundle.Bundler

Bundler builds the exporter and importer over svc.

func Kit

func Kit(reg *registry.Registry) func() appschema.Kit

Kit is the live application database toolkit, nil when none is registered.

func Live added in v1.153.2

Live is the application database toolkit in the live registry, nil when none is registered.

func Register

func Register(server *mcp.Server, d Deps) *appsvc.Service

Register assembles the service and the bundler and registers manage_application, returning the service for the portal routes. Nothing without a database.

func Service

func Service(d Deps) *appsvc.Service

Service builds the application service over deps, nil without a database.

Types

type Assets

type Assets interface {
	appsvc.Assets
	Insert(ctx context.Context, asset portaldomain.Asset) error
	List(ctx context.Context, filter portaldomain.AssetFilter) ([]portaldomain.Asset, int, error)
}

Assets is the portal asset store as applications use it.

type Deps

type Deps struct {
	DB            *sql.DB
	Assets        Assets
	AssetVersions Versions
	Toolkits      *registry.Registry

	// What a bundle is written to and read from, and where an imported
	// asset's content goes.
	Blobs interface {
		GetObject(ctx context.Context, bucket, key string) ([]byte, string, error)
		PutObject(ctx context.Context, bucket, key string, data []byte, contentType string) error
	}
	Bucket, Prefix string
	Lander         interface {
		LandResource(ctx context.Context, dest toolkit.ResourceDestination, content io.Reader, contentType string) (*toolkit.ResourceLanding, error)
	}
	Reader interface {
		Source(ctx context.Context, ref string, claims resource.Claims, limit int64) (string, error)
	}
	Claims func(ctx context.Context) resource.Claims
	// Handlers sets an imported script's handlers, as manage_script's
	// handler_set does (#2441).
	Handlers *scripthandler.Service
	// SaveGate is the gate a script's source save crosses, which an import
	// puts each script through (#2476); nil refuses importing a script.
	SaveGate appbundle.SaveGate
	// Recordings is the store the gate reads recordings from, which an
	// export writes a script's test recordings out of and an import stores
	// them in (#2476).
	Recordings scriptrec.Store
	// Sealer keeps an application's run-role password sealed (#2539); nil
	// adds no schema.
	Sealer appsvc.Sealer
	// Reach lists the application database connections an actor may hold a
	// schema on; nil adds no schema.
	Reach func(ctx context.Context, actor application.Actor) ([]string, error)
	// Sites reads a site part and points its environment at a release; nil
	// is a deployment with no sites. Every service built from Deps is given
	// it at construction, so the portal's and manage_application's agree
	// (#2613).
	Sites appsvc.Sites
}

Deps is what applications are assembled from.

type Versions

type Versions interface {
	portaldomain.VersionReader
	CreateVersion(ctx context.Context, version portaldomain.AssetVersion) (int, error)
}

Versions is the portal version store as applications use it.

Jump to

Keyboard shortcuts

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