Help us shape the future of Go! Take the 2026 Go Developer Survey

step

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: ISC Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitHubURL is the BaseURL for GitHub.
	GitHubURL = "https://github.com"

	// GitHubAPIURL is the BaseURL for GitHub API.
	GitHubAPIURL = "https://api.github.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangelogGenerate

type ChangelogGenerate struct {
	Mock          Step
	WorkDir       string
	GitHubToken   string
	GitHubUser    string
	GitHubProject string
	Tag           string
	Result        struct {
		Filename  string
		Changelog string
	}
}

ChangelogGenerate runs `github_changelog_generator` Ruby gem!

func (*ChangelogGenerate) Dry

func (s *ChangelogGenerate) Dry(ctx context.Context) error

Dry is a dry run of the step

func (*ChangelogGenerate) Revert

func (s *ChangelogGenerate) Revert(ctx context.Context) error

Revert reverts back an executed step

func (*ChangelogGenerate) Run

func (s *ChangelogGenerate) Run(ctx context.Context) error

Run executes the step

type GitAdd

type GitAdd struct {
	Mock    Step
	WorkDir string
	Files   []string
}

GitAdd runs `git add <files>` command.

func (*GitAdd) Dry

func (s *GitAdd) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitAdd) Revert

func (s *GitAdd) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitAdd) Run

func (s *GitAdd) Run(ctx context.Context) error

Run executes the step.

type GitCommit

type GitCommit struct {
	Mock    Step
	WorkDir string
	Message string
}

GitCommit runs `git commit -m <message>` command.

func (*GitCommit) Dry

func (s *GitCommit) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitCommit) Revert

func (s *GitCommit) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitCommit) Run

func (s *GitCommit) Run(ctx context.Context) error

Run executes the step.

type GitGetBranch

type GitGetBranch struct {
	Mock    Step
	WorkDir string
	Result  struct {
		Name string
	}
}

GitGetBranch runs `git rev-parse --abbrev-ref HEAD` command.

func (*GitGetBranch) Dry

func (s *GitGetBranch) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitGetBranch) Revert

func (s *GitGetBranch) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitGetBranch) Run

func (s *GitGetBranch) Run(ctx context.Context) error

Run executes the step.

type GitGetHEAD

type GitGetHEAD struct {
	Mock    Step
	WorkDir string
	Result  struct {
		SHA      string
		ShortSHA string
	}
}

GitGetHEAD runs `git rev-parse HEAD` command.

func (*GitGetHEAD) Dry

func (s *GitGetHEAD) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitGetHEAD) Revert

func (s *GitGetHEAD) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitGetHEAD) Run

func (s *GitGetHEAD) Run(ctx context.Context) error

Run executes the step.

type GitGetRepo

type GitGetRepo struct {
	Mock    Step
	WorkDir string
	Result  struct {
		Owner string
		Name  string
		Repo  string
	}
}

GitGetRepo runs `git remote -v` command.

func (*GitGetRepo) Dry

func (s *GitGetRepo) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitGetRepo) Revert

func (s *GitGetRepo) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitGetRepo) Run

func (s *GitGetRepo) Run(ctx context.Context) error

Run executes the step.

type GitHubAsset

type GitHubAsset 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"`
	URL         string `json:"url"`
	DownloadURL string `json:"browser_download_url"`
}

GitHubAsset represents an asset for a GitHub release.

type GitHubBranchProtection

type GitHubBranchProtection struct {
	Mock    Step
	Client  *http.Client
	Token   string
	BaseURL string
	Repo    string
	Branch  string
	Enabled bool
}

GitHubBranchProtection enables/disables branch protection for administrators. See https://developer.github.com/v3/repos/branches/#get-admin-enforcement-of-protected-branch See https://developer.github.com/v3/repos/branches/#add-admin-enforcement-of-protected-branch See https://developer.github.com/v3/repos/branches/#remove-admin-enforcement-of-protected-branch

func (*GitHubBranchProtection) Dry

Dry is a dry run of the step.

func (*GitHubBranchProtection) Revert

Revert reverts back an executed step.

