Documentation
¶
Index ¶
- Constants
- Variables
- func IsPortBindingConflict(err error) bool
- type Compose
- func (c Compose) Config(ctx context.Context, composeFile, envFile string) error
- func (c Compose) ConfigJSONProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) (string, error)
- func (c Compose) ConfigProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) ConfigProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) error
- func (c Compose) ConfigProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) DestroyProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) Down(ctx context.Context, composeFile, envFile string) error
- func (c Compose) DownProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) DownProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) error
- func (c Compose) DownProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) ExecProject(ctx context.Context, project, composeFile, envFile, service string, ...) (string, error)
- func (c Compose) ExecProjectFiles(ctx context.Context, project, workdir, service string, composeFiles []string, ...) (string, error)
- func (c Compose) ExecProjectInput(ctx context.Context, project, composeFile, envFile string, input []byte, ...) (string, error)
- func (c Compose) InspectProjectResource(ctx context.Context, project string, resource ProjectResource) (bool, error)
- func (c Compose) RunProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) RunningServicesProject(ctx context.Context, project, composeFile, envFile string) ([]string, error)
- func (c Compose) RunningServicesProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) ([]string, error)
- func (c Compose) RunningServicesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) ([]string, error)
- func (c Compose) ServiceStatesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) ([]ServiceState, error)
- func (c Compose) ServicesProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) ([]string, error)
- func (c Compose) ServicesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, ...) ([]string, error)
- func (c Compose) Status(ctx context.Context, composeFile, envFile string) (string, error)
- func (c Compose) StatusProject(ctx context.Context, project, composeFile, envFile string) (string, error)
- func (c Compose) StatusProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) (string, error)
- func (c Compose) StopProjectFilesSelected(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- func (c Compose) Up(ctx context.Context, composeFile, envFile string) error
- func (c Compose) UpProject(ctx context.Context, project, composeFile, envFile string) error
- func (c Compose) UpProjectFiles(ctx context.Context, project, workdir string, composeFiles ...string) error
- func (c Compose) UpProjectFilesSelected(ctx context.Context, project, workdir string, environment map[string]string, ...) error
- type Config
- type Files
- type Ports
- type ProjectResource
- type PublishedPort
- type ServiceState
Constants ¶
const ( DefaultPostgresPort = 5432 DefaultOpenBaoPort = 8200 )
Variables ¶
var ErrResourceOwnership = errors.New("runtime resource ownership does not match the application project")
var ErrRuntimeNotFound = errors.New("docker compose or podman compose not found")
Functions ¶
func IsPortBindingConflict ¶
IsPortBindingConflict reports whether a Docker/Podman Compose failure is a host-port allocation conflict. Runtime engines phrase the same condition differently, so keep the classifier deliberately narrow but multi-engine.
Types ¶
type Compose ¶
type Compose struct {
// contains filtered or unexported fields
}
Compose provides the small lifecycle surface BaseHarbor needs from a container runtime. Application code should not shell out to Docker/Podman directly.
func (Compose) ConfigJSONProjectFilesEnv ¶
func (Compose) ConfigProject ¶
func (Compose) ConfigProjectFiles ¶
func (Compose) ConfigProjectFilesEnv ¶
func (Compose) DestroyProject ¶
func (Compose) DownProject ¶
func (Compose) DownProjectFiles ¶
func (Compose) DownProjectFilesEnv ¶
func (Compose) ExecProject ¶
func (Compose) ExecProjectFiles ¶
func (Compose) ExecProjectInput ¶
func (c Compose) ExecProjectInput(ctx context.Context, project, composeFile, envFile string, input []byte, service string, args ...string) (string, error)
ExecProjectInput executes a command inside a Compose service while supplying stdin without placing that input in the host process argument list. It is intended for sensitive operator flows such as OpenBao unseal/authentication.
func (Compose) InspectProjectResource ¶
func (c Compose) InspectProjectResource(ctx context.Context, project string, resource ProjectResource) (bool, error)
InspectProjectResource verifies an exact runtime resource name before a destructive operation. A resource with the expected name but a different Compose project label is an ownership conflict, never an implicit match.
func (Compose) RunProjectFilesEnv ¶ added in v0.3.0
func (c Compose) RunProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, stdin io.Reader, stdout, stderr io.Writer, composeFiles []string, args ...string) error
RunProjectFilesEnv runs a Compose project command with caller-owned streams. It is used for interactive developer actions such as logs and workload shells without exposing container names to the caller.
func (Compose) RunningServicesProject ¶
func (Compose) RunningServicesProjectFiles ¶
func (Compose) RunningServicesProjectFilesEnv ¶
func (Compose) ServiceStatesProjectFilesEnv ¶ added in v0.3.0
func (c Compose) ServiceStatesProjectFilesEnv(ctx context.Context, project, workdir string, environment map[string]string, composeFiles ...string) ([]ServiceState, error)
ServiceStatesProjectFilesEnv returns Compose service state without exposing generated container names to application code. Modern Compose implementations expose JSON state including container health and published ports. Older compatible implementations fall back to the portable running-service query; in that case Health and Publishers remain empty rather than inventing state.
func (Compose) ServicesProjectFiles ¶
func (Compose) ServicesProjectFilesEnv ¶
func (Compose) StatusProject ¶
func (Compose) StatusProjectFiles ¶
func (Compose) StopProjectFilesSelected ¶
func (Compose) UpProjectFiles ¶
type Config ¶
type Config struct {
PostgresDB string
PostgresUser string
PostgresPassword string
PostgresPort int
OpenBaoPort int
}
func LoadConfig ¶
type ProjectResource ¶
type PublishedPort ¶ added in v0.3.0
PublishedPort is the provider-facing portion of a Compose publisher that is useful for local operational readiness. It deliberately contains no BaseHarbor-specific ingress model; it mirrors existing Compose runtime state.
type ServiceState ¶ added in v0.3.0
type ServiceState struct {
Service string
State string
Health string
Publishers []PublishedPort
}
ServiceState is the provider-facing runtime state BaseHarbor needs for truthful workload readiness. Health is empty when the service has no healthcheck or the Compose implementation cannot report one.
func (ServiceState) Ready ¶ added in v0.3.0
func (s ServiceState) Ready() bool
Ready reports whether the service is running and, when a health status is available, has reached a healthy terminal state.