types

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types package

Index

Constants

View Source
const (
	JSONContentType = "application/json"
	FormContentType = "application/x-www-form-urlencoded"

	BearerAuthPrefix  = "Bearer "
	V1WebhookEndpoint = "v1/vcs/events"
)

Request method and content types, headers, etc. mainly for convenience.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenPayload

type AccessTokenPayload struct {
	ExpirationTimestamp *time.Time
	AccessToken         string
	RefreshToken        string
}

AccessTokenPayload is the payload returned for creating / renewing an access token.

type BuildOAuthAuthorizationURLInput

type BuildOAuthAuthorizationURLInput struct {
	ProviderURL        url.URL
	OAuthClientID      string
	OAuthState         string
	RedirectURL        string
	UseReadWriteScopes bool // When true, API requests read-write scopes.
}

BuildOAuthAuthorizationURLInput is the input for building an authorization code URL that can be used to complete OAuth flow.

type BuildRepositoryURLInput

type BuildRepositoryURLInput struct {
	ProviderURL    url.URL
	RepositoryPath string
}

BuildRepositoryURLInput is the input for building a repository URL.

type CreateAccessTokenInput

type CreateAccessTokenInput struct {
	ProviderURL       url.URL
	ClientID          string
	ClientSecret      string
	AuthorizationCode string
	RedirectURI       string
	RefreshToken      string // Required when renewing a token, only for GitLab.
}

CreateAccessTokenInput is the input for creating an access token from a provider.

type CreateWebhookInput

type CreateWebhookInput struct {
	ProviderURL    url.URL
	AccessToken    string
	RepositoryPath string
	WebhookToken   []byte
}

CreateWebhookInput is the input for creating a webhook.

type DeleteWebhookInput

type DeleteWebhookInput struct {
	ProviderURL    url.URL
	AccessToken    string
	RepositoryPath string
	WebhookID      string
}

DeleteWebhookInput is the input for deleting a webhook.

type GetArchiveInput

type GetArchiveInput struct {
	ProviderURL    url.URL
	AccessToken    string
	RepositoryPath string
	Ref            string
}

GetArchiveInput is the input for downloading a source archive.

type GetDiffInput

type GetDiffInput struct {
	ProviderURL    url.URL
	AccessToken    string
	RepositoryPath string
	Ref            string // Branch or commit ID to diff.
}

GetDiffInput is the input for retrieving a diff for a ref.

type GetDiffsInput

type GetDiffsInput struct {
	ProviderURL    url.URL
	AccessToken    string
	RepositoryPath string
	BaseRef        string // What we're comparing from. (Parent branch, tag etc.)
	HeadRef        string // What we're comparing to. (New branch, tag etc.)
}

GetDiffsInput is the input for comparing two Git references.

type GetDiffsPayload

type GetDiffsPayload struct {
	AlteredFiles map[string]struct{}
}

GetDiffsPayload is the payload returned when retrieving diff(s).

type GetProjectInput

type GetProjectInput struct {
	ProviderURL    url.URL
	AccessToken    string
	RepositoryPath string
}

GetProjectInput is the input for retrieving a project.

type GetProjectPayload

type GetProjectPayload struct {
	DefaultBranch string
}

GetProjectPayload is a subset of the payload returned when querying for a Git project.

type TestConnectionInput

type TestConnectionInput struct {
	ProviderURL url.URL
	AccessToken string
}

TestConnectionInput is the input for testing a connection with a provider.

type ToVCSEventTypeInput

type ToVCSEventTypeInput struct {
	EventHeader string
	Ref         string
}

ToVCSEventTypeInput is the input for translating event types to VCSEventType equivalents.

type WebhookPayload

type WebhookPayload struct {
	WebhookID string
}

WebhookPayload is the payload for manipulating webhooks.

Jump to

Keyboard shortcuts

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