Documentation
¶
Overview ¶
Package client is what the repo commands that call giantswarm-repo-manager share: the muster token from the keychain, the manager client over the person's muster endpoint, the output flag, and the text renderers of the answers the verbs have in common. Each verb is one tool of the manager; `-o json` prints the tool's answer as it came.
Index ¶
- Constants
- Variables
- func Decode[T any](tool string, payload json.RawMessage) (*T, error)
- func Indent(s, prefix string) string
- func IsInvalidFlag(err error) bool
- func IsUnexpectedAnswer(err error) bool
- func PrintCommitted(w io.Writer, c *manager.Committed)
- func PrintFindings(w io.Writer, findings []manager.Finding)
- func PrintJSON(w io.Writer, payload json.RawMessage) error
- func PrintPendingRun(w io.Writer, p *manager.PendingRun)
- func PrintPlan(w io.Writer, plan *manager.Plan)
- func PrintRecord(w io.Writer, r *manager.Record)
- func PrintSteps(w io.Writer, res *reconcile.Result)
- func Repository(arg string) (string, error)
- func Verdict(res *reconcile.Result) string
- func WriteArgs(args map[string]any, dryRun bool) map[string]any
- type Flags
- type Opener
- type Session
Constants ¶
const ( OutputText = "text" OutputJSON = "json" )
The output formats.
Variables ¶
var InvalidFlagError = µerror.Error{
Kind: "invalidFlagError",
}
InvalidFlagError is a flag or argument the command cannot use.
var UnexpectedAnswerError = µerror.Error{
Kind: "unexpectedAnswerError",
}
UnexpectedAnswerError is an answer of the manager devctl cannot read.
Functions ¶
func Decode ¶
func Decode[T any](tool string, payload json.RawMessage) (*T, error)
Decode reads a tool's answer into the manager's type.
func IsUnexpectedAnswer ¶
IsUnexpectedAnswer asserts UnexpectedAnswerError.
func PrintCommitted ¶
PrintCommitted writes a write's outcome in mode commit.
func PrintFindings ¶
PrintFindings writes the record's findings with their fix and source.
func PrintJSON ¶
func PrintJSON(w io.Writer, payload json.RawMessage) error
PrintJSON writes the answer as it came, indented.
func PrintPendingRun ¶
func PrintPendingRun(w io.Writer, p *manager.PendingRun)
PrintPendingRun writes the reconciler run a record expects.
func PrintRecord ¶
PrintRecord writes an inventory record: the declaration, the reality on GitHub, CircleCI, the CI configuration, Renovate, the catalog and the mapping, the set-up state with its steps and runs, and the findings.
func PrintSteps ¶
PrintSteps writes the engine's steps the way `repo status` does: step, verdict, summary, then the changes a repair would make and the findings with their fix.
func Repository ¶
Repository checks the [OWNER/]NAME argument; the manager takes the name with or without the organisation.
Types ¶
type Flags ¶
type Flags struct {
Output string
}
Flags are the flags every manager-backed verb takes.
type Session ¶
type Session struct {
Caller manager.Caller
Endpoint string
// Login is the account the muster token acts as, as the sign-in read it.
Login string
}
Session is the manager reached as the person: the muster token of the keychain on every call.