Documentation
¶
Overview ¶
Package service provides lifecycle management for individual nSelf optional services (start, stop, restart, ps, update, scale). All operations delegate to `docker compose` via the internal/docker package — no raw docker invocations.
Index ¶
- func ComposeDeclaresService(dir, name string) bool
- func Restart(ctx context.Context, serviceName string) error
- func Scale(ctx context.Context, serviceName string, replicas int) error
- func Start(ctx context.Context, serviceName string) error
- func Stop(ctx context.Context, serviceName string) error
- func Update(ctx context.Context, serviceName string) error
- type PSEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeDeclaresService ¶ added in v1.4.15
ComposeDeclaresService reports whether the project's docker-compose.yml in dir declares a service called name. An unreadable or unparsable file reports false, so the compose call that follows surfaces the real error.
func Scale ¶
Scale adjusts the replica count for a named service via `docker compose up -d --scale <service>=<n> <service>`. Replicas must be >= 1.
func Start ¶
Start starts a named nSelf service via `docker compose up -d --no-deps <service>`. The service must be configured in the stack (docker-compose.yml must exist).