platforms

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubConfig

type GithubConfig struct {
	AppID          int64
	InstallationID int64
	PrivateKeyPath string
}

GithubConfig hold the Github configuration

type GitlabConfig

type GitlabConfig struct {
	Token         string
	WebhookSecret string
}

GitlabConfig hold the Gitlab configuration

type Issue added in v0.3.0

type Issue struct {
	ID    interface{}
	Title string
	Body  string
}

Issue contains the GRGate dashboard issue informations

type Platform

type Platform interface {
	CheckAllStatusSucceeded(string, string, string, []string) (bool, error)
	CreateFile(string, string, string, string, string, string) error
	UpdateFile(string, string, string, string, string, string) error
	CreateIssue(string, string, *Issue) error
	CreateRelease(string, string, *Release) (*Release, error)
	CreateRepository(string, string, string) error
	CreateStatus(string, string, *Status) error
	DeleteRepository(string, string) error
	GetStatus(string, string, string, string) (*Status, error)
	ListDraftReleases(string, string) ([]*Release, error)
	ListIssuesByAuthor(string, string, interface{}) ([]*Issue, error)
	ListReleases(string, string) ([]*Release, error)
	ListStatuses(string, string, string) ([]*Status, error)
	PublishRelease(string, string, *Release) (bool, error)
	ReadFile(string, string, string) (io.Reader, error)
	UpdateIssue(string, string, *Issue) error
	UpdateRelease(string, string, *Release) error
}

Platform interface Github and Gitlab

func NewGithub

func NewGithub(config *GithubConfig) (platform Platform, err error)

NewGithub returns an instance of platform

func NewGitlab

func NewGitlab(config *GitlabConfig) (platform Platform, err error)

NewGitlab returns an instance of platform

type Release

type Release struct {
	// CommitSha attached to the release
	CommitSha string

	// ID of the release, Github use an int, Gitlab use a string
	ID interface{}

	// Name of the release
	Name string

	// Platform, either github or gitlab
	Platform string

	// Tag associated to the release
	Tag string

	// ReleaseNote attached to the release
	ReleaseNote string

	// Draft represent the state of the release. For Gitlab it translates to a
	// future release
	Draft bool
}

Release represent a release regarding the platform

type Status

type Status struct {
	// CommitSha
	CommitSha string

	// Name of the status
	Name string

	// State is only used by Github checks, must be one of action_required,
	// cancelled, failure, neutral, success, skipped, stale, timed_out
	State string

	// Status the commit status:
	// For Github must be one of: queued, in_progress or completed
	// For Gitlab must be one of: pending, running, success, failed or cancelled
	Status string
}

Status contains commit status informations

Directories

Path Synopsis
Package mock_platforms is a generated GoMock package.
Package mock_platforms is a generated GoMock package.

Jump to

Keyboard shortcuts

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