Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoVCS = httperror.Error{Message: "no VCS provider found for the given app ID"} ErrNoApp = httperror.Error{Message: "no app found for the given app ID"} )
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is a unified interface for all VCS providers. We maintain a map of app IDs to VCS providers, and the appropriate provider is chosen based on the app ID in the request. The adapter then delegates the request to the chosen provider.
func NewAdapter ¶
New creates a new provider facade.
func (*Adapter) AuthenticatedRemoteURL ¶
AuthenticatedRemoteURL returns an authenticated remote URL for a specific app, installation, and source URL.
func (*Adapter) HandleInstallation ¶
HandleInstallation handles installation requests for a specific app. This is only implemented by some providers.
func (*Adapter) HandleWebhook ¶
HandleWebhook handles webhook requests for a specific app.
type App ¶
type App struct {
Provider string
}
App represents an application with a specific VCS provider.
type Provider ¶
type Provider interface { HandleAPI(c echo.Context) error HandleWebhook(c echo.Context) error HandleInstallation(c echo.Context) error AuthenticatedRemoteURL(appID, installationID, srcURL string) (string, error) }
Provider interface defines the methods that each VCS provider should implement.