forked from drone/go-scm
-
Notifications
You must be signed in to change notification settings - Fork 84
/
release.go
67 lines (55 loc) · 1.88 KB
/
release.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package scm
import (
"context"
"time"
)
type (
// Release the release
Release struct {
ID int
Title string
Description string
Link string
Tag string
Commitish string
Draft bool
Prerelease bool
Created time.Time
Published time.Time
}
// ReleaseInput contains the information needed to create a release
ReleaseInput struct {
Title string
Description string
Tag string
Commitish string
Draft bool
Prerelease bool
}
// ReleaseListOptions provides options for querying a list of repository releases.
ReleaseListOptions struct {
Page int
Size int
Open bool
Closed bool
}
// ReleaseService provides access to creating, listing, updating, and deleting releases
ReleaseService interface {
// Find returns the release for the given number in the given repository
Find(context.Context, string, int) (*Release, *Response, error)
// FindByTag returns the release for the given tag in the given repository
FindByTag(context.Context, string, string) (*Release, *Response, error)
// List returns a list of releases in the given repository
List(context.Context, string, ReleaseListOptions) ([]*Release, *Response, error)
// Create creates a release in the given repository
Create(context.Context, string, *ReleaseInput) (*Release, *Response, error)
// Update updates a release in the given repository
Update(context.Context, string, int, *ReleaseInput) (*Release, *Response, error)
// Update updates a release in the given repository by tag
UpdateByTag(context.Context, string, string, *ReleaseInput) (*Release, *Response, error)
// Delete deletes a release in the given repository
Delete(context.Context, string, int) (*Response, error)
// Delete deletes a release in the given repository by tag
DeleteByTag(context.Context, string, string) (*Response, error)
}
)