Documentation
¶
Overview ¶
Package cmd wires up the cobra command tree for the Truestamp CLI. The main entrypoint (cmd/truestamp/main.go) calls Execute; everything else here registers subcommands, flags, and the shared PersistentPreRunE that loads the resolved configuration into [appConfig].
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute() (err error)
Execute runs the root command. rootCmd sets SilenceErrors, which cobra honours for every command under it, so Execute is the single place errors reach stderr. A command that needs silent-on-error UX (e.g. `verify --silent`) returns errSilentFail instead of the real error to opt out of printing. The upgrade --check flow uses exitCodeErr to return a specific exit code without also printing an error line.
An unrecovered panic anywhere under rootCmd.Execute() is caught by the deferred recover below: the panic value and stack are written to the log file as a `command_end` record at error level (so a "the CLI crashed" support report has a forensic trail), the same stack is re-emitted on stderr in the runtime's default `panic: <value>\n\n <stack>` format so the operator sees what they would have seen without our wrapper, and the process exits with code 2 (matching the Go runtime's default panic exit code).
Types ¶
type InspectBlock ¶ added in v0.13.0
type InspectBlock struct {
ID string `json:"id"`
PreviousBlockHash string `json:"previous_block_hash"`
MerkleRoot string `json:"merkle_root"`
SigningKeyID string `json:"signing_key_id"`
MetadataKeys []string `json:"metadata_keys"`
}
InspectBlock describes a block map.
type InspectCommit ¶ added in v0.13.0
type InspectCommit struct {
Chain string `json:"chain"`
Network string `json:"network,omitempty"`
EpochMerkleRoot string `json:"epoch_merkle_root"`
EpochProof *InspectProof `json:"epoch_proof"`
TransactionHash string `json:"transaction_hash,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
Ledger *int `json:"ledger,omitempty"`
BlockHeight *int `json:"block_height,omitempty"`
OfflineEvidence []string `json:"offline_evidence,omitempty"`
}
InspectCommit describes a commitment entry.
type InspectKeyEvent ¶ added in v0.13.0
type InspectKeyEvent struct {
Block InspectBlock `json:"block"`
Type string `json:"type,omitempty"`
KeyID string `json:"key_id,omitempty"`
Sequence json.RawMessage `json:"sequence,omitempty"`
Commitments []InspectCommit `json:"commitments"`
}
InspectKeyEvent describes the signing key event.
type InspectProof ¶ added in v0.13.0
InspectProof describes a compact Merkle proof without walking it.
type InspectSubject ¶ added in v0.13.0
type InspectSubject struct {
ID string `json:"id"`
SigningKeyID string `json:"signing_key_id"`
ClaimsKeys []string `json:"claims_keys,omitempty"`
EntropyKeys []string `json:"entropy_keys,omitempty"`
CommittedWitnesses map[string]string `json:"committed_witnesses"`
CarriedWitnesses []string `json:"carried_witnesses"`
}
InspectSubject describes the subject map.
type InspectSummary ¶ added in v0.13.0
type InspectSummary struct {
Source string `json:"source"`
Format string `json:"format"`
Bytes int `json:"bytes"`
Version json.RawMessage `json:"version"`
Type string `json:"type"`
GeneratedAt string `json:"generated_at"`
PublicKey string `json:"public_key"`
KeyID string `json:"key_id,omitempty"`
Subject *InspectSubject `json:"subject,omitempty"`
InclusionProof *InspectProof `json:"inclusion_proof,omitempty"`
Block InspectBlock `json:"block"`
BlockPath []InspectBlock `json:"block_path,omitempty"`
Commitments []InspectCommit `json:"commitments"`
SigningKeyEvent *InspectKeyEvent `json:"signing_key_event,omitempty"`
}
InspectSummary is the machine-readable shape of `truestamp inspect`.
Source Files
¶
- auth.go
- beacons.go
- beacons_get.go
- beacons_list.go
- blocks.go
- codec.go
- config.go
- config_edit.go
- console.go
- convert.go
- convert_id.go
- convert_keyid.go
- convert_merkle.go
- convert_time.go
- entropy.go
- group.go
- hash.go
- help.go
- inspect.go
- internal_test_panic.go
- items.go
- items_create.go
- items_read.go
- keys.go
- limits.go
- output.go
- paging.go
- proofs.go
- proofs_convert.go
- proofs_get.go
- root.go
- schema.go
- teams.go
- teams_create.go
- teams_get.go
- teams_list.go
- teams_use.go
- upgrade.go
- verify.go
- version.go