func (*GitHubBranchProtection) Run

Run executes the step.

type GitHubCreateRelease

type GitHubCreateRelease struct {
	Mock        Step
	Client      *http.Client
	Token       string
	BaseURL     string
	Repo        string
	ReleaseData GitHubReleaseData
	Result      struct {
		Release GitHubRelease
	}
}

GitHubCreateRelease creates a new GitHub release. See https://developer.github.com/v3/repos/releases/#get-the-latest-release See https://developer.github.com/v3/repos/releases/#create-a-release See https://developer.github.com/v3/repos/releases/#delete-a-release

func (*GitHubCreateRelease) Dry

Dry is a dry run of the step.

func (*GitHubCreateRelease) Revert

func (s *GitHubCreateRelease) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitHubCreateRelease) Run

Run executes the step.

type GitHubDownloadAsset

type GitHubDownloadAsset struct {
	Mock      Step
	Client    *http.Client
	Token     string
	BaseURL   string
	Repo      string
	Tag       string
	AssetName string
	Filepath  string
	Result    struct {
		Size int64
	}
}

GitHubDownloadAsset downloads an asset file and writes to a local file.

func (*GitHubDownloadAsset) Dry

Dry is a dry run of the step.

func (*GitHubDownloadAsset) Revert

func (s *GitHubDownloadAsset) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitHubDownloadAsset) Run

Run executes the step.

type GitHubEditRelease

type GitHubEditRelease struct {
	Mock        Step
	Client      *http.Client
	Token       string
	BaseURL     string
	Repo        string
	ReleaseID   int
	ReleaseData GitHubReleaseData
	Result      struct {
		Release GitHubRelease
	}
}

GitHubEditRelease edits an existing GitHub release. See https://developer.github.com/v3/repos/releases/#get-a-single-release See https://developer.github.com/v3/repos/releases/#edit-a-release

func (*GitHubEditRelease) Dry

func (s *GitHubEditRelease) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitHubEditRelease) Revert

func (s *GitHubEditRelease) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitHubEditRelease) Run

func (s *GitHubEditRelease) Run(ctx context.Context) error

Run executes the step.

type GitHubGetLatestRelease

type GitHubGetLatestRelease struct {
	Mock    Step
	Client  *http.Client
	Token   string
	BaseURL string
	Repo    string
	Result  struct {
		LatestRelease GitHubRelease
	}
}

GitHubGetLatestRelease gets the latest release. See https://developer.github.com/v3/repos/releases/#get-the-latest-release

func (*GitHubGetLatestRelease) Dry

Dry is a dry run of the step.

func (*GitHubGetLatestRelease) Revert

Revert reverts back an executed step.

func (*GitHubGetLatestRelease) Run

Run executes the step.

type GitHubRelease

type GitHubRelease 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     []GitHubAsset `json:"assets"`
}

GitHubRelease represents a GitHub release.

type GitHubReleaseData

type GitHubReleaseData 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"`
}

GitHubReleaseData is used for creating or modifying a release.

type GitHubUploadAssets

type GitHubUploadAssets struct {
	Mock             Step
	Client           *http.Client
	Token            string
	BaseURL          string
	Repo             string
	ReleaseID        int
	ReleaseUploadURL string
	AssetFiles       []string
	Result           struct {
		Assets []GitHubAsset
	}
}

GitHubUploadAssets uploads assets (files) to GitHub for a release. See https://developer.github.com/v3/repos/releases/#list-assets-for-a-release See https://developer.github.com/v3/repos/releases/#upload-a-release-asset See https://developer.github.com/v3/repos/releases/#delete-a-release-asset

func (*GitHubUploadAssets) Dry

Dry is a dry run of the step

func (*GitHubUploadAssets) Revert

func (s *GitHubUploadAssets) Revert(ctx context.Context) error

Revert reverts back an executed step

func (*GitHubUploadAssets) Run

Run executes the step

type GitPull

type GitPull struct {
	Mock    Step
	WorkDir string
}

GitPull runs `git pull` command.

func (*GitPull) Dry

func (s *GitPull) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitPull) Revert

