gateway

package
v0.0.0-...-1b58e50 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ghp for GitHub personal access tokens.
	GitHubPersonalAccessToken = "ghp_"

	// gho for OAuth access tokens.
	GitHubOAuth = "gho_"

	// ghu for GitHub user-to-server tokens.
	GitHubUserToServer = "ghu_"
)

GitHub access token types typically used with the REST API see https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/

View Source
const (
	// glpat- for GitLab personal access tokens.
	GitLabPersonalAccessToken = "glpat-"

	// gloas- for GitLab OAuth Application Secret.
	GitLabOAuthApplicationSecret = "gloas-"

	// gldt- for GitLab Deploy Token.
	GitLabDeployToken = "gldt-"

	// glrt- for GitLab Runner Authentication Token.
	GitLabRunnerAuthenticationToken = "glrt-"

	// glcbt- for GitLab CI/CD Job Token.
	GitLabCICDJobToken = "glcbt-"

	// glptt- for GitLab Trigger Token.
	GitLabTriggerToken = "glptt-"

	// glft- for GitLab Feed Token.
	GitLabFeedToken = "glft-"

	// glimt- for GitLab Incoming Mail Token.
	GitLabIncomingMailToken = "glimt-"

	// glagent- for GitLab Agent for Kubernetes Token.
	GitLabAgentForKubernetesToken = "glagent-"

	// glsoat- for GitLab SCIM Token.
	GitLabSCIMToken = "glsoat-"
)

GitLab access token types typically used with the REST API see https://docs.gitlab.com/ee/security/token_overview.html#token-prefixes

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetPipelineBySha(id, sha string) (*Pipeline, error)
	GetPipeline(id string, pid int) (*Pipeline, error)
	IsStatusPending(status string) bool
}

func New

func New(token string, t ProviderType) (
	Client,
	error,
)

func NewFromRemoteURL

func NewFromRemoteURL(token, remoteURL string) (
	Client,
	error,
)

func NewFromToken

func NewFromToken(token string) (
	Client,
	error,
)

type GitHubClient

type GitHubClient struct {
	// contains filtered or unexported fields
}

func NewGitHubClient

func NewGitHubClient(token string) (*GitHubClient, error)

func (*GitHubClient) GetPipeline

func (c *GitHubClient) GetPipeline(id string, pid int) (*Pipeline, error)

func (*GitHubClient) GetPipelineBySha

func (c *GitHubClient) GetPipelineBySha(id, sha string) (*Pipeline, error)

func (*GitHubClient) GetProjectID

func (c *GitHubClient) GetProjectID(path string) (int, error)

func (*GitHubClient) IsStatusPending

func (*GitHubClient) IsStatusPending(status string) bool

type GitLabClient

type GitLabClient struct {
	// contains filtered or unexported fields
}

func NewGitLabClient

func NewGitLabClient(token string) (*GitLabClient, error)

func (*GitLabClient) GetPipeline

func (c *GitLabClient) GetPipeline(id string, pid int) (*Pipeline, error)

func (*GitLabClient) GetPipelineBySha

func (c *GitLabClient) GetPipelineBySha(id string, sha string) (*Pipeline, error)

func (*GitLabClient) GetProjectID

func (c *GitLabClient) GetProjectID(path string) (int, error)

func (*GitLabClient) IsStatusPending

func (*GitLabClient) IsStatusPending(status string) bool

type Pipeline

type Pipeline struct {
	ID        int
	ProjectID string
	CommitSha string
	Status    string
	URL       string
}

type ProviderType

type ProviderType string
const (
	GitHub ProviderType = "github"
	GitLab ProviderType = "gitlab"
)

Jump to

Keyboard shortcuts

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