Documentation
¶
Overview ¶
Package upload uploads local files to a project and returns the markdown references that embed them in an issue, merge request, or note.
Index ¶
Constants ¶
View Source
const StdinPath = "-"
Variables ¶
This section is empty.
Functions ¶
func Upload ¶
func Upload(ctx context.Context, ios *iostreams.IOStreams, client *gitlab.Client, projectPath string, attachments []Attachment) ([]string, error)
Upload uploads each attachment and returns a markdown reference to each, in order. On failure the error names the ones that did upload, so a retry can reuse them.
Types ¶
type Attachment ¶
type Attachment struct {
Name string
Open func() (io.ReadCloser, error)
}
Attachment is a local file to upload and reference from a markdown body.
func Attachments ¶
func Attachments(stdin io.Reader, paths []string) ([]Attachment, error)
Attachments resolves attachment paths, reading stdin for StdinPath. It fails before any upload starts, so a bad path leaves nothing uploaded.
Click to show internal directories.
Click to hide internal directories.