service

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: ISC Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset added in v0.2.0

type Asset struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Label       string `json:"label"`
	State       string `json:"state"`
	Size        int    `json:"size"`
	ContentType string `json:"content_type"`
	DownloadURL string `json:"browser_download_url"`
}

Asset is the model for release assets

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, repo, tag 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
	Pull() 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 string, in ReleaseInput) (*Release, error)
	EditRelease(ctx context.Context, repo string, releaseID int, in ReleaseInput) (*Release, error)
	GetRelease(ctx context.Context, repo string, version SemVer) (*Release, error)
	GetReleases(ctx context.Context, repo string) ([]Release, error)
	GetLatestRelease(ctx context.Context, repo string) (*Release, error)
	UploadAssets(ctx context.Context, release *Release, assets ...string) error
}

Github is the interface for API calls to GitHub

func NewGithub

func NewGithub(token string) Github

NewGithub creates a new Github instance

type Release

type Release struct {
	ID         int     `json:"id"`
	Name       string  `json:"name"`
	TagName    string  `json:"tag_name"`
	Target     string  `json:"target_commitish"`
	Draft      bool    `json:"draft"`
	Prerelease bool    `json:"prerelease"`
	Body       string  `json:"body"`
	URL        string  `json:"url"`
	HTMLURL    string  `json:"html_url"`
	AssetsURL  string  `json:"assets_url"`
	UploadURL  string  `json:"upload_url"`
	Assets     []Asset `json:"assets"`
}

Release is the model for GitHub release

type ReleaseInput added in v0.1.9

type ReleaseInput struct {
	Name       string `json:"name"`
	TagName    string `json:"tag_name"`
	Target     string `json:"target_commitish"`
	Draft      bool   `json:"draft"`
	Prerelease bool   `json:"prerelease"`
	Body       string `json:"body"`
}

ReleaseInput is the model for creating and editing a 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