func (s *GitPull) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitPull) Run

func (s *GitPull) Run(ctx context.Context) error

Run executes the step.

type GitPush

type GitPush struct {
	Mock    Step
	WorkDir string
}

GitPush runs `git push` command.

func (*GitPush) Dry

func (s *GitPush) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitPush) Revert

func (s *GitPush) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitPush) Run

func (s *GitPush) Run(ctx context.Context) error

Run executes the step.

type GitPushTag

type GitPushTag struct {
	Mock    Step
	WorkDir string
	Tag     string
}

GitPushTag runs `git push origin <tag>` command.

func (*GitPushTag) Dry

func (s *GitPushTag) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitPushTag) Revert

func (s *GitPushTag) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitPushTag) Run

func (s *GitPushTag) Run(ctx context.Context) error

Run executes the step.

type GitStatus

type GitStatus struct {
	Mock    Step
	WorkDir string
	Result  struct {
		IsClean bool
	}
}

GitStatus runs `git status --porcelain` command.

func (*GitStatus) Dry

func (s *GitStatus) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitStatus) Revert

func (s *GitStatus) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitStatus) Run

func (s *GitStatus) Run(ctx context.Context) error

Run executes the step.

type GitTag

type GitTag struct {
	Mock       Step
	WorkDir    string
	Tag        string
	Annotation string
}

GitTag runs `git tag` or `git tag -a <tag> -m <message>` command.

func (*GitTag) Dry

func (s *GitTag) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GitTag) Revert

func (s *GitTag) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GitTag) Run

func (s *GitTag) Run(ctx context.Context) error

Run executes the step.

type GoBuild

type GoBuild struct {
	Mock       Step
	WorkDir    string
	LDFlags    string
	MainFile   string
	BinaryFile string
	Platforms  []string
	Result     struct {
		Binaries []string
	}
}

GoBuild runs `go build ...` command.

func (*GoBuild) Dry

func (s *GoBuild) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GoBuild) Revert

func (s *GoBuild) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GoBuild) Run

func (s *GoBuild) Run(ctx context.Context) error

Run executes the step.

type GoList

type GoList struct {
	Mock    Step
	WorkDir string
	Package string
	Result  struct {
		PackagePath string
	}
}

GoList runs `go list ...` command.

func (*GoList) Dry

func (s *GoList) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GoList) Revert

func (s *GoList) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GoList) Run

func (s *GoList) Run(ctx context.Context) error

Run executes the step.

type GoVersion

type GoVersion struct {
	Mock    Step
	WorkDir string
	Result  struct {
		Version string
	}
}

GoVersion runs `go version` command.

func (*GoVersion) Dry

func (s *GoVersion) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*GoVersion) Revert

func (s *GoVersion) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*GoVersion) Run

func (s *GoVersion) Run(ctx context.Context) error

Run executes the step.

type SemVerRead

type SemVerRead struct {
	Mock     Step
	WorkDir  string
	Filename string
	Result   struct {
		Filename string
		Version  semver.SemVer
	}
}

SemVerRead reads version from version file.

func (*SemVerRead) Dry

func (s *SemVerRead) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*SemVerRead) Revert

func (s *SemVerRead) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*SemVerRead) Run

func (s *SemVerRead) Run(ctx context.Context) error

Run executes the step.

type SemVerUpdate

type SemVerUpdate struct {
	Mock     Step
	WorkDir  string
	Filename string
	Version  string
	Result   struct {
		Filename string
	}
}

SemVerUpdate writes a version to version file.

func (*SemVerUpdate) Dry

func (s *SemVerUpdate) Dry(ctx context.Context) error

Dry is a dry run of the step.

func (*SemVerUpdate) Revert

func (s *SemVerUpdate) Revert(ctx context.Context) error

Revert reverts back an executed step.

func (*SemVerUpdate) Run

func (s *SemVerUpdate) Run(ctx context.Context) error

Run executes the step.

type Step

type Step interface {
	Dry(context.Context) error
	Run(context.Context) error
	Revert(context.Context) error
}

Step is an atomic piece of functionality that can be reverted.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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