Documentation
¶
Index ¶
- func DownloadAttachments(attachments []api.Attachment, id int, output string, ...) error
- func LoadConfigAndClient() (*config.Config, *api.Client, error)
- func ResolveProjectKey(cfg *config.Config, flag string) (string, error)
- func SaveFile(dir, name, fallback string, data []byte) (string, error)
- func StripControl(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAttachments ¶ added in v1.0.1
func DownloadAttachments(attachments []api.Attachment, id int, output string, dl func(int) (string, []byte, error)) error
DownloadAttachments saves the attachments (all of them, or only id when non-zero) using dl, and prints each saved path.
func LoadConfigAndClient ¶
LoadConfigAndClient loads the config file and creates an API client for the currently active space. Returns an error if not authenticated.
func ResolveProjectKey ¶ added in v1.0.1
ResolveProjectKey returns the --project flag value or the default project.
func SaveFile ¶ added in v1.0.1
SaveFile writes data into dir using only a sanitized base name of name, so a server-supplied name cannot escape dir. It never overwrites or follows an existing path: on collision it appends " (n)". fallback is used when name is unusable.
func StripControl ¶ added in v1.0.1
StripControl removes terminal control and bidi/format characters (see api.StripControl).
Types ¶
This section is empty.