types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCLINoStoredToken = errors.New("no stored authentication token")

ErrCLINoStoredToken is returned when no stored authentication token is found. This is expected for CLI commands that do not require authentication (e.g. artifact init).

View Source
var ErrNoOIDCDefined = errors.New("OIDC is not defined")

ErrNoOIDCDefined is returned when OIDC is not defined. This is expected for CLI commands that do not require authentication (e.g. artifact init) and a user/extension does not define OIDC.

Functions

This section is empty.

Types

type AppOptions

type AppOptions struct {
	// DatabaseFactory is an optional function to create a database that adds new functionality.
	// The factory receives the base database and can run additional migrations.
	// If nil, uses the default PostgreSQL database.
	DatabaseFactory DatabaseFactory

	// ServiceFactory is an optional function to create a service that adds new functionality.
	// The factory receives the base service and should return an extended service.
	ServiceFactory ServiceFactory

	// DeploymentTargets registers additional deployment targets.
	// OSS provides built-in local runtimes; enterprise can register cloud providers.
	DeploymentTargets map[string]DeploymentTarget

	// ProviderPlatforms registers adapters for provider CRUD by provider platform type.
	ProviderPlatforms map[string]ProviderPlatformAdapter

	// DeploymentPlatforms registers adapters for deployment lifecycle by provider platform type.
	DeploymentPlatforms map[string]DeploymentPlatformAdapter

	// ExtraRoutes allows external integrations to register additional HTTP routes
	// using the same API instance and path prefix as OSS core routes.
	ExtraRoutes func(api huma.API, pathPrefix string)

	// OnServiceCreated is an optional callback that receives the created service
	// (potentially extended via ServiceFactory).
	OnServiceCreated func(service.RegistryService)

	// HTTPServerFactory is an optional function to create a server that adds new API routes.
	HTTPServerFactory HTTPServerFactory

	// OnHTTPServerCreated is an optional callback that receives the created server
	// (potentially extended via HTTPServerFactory).
	OnHTTPServerCreated func(Server)

	// UIHandler is an optional HTTP handler for serving a custom UI at the root path ("/").
	// If provided, this handler will be used instead of the default redirect to docs.
	// API routes will still take precedence over the UI handler.
	UIHandler http.Handler

	// AuthnProvider is an optional authentication provider.
	AuthnProvider auth.AuthnProvider

	// AuthzProvider is an optional authorization provider.
	AuthzProvider auth.AuthzProvider
}

AppOptions contains configuration for the registry app. All fields are optional and allow external developers to extend functionality.

This type is defined in pkg/registry and used by both pkg/registry/registry_app.go and internal/registry/registry_app.go to avoid circular dependencies.

type AsyncDeploymentTarget added in v0.2.0

type AsyncDeploymentTarget interface {
	DeploymentTarget
	GetLogs(ctx context.Context, deployment *models.Deployment) ([]string, error)
	Cancel(ctx context.Context, deployment *models.Deployment) error
}

AsyncDeploymentTarget extends DeploymentTarget with async job operations.

type CLIAuthnProvider added in v0.1.14

type CLIAuthnProvider interface {
	// Authenticate returns credentials for API calls.
	Authenticate(ctx context.Context) (token string, err error)
}

CLIAuthnProvider provides authentication for CLI commands. External libraries can implement this to support different auth mechanisms

type CLIAuthnProviderFactory added in v0.2.0

type CLIAuthnProviderFactory func(root *cobra.Command) (CLIAuthnProvider, error)

CLIAuthnProviderFactory is a function type that creates a CLI authentication provider. The factory optionally receives the root command, which can be used to access command-specific configuration (e.g. flags).

type DaemonConfig

type DaemonConfig struct {
	ProjectName    string // docker compose project name (default: "agentregistry")
	ContainerName  string // container name to check for running state (default: "agentregistry-server")
	ComposeYAML    string // docker-compose.yml content (default: embedded)
	DockerRegistry string // image registry (default: version.DockerRegistry)
	Version        string // image version (default: version.Version)
}

DaemonConfig allows customization of the default daemon manager

type DaemonManager

