Documentation
¶
Overview ¶
Package cmdutil provides utility functions specifically for the Guppy CLI.
Index ¶
- func ContentPath(pathStr string) (cid.Cid, string, error)
- func MustGetClient(storePath string, options ...client.Option) *client.Client
- func MustGetConnection() uclient.Connection
- func MustGetIndexClient() (*indexclient.Client, ucan.Principal)
- func MustGetProof(path string) delegation.Delegation
- func MustGetReceiptsURL() *url.URL
- func ParseSize(s string) (uint64, error)
- type HandledCliError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentPath ¶
ContentPath parses a content path string and returns the CID and subpath. A content path can take several forms:
- /ipfs/<cid>[/<subpath>]
- ipfs://<cid>[/<subpath>]
- <cid>[/<subpath>]
The subpath is returned with no leading `/`. If no subpath is specified in the input, an empty string is returned for it.
func MustGetClient ¶
MustGetClient creates a new client suitable for the CLI, using stored data, if any. If proofs are provided, they will be added to the client, but the client will not save changes to disk to avoid storing them.
func MustGetConnection ¶
func MustGetConnection() uclient.Connection
func MustGetIndexClient ¶
func MustGetIndexClient() (*indexclient.Client, ucan.Principal)
func MustGetProof ¶
func MustGetProof(path string) delegation.Delegation
func MustGetReceiptsURL ¶
Types ¶
type HandledCliError ¶
type HandledCliError struct {
// contains filtered or unexported fields
}
HandledCliError is an error which has already been presented to the user. If a HandledCliError is returned from a command, the process should exit with a non-zero exit code, but no further error message should be printed.
func NewHandledCliError ¶
func NewHandledCliError(err error) HandledCliError
func (HandledCliError) Unwrap ¶
func (e HandledCliError) Unwrap() error