Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Creator ¶
type Creator interface {
CreateNewRelease(ctx context.Context, relOpts *Options, artifactNames ...string) error
}
Creator exposes a function to create complete Github releases
func NewCreator ¶
func NewCreator(github GithubAPI, storage StorageAPI) Creator
NewCreator returns implementation of Creator interface
type FakeGithubAPIWrapper ¶
type FakeGithubAPIWrapper struct { Release *github.RepositoryRelease Assets []*github.ReleaseAsset AssetCount int TimesUploadFileCalled int }
FakeGithubAPIWrapper is a fake githubAPIWrapper for test purposes
func (*FakeGithubAPIWrapper) CreateGithubRelease ¶
func (fgaw *FakeGithubAPIWrapper) CreateGithubRelease(ctx context.Context, opts *Options) (*github.RepositoryRelease, *github.Response, error)
CreateGithubRelease is a fake implementation of CreateGithubRelease func
type FakeKymaVersionReader ¶
type FakeKymaVersionReader struct{}
FakeKymaVersionReader is a fake kymaVersionReader for test purposes
func (*FakeKymaVersionReader) ReadFromFile ¶
func (fkvr *FakeKymaVersionReader) ReadFromFile(filePath string) (string, bool, error)
ReadFromFile is a fake implementation of a ReadFromFile method
type FakeStorageAPIWrapper ¶
type FakeStorageAPIWrapper struct {
TimesReadBucketObjectCalled int
}
FakeStorageAPIWrapper is a fake storageAPIWrapper for test purposes
func (*FakeStorageAPIWrapper) ReadBucketObject ¶
func (fsaw *FakeStorageAPIWrapper) ReadBucketObject(ctx context.Context, fileName string) (io.ReadCloser, int64, error)
ReadBucketObject is a fake implementation of ReadBucketObject func
type GithubAPI ¶
type GithubAPI interface { CreateGithubRelease(ctx context.Context, opts *Options) (*github.RepositoryRelease, *github.Response, error) UploadContent(ctx context.Context, releaseID int64, artifactName string, reader io.Reader, size int64) (*github.Response, error) }
GithubAPI exposes functions to interact with Github releases
type Options ¶
type Options struct { Version string Body string TargetCommit string IsPreRelease bool // contains filtered or unexported fields }
Options represents the query options to create a Github release
func NewOptions ¶
func NewOptions(ctx context.Context, storage StorageAPI, releaseVersionFilePath, releaseChangelogName, commitish string, r VersionReader) (*Options, error)
NewOptions returns new instance of Options
type StorageAPI ¶
type StorageAPI interface {
ReadBucketObject(ctx context.Context, fileName string) (io.ReadCloser, int64, error)
}
StorageAPI exposes a function to read objects from Google Storage buckets
func NewStorageAPI ¶
func NewStorageAPI(ctx context.Context, bucketName string) (StorageAPI, error)
NewStorageAPI returns implementation of storageAPI
type VersionReader ¶
VersionReader wraps the ReadFromFile method that reads RELEASE_VERSION file
func NewVersionReader ¶
func NewVersionReader() VersionReader
NewVersionReader returns a ready-to-use implementation of VersionReadeer