setup

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvironmentNames

func EnvironmentNames(config *ProjectConfig) []string

func LoadGitHubToken

func LoadGitHubToken() (string, error)

func PollGitHubDeviceAuthorization

func PollGitHubDeviceAuthorization(
	ctx context.Context,
	clientID string,
	authorization *GitHubDeviceAuthorization,
) (string, error)

func SaveGitHubToken

func SaveGitHubToken(token string) error

func SaveProjectConfig

func SaveProjectConfig(path string, config *ProjectConfig) error

Types

type Classification

type Classification struct {
	ServerProfile *ServerProfile `json:"serverProfile"`
}

type Client

type Client struct {
	BaseURL     string
	OrgID       string
	Store       *authutil.SessionStore
	Clerk       *authutil.ClerkClient
	HTTPClient  *http.Client
	GitHubToken string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL, organizationID string, store *authutil.SessionStore, clerk *authutil.ClerkClient) *Client

func (*Client) AnalyzeRepository

func (c *Client) AnalyzeRepository(ctx context.Context, request RepositoryAnalysisRequest) (*RepositoryAnalysis, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, request CreateRequest) (*Progress, error)

func (*Client) Progress

func (c *Client) Progress(ctx context.Context, intentID string) (*Progress, error)

func (*Client) Quote

func (c *Client) Quote(ctx context.Context, request QuoteRequest) (*QuoteResponse, error)

func (*Client) Retry

func (c *Client) Retry(ctx context.Context, intentID string) (*Progress, error)

type CreateRequest

type CreateRequest struct {
	OrganizationID string `json:"organizationId,omitempty"`
	IdempotencyKey string `json:"idempotencyKey"`
	IntentID       string `json:"intentId"`
	IntentRevision string `json:"intentRevision"`
	QuoteID        string `json:"quoteId,omitempty"`
	BillingPeriod  string `json:"billingPeriod"`
	NoCharge       bool   `json:"noCharge"`
}

type Environment

type Environment struct {
	Branch            string         `yaml:"branch"`
	Domain            string         `yaml:"domain"`
	ManagedDomain     string         `yaml:"managed_domain,omitempty"`
	IntentID          string         `yaml:"intent_id,omitempty"`
	IntentRevision    string         `yaml:"intent_revision,omitempty"`
	QuoteID           string         `yaml:"quote_id,omitempty"`
	IdempotencyKey    string         `yaml:"idempotency_key,omitempty"`
	NoCharge          bool           `yaml:"no_charge,omitempty"`
	ServerID          int            `yaml:"server_id,omitempty"`
	SiteID            int            `yaml:"site_id,omitempty"`
	PipelineProjectID int            `yaml:"pipeline_project_id,omitempty"`
	Status            string         `yaml:"status"`
	Prepared          *PreparedSetup `yaml:"prepared,omitempty"`
}

type GitHubDeviceAuthorization

type GitHubDeviceAuthorization struct {
	DeviceCode      string `json:"device_code"`
	UserCode        string `json:"user_code"`
	VerificationURI string `json:"verification_uri"`
	ExpiresIn       int    `json:"expires_in"`
	Interval        int    `json:"interval"`
}

func StartGitHubDeviceAuthorization

func StartGitHubDeviceAuthorization(ctx context.Context, clientID string) (*GitHubDeviceAuthorization, error)

type InstallationRequest

type InstallationRequest struct {
	Type    string `json:"type"`
	Version string `json:"version,omitempty"`
}

type Intent

type Intent struct {
	ID             string         `json:"id"`
	Revision       string         `json:"revision"`
	Classification Classification `json:"classification"`
}

type PreparedSetup added in v1.0.29

type PreparedSetup struct {
	Repository     string  `yaml:"repository"`
	Directory      string  `yaml:"directory,omitempty"`
	Framework      string  `yaml:"framework"`
	Runtime        string  `yaml:"runtime,omitempty"`
	RuntimeVersion string  `yaml:"runtime_version,omitempty"`
	PlanKey        string  `yaml:"plan_key,omitempty"`
	PlanLabel      string  `yaml:"plan_label,omitempty"`
	PlanCores      int     `yaml:"plan_cores,omitempty"`
	PlanMemoryGB   int     `yaml:"plan_memory_gb,omitempty"`
	ServerID       int     `yaml:"server_id,omitempty"`
	PriceAmount    float64 `yaml:"price_amount,omitempty"`
	PriceCurrency  string  `yaml:"price_currency,omitempty"`
}