type DaemonManager interface {
	// IsRunning checks if the daemon is currently running
	IsRunning() bool
	// Start starts the daemon, blocking until it's ready
	Start() error
}

DaemonManager defines the interface for managing the CLI's backend daemon. External libraries can implement this to use their own orchestration.

type DatabaseFactory added in v0.1.14

type DatabaseFactory func(ctx context.Context, databaseURL string, baseDB database.Database, authz auth.Authorizer) (database.Database, error)

DatabaseFactory is a function type that creates a database implementation. This allows implementors to run additional migrations and wrap the database.

type DeploymentPlatformAdapter added in v0.2.0

type DeploymentPlatformAdapter interface {
	Platform() string
	SupportedResourceTypes() []string
	Deploy(ctx context.Context, req *models.Deployment) (*models.Deployment, error)
	Undeploy(ctx context.Context, deployment *models.Deployment) error
	GetLogs(ctx context.Context, deployment *models.Deployment) ([]string, error)
	Cancel(ctx context.Context, deployment *models.Deployment) error
	Discover(ctx context.Context, providerID string) ([]*models.Deployment, error)
}

DeploymentPlatformAdapter defines deployment behavior for a provider platform type. This is the intended long-term adapter contract for /v0/deployments dispatch.

type DeploymentTarget added in v0.2.0

type DeploymentTarget interface {
	Provider() string
	SupportedResourceTypes() []string
	Deploy(ctx context.Context, req *models.Deployment) (*models.Deployment, error)
	Undeploy(ctx context.Context, deployment *models.Deployment) error
}

DeploymentTarget defines deployment behavior for a provider platform type. OSS can provide built-ins while enterprise can register cloud platform handlers.

type Discoverer added in v0.2.0

type Discoverer interface {
	Discover(ctx context.Context, providerID string) ([]*models.Deployment, error)
}

Discoverer can be implemented by provider platform handlers that support discovery.

type EmptyResponse added in v0.1.19

type EmptyResponse struct {
	Message string `json:"message" doc:"Success message" example:"Operation completed successfully"`
}

EmptyResponse represents a simple success response with a message

type HTTPServerFactory

type HTTPServerFactory func(base Server, db database.Database) Server

HTTPServerFactory is a function type that creates a server implementation that adds new API routes and handlers.

The factory receives a Server interface and should return a Server after registering new routes using base.HumaAPI() or base.Mux().

type ProviderPlatformAdapter added in v0.2.0

type ProviderPlatformAdapter interface {
	Platform() string
	ListProviders(ctx context.Context) ([]*models.Provider, error)
	CreateProvider(ctx context.Context, in *models.CreateProviderInput) (*models.Provider, error)
	GetProvider(ctx context.Context, providerID string) (*models.Provider, error)
	UpdateProvider(ctx context.Context, providerID string, in *models.UpdateProviderInput) (*models.Provider, error)
	DeleteProvider(ctx context.Context, providerID string) error
}

ProviderPlatformAdapter defines provider CRUD behavior for a provider platform type.

type Response added in v0.1.19

type Response[T any] struct {
	Body T
}

Response is a generic wrapper for Huma responses Usage: Response[HealthBody] instead of HealthOutput

type Server

type Server interface {
	// HumaAPI returns the Huma API instance, allowing registration of new routes
	// that will appear in the OpenAPI documentation.
	HumaAPI() huma.API

	// Mux returns the HTTP ServeMux, allowing registration of custom HTTP handlers
	Mux() *http.ServeMux

	// Start begins listening for incoming HTTP requests
	Start() error

	// Shutdown gracefully shuts down the server
	Shutdown(ctx context.Context) error
}

Server represents the HTTP server and provides access to the Huma API and HTTP mux for registering new routes and handlers.

This interface allows external packages to extend the server functionality by adding new endpoints without accessing internal implementation details.

type ServiceFactory

type ServiceFactory func(base service.RegistryService) service.RegistryService

ServiceFactory is a function type that creates a service implementation. The base service is provided as input, and the factory should return a service that implements RegistryService (and optionally additional interfaces).

Jump to

Keyboard shortcuts

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