Documentation
¶
Index ¶
- func DefaultInstallationName(repoName string) string
- func FetchCanvas(repo *Repository) (*pb.Canvas, string, error)
- func FetchConsole(repo *Repository, ref string) (*models.DashboardYAML, error)
- func FindActiveUserForAccountInOrganization(accountID, organizationID uuid.UUID) (*models.User, error)
- type InstallRequest
- type InstallResult
- type Preview
- type Repository
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultInstallationName ¶
DefaultInstallationName derives a human-readable app name from a GitHub repository name. Example: preview-env-github-digitalocean -> Preview Env Github Digitalocean
func FetchCanvas ¶
func FetchCanvas(repo *Repository) (*pb.Canvas, string, error)
FetchCanvas loads and parses canvas.yaml from a public GitHub repository.
func FetchConsole ¶ added in v0.23.0
func FetchConsole(repo *Repository, ref string) (*models.DashboardYAML, error)
FetchConsole loads and parses an optional console.yaml from a public GitHub repository at the given ref. The console is opt-in: a missing file returns (nil, nil) so callers can install the app without one. Parse and validation errors from models.DashboardFromYML are wrapped and surfaced to the caller.
Callers must pass a non-empty ref. Resolve it via FetchCanvas first so the canvas and console are read from the same commit.
Types ¶
type InstallRequest ¶
type InstallResult ¶
type Preview ¶
type Preview struct {
Repo string `json:"repo"`
Owner string `json:"owner"`
Repository string `json:"repository"`
Ref string `json:"ref"`
Title string `json:"title"`
Description string `json:"description"`
CanvasName string `json:"canvasName"`
DefaultName string `json:"defaultName"`
}
Preview describes an installable GitHub app before the user confirms installation.
func BuildPreview ¶
BuildPreview loads app metadata from GitHub and prepares install defaults.
type Repository ¶
type Repository struct {
Owner string
Name string
// Ref is the git ref used when fetching app files (main or master).
Ref string
}
Repository identifies a public GitHub repository hosting a SuperPlane app.
func ParseRepository ¶
func ParseRepository(raw string) (*Repository, error)
ParseRepository accepts github.com/owner/repo and common variants.
func (*Repository) String ¶
func (r *Repository) String() string
type Service ¶
type Service struct {
Registry *registry.Registry
Encryptor crypto.Encryptor
AuthService authorization.Authorization
WebhooksBaseURL string
UsageService usage.Service
}
func (*Service) Install ¶
func (s *Service) Install(ctx context.Context, req InstallRequest) (*InstallResult, error)