-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsource.go
More file actions
33 lines (28 loc) · 672 Bytes
/
source.go
File metadata and controls
33 lines (28 loc) · 672 Bytes
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
package selfupdate
import (
"context"
"io"
"time"
)
// Source interface to load the releases from (GitHubSource for example)
type Source interface {
ListReleases(ctx context.Context, repository Repository) ([]SourceRelease, error)
DownloadReleaseAsset(ctx context.Context, rel *Release, assetID int64) (io.ReadCloser, error)
}
type SourceRelease interface {
GetID() int64
GetTagName() string
GetDraft() bool
GetPrerelease() bool
GetPublishedAt() time.Time
GetReleaseNotes() string
GetName() string
GetURL() string
GetAssets() []SourceAsset
}
type SourceAsset interface {
GetID() int64
GetName() string
GetSize() int
GetBrowserDownloadURL() string
}