type Progress

type Progress struct {
	ID             string `json:"id"`
	Revision       string `json:"revision"`
	SetupStatus    string `json:"setupstatus"`
	SetupStage     string `json:"setupstage"`
	SetupMessage   string `json:"setupmessage"`
	ServerID       int    `json:"serverid"`
	SiteID         int    `json:"siteid"`
	FailureMessage string `json:"failuremessage"`
}

type ProjectConfig

type ProjectConfig struct {
	Version      int                    `yaml:"version"`
	Repository   ProjectRepository      `yaml:"repository"`
	Environments map[string]Environment `yaml:"environments"`
}

func LoadProjectConfig

func LoadProjectConfig(path string) (*ProjectConfig, error)

type ProjectRepository

type ProjectRepository struct {
	URL       string `yaml:"url"`
	Directory string `yaml:"directory,omitempty"`
}

type ProvisioningPayload

type ProvisioningPayload struct {
	ResourceKind     string                `json:"resourceKind"`
	ServerID         int                   `json:"serverId,omitempty"`
	Environment      string                `json:"environment"`
	Domains          []string              `json:"domains"`
	Framework        string                `json:"framework"`
	Runtime          string                `json:"runtime,omitempty"`
	DomainName       string                `json:"domainName"`
	MainDomainName   string                `json:"mainDomainName"`
	ServerPlanKey    string                `json:"serverPlanKey,omitempty"`
	Architecture     string                `json:"architecture,omitempty"`
	RuntimeSelection *RuntimeRequest       `json:"runtimeSelection,omitempty"`
	Installations    []InstallationRequest `json:"installations"`
	Repository       RepositoryRequest     `json:"repository"`
}

type Quote

type Quote struct {
	QuoteID       string  `json:"quoteId"`
	ProductName   string  `json:"productName"`
	Amount        float64 `json:"amount"`
	ListAmount    float64 `json:"listAmount"`
	Currency      string  `json:"currency"`
	BillingPeriod string  `json:"billingPeriod"`
}

type QuoteRequest

type QuoteRequest struct {
	OrganizationID string              `json:"organizationId,omitempty"`
	IdempotencyKey string              `json:"idempotencyKey"`
	BillingPeriod  string              `json:"billingPeriod"`
	NoCharge       bool                `json:"noCharge"`
	Payload        ProvisioningPayload `json:"payload"`
}

type QuoteResponse

type QuoteResponse struct {
	Intent Intent `json:"intent"`
	Quote  Quote  `json:"quote"`
}

type RepositoryAnalysis

type RepositoryAnalysis struct {
	GitHubLinked                bool     `json:"githublinked"`
	GitHubAuthorizationRequired bool     `json:"githubauthorizationrequired"`
	GitHubInstallURL            string   `json:"githubinstallurl"`
	GitHubClientID              string   `json:"githubclientid"`
	Repository                  string   `json:"repository"`
	DefaultBranch               string   `json:"defaultbranch"`
	Branch                      string   `json:"branch"`
	SuggestedDomain             string   `json:"suggesteddomain"`
	Framework                   string   `json:"framework"`
	Runtime                     string   `json:"runtime"`
	RuntimeVersion              string   `json:"runtimeversion"`
	Installations               []string `json:"installations"`
	WorkflowKey                 string   `json:"workflowkey"`
	Evidence                    []string `json:"evidence"`
	Confidence                  string   `json:"confidence"`
}

type RepositoryAnalysisRequest

type RepositoryAnalysisRequest struct {
	Owner      string `json:"owner"`
	Repository string `json:"repository"`
	Branch     string `json:"branch,omitempty"`
	Directory  string `json:"directory,omitempty"`
}

type RepositoryRequest

type RepositoryRequest struct {
	URL                  string `json:"url"`
	Branch               string `json:"branch"`
	Directory            string `json:"directory,omitempty"`
	WorkflowKey          string `json:"workflowKey"`
	ContinuousDeployment bool   `json:"continuousDeployment"`
}

type RuntimeRequest

type RuntimeRequest struct {
	Type    string `json:"type"`
	Version string `json:"version,omitempty"`
}

type ServerProfile

type ServerProfile struct {
	Key          string `json:"key"`
	Label        string `json:"label"`
	Cores        int    `json:"cores"`
	MemoryGB     int    `json:"memoryGb"`
	Architecture string `json:"architecture"`
}

Jump to

Keyboard shortcuts

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