Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrReleaseNotFound = errors.New("release not found") ErrFileExists = errors.New("asset file already exist") )
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
ListReleases(owner, repo string, opt gitea.ListReleasesOptions) ([]*gitea.Release, *gitea.Response, error)
CreateRelease(owner, repo string, opt gitea.CreateReleaseOption) (*gitea.Release, *gitea.Response, error)
ListReleaseAttachments(user, repo string, release int64, opt gitea.ListReleaseAttachmentsOptions) ([]*gitea.Attachment, *gitea.Response, error)
CreateReleaseAttachment(user, repo string, release int64, file io.Reader, filename string) (*gitea.Attachment, *gitea.Response, error)
DeleteReleaseAttachment(user, repo string, release, id int64) (*gitea.Response, error)
}
type FileExists ¶
type FileExists string
const ( FileExistsOverwrite FileExists = "overwrite" FileExistsFail FileExists = "fail" FileExistsSkip FileExists = "skip" )
type Release ¶
type Release struct {
Opt ReleaseOptions
// contains filtered or unexported fields
}
func (*Release) AddAttachments ¶
AddAttachments uploads the specified files as attachments to the release with the given ID. It first checks for any existing attachments with the same names, and handles them according to the FileExists option:
- "overwrite": overwrites the existing attachment - "fail": returns an error if the file already exists - "skip": skips uploading the file and logs a warning
If there are no conflicts, it uploads the new files as attachments to the release.
Click to show internal directories.
Click to hide internal directories.