release

package
v0.0.0-...-a4b4531 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

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

func (*FakeGithubAPIWrapper) UploadContent

func (fgaw *FakeGithubAPIWrapper) UploadContent(ctx context.Context, releaseID int64, artifactName string, reader io.Reader, size int64) (*github.Response, error)

UploadContent is a fake implementation of UploadContent 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

func NewGithubAPI

func NewGithubAPI(ctx context.Context, githubAccessToken, repoOwner, repoName string) GithubAPI

NewGithubAPI returns implementation of githubAPI

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

type VersionReader interface {
	ReadFromFile(filePath string) (string, bool, error)
}

VersionReader wraps the ReadFromFile method that reads RELEASE_VERSION file

func NewVersionReader

func NewVersionReader() VersionReader

NewVersionReader returns a ready-to-use implementation of VersionReadeer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL