Documentation
¶
Overview ¶
Package sdk is how dokku-datastore is embedded. The dokku-datastore binary runs it with Run, and a dokku plugin serving every datastore under a single command, such as `dokku datastore:create postgres lollipop`, builds its commands, subcommands and triggers binaries around RunCommands, RunSubcommand and RunTrigger.
Index ¶
- Constants
- func Commands(ctx context.Context, meta command.Meta) map[string]cli.CommandFactory
- func Run(input RunInput) int
- func RunCommands(args []string) int
- func RunSubcommand(name string, args []string) int
- func RunTrigger(name string, args []string) int
- func SubcommandNames() []string
- func TriggerNames() []string
- func Types() []string
- func Version() string
- type RunInput
Constants ¶
const AppName = "dokku-datastore"
AppName is the name of the cli tool
const Namespace = "datastore"
Namespace is the dokku command every datastore is reached through by the plugin serving all of them
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run executes a command of the binary, as the dokku-datastore cli does, and returns its exit code
func RunCommands ¶
RunCommands answers whatever dokku hands the plugin's commands binary: the help it asks every plugin for, and any of the plugin's commands it found no subcommand for, which is what a datastore's own commands are.
func RunSubcommand ¶
RunSubcommand runs one of a datastore's commands the way dokku's subcommands binary is asked for it: name is the command, from the binary's file name, and args are what dokku passed after the command itself, starting with the datastore type, as in `create postgres lollipop`.
func RunTrigger ¶
RunTrigger runs a dokku trigger for every datastore no per-datastore plugin serves, the way dokku runs a plugin's trigger binary: name is the trigger, from the binary's file name, and args are what dokku passed it. It stops at the first datastore that fails, as dokku stops at the first plugin that does.
func SubcommandNames ¶
func SubcommandNames() []string
SubcommandNames are the commands every datastore may implement, which is what an embedding plugin links a subcommand for. A datastore's own commands are not among them: they are reached through RunCommands.
func TriggerNames ¶
func TriggerNames() []string
TriggerNames are the dokku triggers an embedding plugin links a trigger for: the ones every datastore implements, install and update, and every one a datastore's definitions declare