types

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Capabilities = struct {
	Clone   string
	Comment string
	Changes string
	Webhook string
}{
	Clone:   "clone",
	Comment: "comment",
	Changes: "changes",
	Webhook: "webhook",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	// Basic auth
	Username string
	Password string

	// SSH auth
	SSHPrivateKey string

	// GitHub App auth
	AppID             int64
	AppInstallationID int64
	AppPrivateKey     string

	// Token auth
	GitHubToken string
	GitLabToken string

	// Repository URL
	URL string

	// Mock provider
	EnableMock bool

	// Secret for webhook handling
	WebhookSecret string
}

Config holds all possible authentication configurations

type Provider

type Provider interface {
	Init() error
	InitWebhookHandler() error
	GetChanges(*configv1alpha1.TerraformRepository, *configv1alpha1.TerraformPullRequest) ([]string, error)
	Comment(*configv1alpha1.TerraformRepository, *configv1alpha1.TerraformPullRequest, comment.Comment) error
	GetGitAuth() (transport.AuthMethod, error)
	Clone(*configv1alpha1.TerraformRepository, string, string) (*git.Repository, error)
	GetLatestRevisionForRef(*configv1alpha1.TerraformRepository, string) (string, error)
	ParseWebhookPayload(r *http.Request) (interface{}, bool)
	GetEventFromWebhookPayload(interface{}) (event.Event, error)
}

Provider interface defines methods that must be implemented by git providers

Jump to

Keyboard shortcuts

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