Documentation
¶
Overview ¶
Package publish is `anfra publish`: a local repo's files published to its org, as PUBLISH.md (anfra-cloud) describes. The command wires it to the terminal (Env); its messages name the command's flags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Out, ErrOut io.Writer
Ask Prompt
// Validate validates the repo here, before anything is sent: showing what
// fails on its writer, and an error refusing the publish. Always, and again on
// the server, whose verdict on exactly the published files is the one that
// publishes (PUBLISH.md §Decisions).
Validate func(context.Context, io.Writer) error
// Credential checks the selected login before destination configuration is
// saved, returning an authorizer that resolves credentials for every request.
Credential func(context.Context, cloudapi.Org) (func(*http.Request) error, error)
// SelectOrg explicitly selects a first destination; nil means no interactive terminal.
SelectOrg func(context.Context) (cloudapi.Org, error)
// RecoverOrg offers interactive recovery after credential loading fails.
// It must return the original error when recovery does not apply, and confirm
// any destination change before returning a different organization.
RecoverOrg func(context.Context, cloudapi.Org, error) (cloudapi.Org, error)
// UserAgent names the CLI and its version, for the server.
UserAgent string
}
Env is what a publish needs from the command around it.
type Options ¶
type Options struct {
// Message is what the publish is, for the org's history of the repo; "" is
// HEAD's commit, in a git repo.
Message string
// SetOrg is an org's address to record as the repo's, and publish to.
SetOrg string
// DryRun lists the files and stops.
DryRun bool
// Yes publishes without asking, though the repo was last published elsewhere.
Yes bool
// CreateDataSources adds the data sources the repo uses and the org lacks
// without asking.
CreateDataSources bool
}
Options are a publish's choices: the command's flags.
Click to show internal directories.
Click to hide internal directories.