cmd

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutputFormatText = "text"
	OutputFormatJSON = "json"
)

Variables

This section is empty.

Functions

func AddSetupControls

func AddSetupControls(parent *cobra.Command)

func AddSetupRepo

func AddSetupRepo(parent *cobra.Command)

func CheckAuth

func CheckAuth() (*auth.Authenticator, error)

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type AuditCommitResultJSON added in v0.7.0

type AuditCommitResultJSON struct {
	Commit            string      `json:"commit"`
	Status            string      `json:"status"`
	VerifiedLevels    []string    `json:"verified_levels,omitempty"`
	PrevCommitMatches *bool       `json:"prev_commit_matches,omitempty"`
	ProvControls      interface{} `json:"prov_controls,omitempty"`
	Controls          interface{} `json:"controls,omitempty"`
	PrevCommit        string      `json:"prev_commit,omitempty"`
	PriorCommit       string      `json:"prior_commit,omitempty"`
	Link              string      `json:"link,omitempty"`
	Error             string      `json:"error,omitempty"`
}

AuditCommitResultJSON represents a single commit audit result in JSON format

type AuditMode

type AuditMode int
const (
	AuditModeBasic AuditMode = 1
	AuditModeFull  AuditMode = 2
)

func (*AuditMode) Set

func (e *AuditMode) Set(v string) error

Set must have pointer receiver so it doesn't change the value of a copy

func (*AuditMode) String

func (e *AuditMode) String() string

Enable audit mode enum String is used both by fmt.Print and by Cobra in help text

func (*AuditMode) Type

func (e *AuditMode) Type() string

Type is only used in help text

type AuditResultJSON added in v0.7.0

type AuditResultJSON struct {
	Owner         string                  `json:"owner"`
	Repository    string                  `json:"repository"`
	Branch        string                  `json:"branch"`
	LatestCommit  string                  `json:"latest_commit"`
	CommitResults []AuditCommitResultJSON `json:"commit_results"`
	Summary       *AuditSummary           `json:"summary,omitempty"`
}

AuditResultJSON represents the full audit result in JSON format

type AuditSummary added in v0.7.0

type AuditSummary struct {
	TotalCommits  int `json:"total_commits"`
	PassedCommits int `json:"passed_commits"`
	FailedCommits int `json:"failed_commits"`
}

AuditSummary provides summary statistics for the audit

type VerifyCommitResult added in v0.7.0

type VerifyCommitResult struct {
	Success        bool     `json:"success"`
	Commit         string   `json:"commit"`
	Ref            string   `json:"ref"`
	RefType        string   `json:"ref_type"` // "branch" or "tag"
	Owner          string   `json:"owner"`
	Repository     string   `json:"repository"`
	VerifiedLevels []string `json:"verified_levels,omitempty"`
	Message        string   `json:"message,omitempty"`
}

VerifyCommitResult represents the result of a commit verification

func (VerifyCommitResult) String added in v0.7.0

func (v VerifyCommitResult) String() string

String implements fmt.Stringer for text output

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL