service

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Name string
}

Branch is the model for a git branch

type Changelog

type Changelog interface {
	Filename() string
	Generate(ctx context.Context, gitTag string) (string, error)
}

Changelog is the interface for change log generation

func NewChangelog

func NewChangelog(workDir, githubToken string) Changelog

NewChangelog creates a new instance of Changelog

type Commit

type Commit struct {
	SHA      string
	ShortSHA string
}

Commit is the model for a git commit

type Git

type Git interface {
	IsClean() (bool, error)
	GetRepo() (*Repo, error)
	GetBranch() (*Branch, error)
	GetHEAD() (*Commit, error)
	Commit(message string, files ...string) error
	Tag(tag string) error
	Push(withTags bool) error
}

Git is the interface for a git client

func NewGit

func NewGit(workDir string) Git

NewGit creates a new git client

type Github

type Github interface {
	BranchProtectionForAdmin(ctx context.Context, repo, branch string, enabled bool) error
	CreateRelease(ctx context.Context, repo, branch string, version SemVer, description string, draf, prerelease bool) (*Release, error)
	GetRelease(ctx context.Context, repo string, version SemVer) (*Release, error)
	UploadAssets(ctx context.Context, repo string, version SemVer, assets []string) error
}

Github is the interface for API calls to GitHub

func NewGithub

func NewGithub(timeout time.Duration, token string) Github

NewGithub creates a new Github instance

type Release

type Release struct {
	ID         int    `json:"id"`
	Name       string `json:"name"`
	Draft      bool   `json:"draft"`
	Prerelease bool   `json:"prerelease"`
	URL        string `json:"url"`
	HTMLURL    string `json:"html_url"`
	AssetsURL  string `json:"assets_url"`
	UploadURL  string `json:"upload_url"`
}

Release is the model for GitHub release

type Repo

type Repo struct {
	Owner string
	Name  string
}

Repo is the model for a git repository

func (*Repo) Path

func (r *Repo) Path() string

Path returns the owner/name combination

type SemVer

type SemVer struct {
	Major int64
	Minor int64
	Patch int64
}

SemVer represents a semantic versioning

func ParseSemVer

func ParseSemVer(version string) (semver SemVer, err error)

ParseSemVer reads a semantic version string and returns a SemVer

func (SemVer) GitTag

func (v SemVer) GitTag() string

GitTag returns a string representation of semantic version to be used as a git tag

func (SemVer) PreRelease

func (v SemVer) PreRelease() string

PreRelease returns a string representation of semantic version to be used as a prelease version

func (SemVer) ReleaseMajor

func (v SemVer) ReleaseMajor() (current SemVer, next SemVer)

ReleaseMajor returns the current and next semantic versions for a major release

func (SemVer) ReleaseMinor

func (v SemVer) ReleaseMinor() (current SemVer, next SemVer)

ReleaseMinor returns the current and next semantic versions for a minor release

func (SemVer) ReleasePatch

func (v SemVer) ReleasePatch() (current SemVer, next SemVer)

ReleasePatch returns the current and next semantic versions for a patch release

func (SemVer) Version

func (v SemVer) Version() string

Version returns a string representation of semantic version

type VersionManager

type VersionManager interface {
	Read() (SemVer, error)
	Update(string) error
}

VersionManager is the interface for a semantic versioning manager

func NewJSONVersionManager

func NewJSONVersionManager(file string) VersionManager

NewJSONVersionManager creates a new version manager for a json version file (package.json)

func NewTextVersionManager

func NewTextVersionManager(file string) VersionManager

NewTextVersionManager creates a new version manager for a text version file

func NewVersionManager

func NewVersionManager(file string) (VersionManager, error)

NewVersionManager creates a new instance of version manager

Jump to

Keyboard shortcuts

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