Documentation
¶
Overview ¶
Package docker provisions services that fill declared slots: postgres, mysql, redis.
A provisioned service joins the app's private bundle. It is not exposed, not addressable from outside, and not shareable with another app (R-134) — sharing is expressed as two apps binding to one external target.
Index ¶
- Constants
- func Info() api.KindInfo
- type Adapter
- func (a *Adapter) Capabilities() api.ServicesCapabilities
- func (a *Adapter) Category() api.Category
- func (a *Adapter) Configure(_ context.Context, raw json.RawMessage) error
- func (a *Adapter) Destroy(_ context.Context, _ api.ServiceHandle) error
- func (a *Adapter) Dump(h api.ServiceHandle, t spec.SlotType) (api.DumpPlan, bool)
- func (a *Adapter) HealthCheck(_ context.Context) error
- func (a *Adapter) Kind() string
- func (a *Adapter) Provision(_ context.Context, req api.ProvisionRequest) (api.ProvisionResult, error)
- func (a *Adapter) Restore(_ context.Context, h api.ServiceHandle, _ io.Reader) error
- func (a *Adapter) Snapshot(_ context.Context, h api.ServiceHandle, _ io.Writer) error
- func (a *Adapter) Supports() []spec.SlotType
Constants ¶
const Kind = "docker"
Kind is the adapter kind.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter provisions in-bundle services.
It talks to no daemon. That is the whole design: a provisioned service is a workload like any other, so this adapter *plans* one and the runtime adapter runs it. Two consequences follow, and both are the point.
The service is reachable only from inside the app's private network, because that is the only network its workloads are on and nothing publishes a port (R-134). There is no code here that could accidentally expose it.
Its data is in a Pando volume, so it is recorded, backed up with the app, carried in the DR bundle, offered at delete and reclaimed afterwards — all by machinery that already exists and knows nothing about services (R-135).
func (*Adapter) Capabilities ¶
func (a *Adapter) Capabilities() api.ServicesCapabilities
Capabilities reports that provisioned data lives in the app's own volumes.
func (*Adapter) Destroy ¶
Destroy releases a provisioned service.
A no-op, and not a stub. The service is workloads and a volume inside the app's bundle; the runtime destroys the workloads with the bundle and the volume follows R-204 and R-135, which means it outlives the app on purpose and is reclaimed once it is backed up. Destroying it here would delete an app's database out from under the backup prompt that is about to offer it.
func (*Adapter) Dump ¶ added in v0.17.0
Dump is the engine's own dump and load for a database (R-423), run in the service's workload while it serves: pg_dump and mysqldump each read one transaction's view of the data, which a copy of the files under a running server is not (#344).
Load replaces what the dump holds, in one transaction where the engine has one, so an app connected during a restore reads the old data or the new and never half of each. Tables created since the dump are left alone.
Redis and MongoDB are copied with their volumes. Redis writes its dump file whole and renames it into place, so a copy holds its last save; MongoDB's tools are not in every image this adapter may be configured to run.
The password stays out of argv, which anything on the host can list: Postgres trusts its own socket in the official image, and MySQL's client reads MYSQL_PWD.
func (*Adapter) HealthCheck ¶
HealthCheck always passes.
There is nothing to reach: this adapter holds no connection and provisions by planning. The runtime adapter's health is what decides whether a provisioned service can actually start, and the planner already checks that.
func (*Adapter) Provision ¶
func (a *Adapter) Provision(_ context.Context, req api.ProvisionRequest) (api.ProvisionResult, error)
Provision plans one service instance.
Pure: no daemon call, no randomness beyond the password, and the same request twice produces the same shape. The caller stores the connection secret and hands the workloads and volumes to the runtime, which is what actually starts anything.
func (*Adapter) Snapshot ¶
Snapshot is not this adapter's job, and says so rather than returning empty.
Capabilities().DataInAppVolumes is true: the data is in a Pando volume that the backup path already snapshots. A caller reaching here has ignored the capability, and an empty tar would make that look like a service with no data — which is exactly the failure an operator discovers at restore time.
func (*Adapter) Supports ¶
Supports lists the slot types this adapter can fill.
Databases and caches, deliberately nothing else. S3 and SMTP are slot types Pando recognizes (R-130) and deliberately does not provision: standing up MinIO or an SMTP server is running infrastructure, which is what R-010 says Pando is not. Those slots are bound or literal, and the planner says so by name.