Documentation
¶
Overview ¶
Package api is Jokku's HTTP API. Every client, including the CLI and the git hook, goes through it; nothing else mutates state.
Index ¶
Constants ¶
View Source
const SourceDatabase = "database"
SourceDatabase is the deploy source of a database's compose file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Store *store.Store
Git *gitrepo.Manager
Deployer Deployer
Log *slog.Logger
// DataDir holds builds and other control-node files.
DataDir string
// Exe is the jokku binary path written into authorized_keys and hooks.
Exe string
// AuthorizedKeys is the jokku user's authorized_keys file. Empty disables
// syncing (local development).
AuthorizedKeys string
// Owner owns AuthorizedKeys; nil leaves ownership alone.
Owner *sshkeys.Owner
// Cluster is the control plane: nodes, placement, agents.
Cluster *cluster.Controller
}
type Deployer ¶
type Deployer interface {
// Deploy builds the source tarball at sourcePath and rolls it out,
// reporting progress through log as Dokku-style lines.
Deploy(ctx context.Context, d *types.Deploy, sourcePath string, log func(string)) error
// PS runs restart, start, stop or rebuild. Restart applies config,
// scale and resource changes.
PS(ctx context.Context, app, action, actor string, log func(string)) error
// Logs streams an app's log lines.
Logs(ctx context.Context, app string, o types.LogOptions, line func(string)) error
// RoutesChanged tells the runtime domains or proxy settings changed.
RoutesChanged()
}
Deployer turns sources into running releases and manages what runs.
type Server ¶
type Server struct {
Config
// contains filtered or unexported fields
}
Server serves two listeners: the unix socket gets the whole API (whoever can open it is an admin), and the TLS port (Public) only joining and the agent endpoints, each authenticated with a token.
Click to show internal directories.
Click to hide internal directories.