Documentation
¶
Index ¶
- func EnvironmentNames(config *ProjectConfig) []string
- func LoadGitHubToken() (string, error)
- func PollGitHubDeviceAuthorization(ctx context.Context, clientID string, authorization *GitHubDeviceAuthorization) (string, error)
- func SaveGitHubToken(token string) error
- func SaveProjectConfig(path string, config *ProjectConfig) error
- type Classification
- type Client
- func (c *Client) AnalyzeRepository(ctx context.Context, request RepositoryAnalysisRequest) (*RepositoryAnalysis, error)
- func (c *Client) Create(ctx context.Context, request CreateRequest) (*Progress, error)
- func (c *Client) Progress(ctx context.Context, intentID string) (*Progress, error)
- func (c *Client) Quote(ctx context.Context, request QuoteRequest) (*QuoteResponse, error)
- func (c *Client) Retry(ctx context.Context, intentID string) (*Progress, error)
- type CreateRequest
- type Environment
- type GitHubDeviceAuthorization
- type InstallationRequest
- type Intent
- type PreparedSetup
- type Progress
- type ProjectConfig
- type ProjectRepository
- type ProvisioningPayload
- type Quote
- type QuoteRequest
- type QuoteResponse
- type RepositoryAnalysis
- type RepositoryAnalysisRequest
- type RepositoryRequest
- type RuntimeRequest
- type ServerProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvironmentNames ¶
func EnvironmentNames(config *ProjectConfig) []string
func LoadGitHubToken ¶
func SaveGitHubToken ¶
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) Quote ¶
func (c *Client) Quote(ctx context.Context, request QuoteRequest) (*QuoteResponse, 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 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 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 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 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 RepositoryRequest ¶
type RuntimeRequest ¶
Click to show internal directories.
Click to hide internal directories.