v1

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package v1 contains the V1 API for ToolHive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientRouter added in v0.0.43

func ClientRouter(
	manager client.Manager,
	workloadManager workloads.Manager,
	groupManager groups.Manager,
) http.Handler

ClientRouter creates a new router for the client API.

func DiscoveryRouter added in v0.0.41

func DiscoveryRouter() http.Handler

DiscoveryRouter creates a new router for the client discovery API.

func GroupsRouter added in v0.2.3

func GroupsRouter(groupManager groups.Manager, workloadManager workloads.Manager, clientManager client.Manager) http.Handler

GroupsRouter creates a new GroupsRoutes instance.

func HealthcheckRouter

func HealthcheckRouter(containerRuntime rt.Runtime) http.Handler

HealthcheckRouter sets up healthcheck route.

func RegistryRouter added in v0.0.40

func RegistryRouter() http.Handler

RegistryRouter creates a new router for the registry API.

func SecretsRouter added in v0.0.48

func SecretsRouter() http.Handler

SecretsRouter creates a new router for the secrets API.

func VersionRouter

func VersionRouter() http.Handler

VersionRouter sets up the version route.

func WorkloadRouter added in v0.0.43

func WorkloadRouter(
	workloadManager workloads.Manager,
	containerRuntime runtime.Runtime,
	groupManager groups.Manager,
	debugMode bool,
) http.Handler

WorkloadRouter creates a new WorkloadRoutes instance.

Types

type ClientRoutes added in v0.0.43

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

ClientRoutes defines the routes for the client API.

type DiscoveryRoutes added in v0.0.41

type DiscoveryRoutes struct{}

DiscoveryRoutes defines the routes for the client discovery API.

type GroupsRoutes added in v0.2.3

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

GroupsRoutes defines the routes for group management.

type RegistryRoutes added in v0.0.40

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

RegistryRoutes defines the routes for the registry API.

func NewRegistryRoutes added in v0.3.0

func NewRegistryRoutes() *RegistryRoutes

NewRegistryRoutes creates a new RegistryRoutes with the default config provider

func NewRegistryRoutesWithProvider added in v0.3.0

func NewRegistryRoutesWithProvider(provider config.Provider) *RegistryRoutes

NewRegistryRoutesWithProvider creates a new RegistryRoutes with a custom config provider This is useful for testing

type RegistryType added in v0.2.5

type RegistryType string

RegistryType represents the type of registry

const (
	// RegistryTypeFile represents a local file registry
	RegistryTypeFile RegistryType = "file"
	// RegistryTypeURL represents a remote URL registry
	RegistryTypeURL RegistryType = "url"
	// RegistryTypeDefault represents a built-in registry
	RegistryTypeDefault RegistryType = "default"
)

type SecretsRoutes added in v0.0.48

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

SecretsRoutes defines the routes for the secrets API.

func NewSecretsRoutes added in v0.3.0

func NewSecretsRoutes() *SecretsRoutes

NewSecretsRoutes creates a new SecretsRoutes with the default config provider

func NewSecretsRoutesWithProvider added in v0.3.0

func NewSecretsRoutesWithProvider(provider config.Provider) *SecretsRoutes

NewSecretsRoutesWithProvider creates a new SecretsRoutes with a custom config provider

type UpdateRegistryRequest added in v0.2.4

type UpdateRegistryRequest struct {
	// Registry URL (for remote registries)
	URL *string `json:"url,omitempty"`
	// Local registry file path
	LocalPath *string `json:"local_path,omitempty"`
	// Allow private IP addresses for registry URL
	AllowPrivateIP *bool `json:"allow_private_ip,omitempty"`
}

UpdateRegistryRequest represents the request for updating a registry

@Description	Request containing registry configuration updates

type UpdateRegistryResponse added in v0.2.4

type UpdateRegistryResponse struct {
	// Status message
	Message string `json:"message"`
	// Registry type after update
	Type string `json:"type"`
}

UpdateRegistryResponse represents the response for updating a registry

@Description	Response containing update result

type WorkloadRoutes added in v0.0.43

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

WorkloadRoutes defines the routes for workload management.

type WorkloadService added in v0.3.0

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

WorkloadService handles business logic for workload operations

func NewWorkloadService added in v0.3.0

func NewWorkloadService(
	workloadManager workloads.Manager,
	groupManager groups.Manager,
	containerRuntime runtime.Runtime,
	debugMode bool,
) *WorkloadService

NewWorkloadService creates a new WorkloadService instance

func (*WorkloadService) BuildFullRunConfig added in v0.3.0

func (s *WorkloadService) BuildFullRunConfig(ctx context.Context, req *createRequest) (*runner.RunConfig, error)

BuildFullRunConfig builds a complete RunConfig

func (*WorkloadService) CreateWorkloadFromRequest added in v0.3.0

func (s *WorkloadService) CreateWorkloadFromRequest(ctx context.Context, req *createRequest) (*runner.RunConfig, error)

CreateWorkloadFromRequest creates a workload from a request

func (*WorkloadService) GetWorkloadNamesFromRequest added in v0.3.0

func (s *WorkloadService) GetWorkloadNamesFromRequest(ctx context.Context, req bulkOperationRequest) ([]string, error)

GetWorkloadNamesFromRequest gets workload names from either the names field or group

func (*WorkloadService) UpdateWorkloadFromRequest added in v0.3.0

func (s *WorkloadService) UpdateWorkloadFromRequest(ctx context.Context, name string, req *createRequest) (*runner.RunConfig, error)

UpdateWorkloadFromRequest updates a workload from a request

Jump to

Keyboard shortcuts

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