Documentation
¶
Index ¶
- Variables
- type App
- type Artifact
- type BackendEnvironment
- type Branch
- type DomainAssociation
- type DomainStatus
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- func (h *Handler) WithJanitor(backend *InMemoryBackend, interval time.Duration, taskTimeout ...time.Duration) *Handler
- type InMemoryBackend
- func (b *InMemoryBackend) CreateApp(name, description, repository, platform string, tagMap map[string]string) (*App, error)
- func (b *InMemoryBackend) CreateBackendEnvironment(appID, environmentName, stackName, deploymentArtifacts string) (*BackendEnvironment, error)
- func (b *InMemoryBackend) CreateBranch(appID, branchName, description, stage string, enableAutoBuild bool, ...) (*Branch, error)
- func (b *InMemoryBackend) CreateDeployment(appID, branchName string) (string, string, error)
- func (b *InMemoryBackend) CreateDomainAssociation(appID, domainName string, subDomains []SubDomainSetting, ...) (*DomainAssociation, error)
- func (b *InMemoryBackend) CreateWebhook(appID, branchName, description string) (*Webhook, error)
- func (b *InMemoryBackend) DeleteApp(appID string) error
- func (b *InMemoryBackend) DeleteBackendEnvironment(appID, environmentName string) (*BackendEnvironment, error)
- func (b *InMemoryBackend) DeleteBranch(appID, branchName string) error
- func (b *InMemoryBackend) DeleteDomainAssociation(appID, domainName string) (*DomainAssociation, error)
- func (b *InMemoryBackend) DeleteJob(appID, branchName, jobID string) (*Job, error)
- func (b *InMemoryBackend) DeleteWebhook(webhookID string) (*Webhook, error)
- func (b *InMemoryBackend) GenerateAccessLogs(appID, domainName, startTime, endTime string) (string, error)
- func (b *InMemoryBackend) GetApp(appID string) (*App, error)
- func (b *InMemoryBackend) GetArtifactURL(artifactID string) (string, string, error)
- func (b *InMemoryBackend) GetBackendEnvironment(appID, environmentName string) (*BackendEnvironment, error)
- func (b *InMemoryBackend) GetBranch(appID, branchName string) (*Branch, error)
- func (b *InMemoryBackend) GetDomainAssociation(appID, domainName string) (*DomainAssociation, error)
- func (b *InMemoryBackend) GetJob(appID, branchName, jobID string) (*Job, error)
- func (b *InMemoryBackend) GetWebhook(webhookID string) (*Webhook, error)
- func (b *InMemoryBackend) ListApps(nextToken string, maxResults int) ([]*App, string, error)
- func (b *InMemoryBackend) ListArtifacts(appID, _, _, nextToken string, maxResults int) ([]*Artifact, string, error)
- func (b *InMemoryBackend) ListBackendEnvironments(appID, nextToken string, maxResults int) ([]*BackendEnvironment, string, error)
- func (b *InMemoryBackend) ListBranches(appID, nextToken string, maxResults int) ([]*Branch, string, error)
- func (b *InMemoryBackend) ListDomainAssociations(appID, nextToken string, maxResults int) ([]*DomainAssociation, string, error)
- func (b *InMemoryBackend) ListJobs(appID, branchName, nextToken string, maxResults int) ([]*Job, string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) ListWebhooks(appID, nextToken string, maxResults int) ([]*Webhook, string, error)
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) StartDeployment(appID, branchName, jobID, sourceURL string) (*Job, error)
- func (b *InMemoryBackend) StartJob(appID, branchName, jobType, commitID, commitMsg string) (*Job, error)
- func (b *InMemoryBackend) StopJob(appID, branchName, jobID string) (*Job, error)
- func (b *InMemoryBackend) TagResource(resourceARN string, tagMap map[string]string) error
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateApp(appID, name, description, repository, platform string) (*App, error)
- func (b *InMemoryBackend) UpdateBranch(appID, branchName, description, stage string, enableAutoBuild bool) (*Branch, error)
- func (b *InMemoryBackend) UpdateDomainAssociation(appID, domainName string, subDomains []SubDomainSetting, ...) (*DomainAssociation, error)
- func (b *InMemoryBackend) UpdateWebhook(webhookID, branchName, description string) (*Webhook, error)
- type Janitor
- type Job
- type JobStatus
- type JobType
- type Platform
- type Provider
- type Stage
- type StorageBackend
- type SubDomain
- type SubDomainSetting
- type Webhook
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when a resource is not found. ErrNotFound = awserr.New("NotFoundException", awserr.ErrNotFound) // ErrAlreadyExists is returned when a resource already exists. ErrAlreadyExists = awserr.New("BadRequestException", awserr.ErrAlreadyExists) )
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Tags *tags.Tags `json:"tags,omitzero"`
CreateTime time.Time `json:"createTime"`
UpdateTime time.Time `json:"updateTime"`
AppID string `json:"appId"`
ARN string `json:"appArn"`
Name string `json:"name"`
Description string `json:"description,omitzero"`
Repository string `json:"repository,omitzero"`
DefaultDomain string `json:"defaultDomain,omitzero"`
Platform Platform `json:"platform"`
}
App represents an Amplify application.
type Artifact ¶
type Artifact struct {
ArtifactID string `json:"artifactId"`
ArtifactType string `json:"artifactType"`
ArtifactFileName string `json:"artifactFileName"`
}
Artifact represents an Amplify build artifact.
type BackendEnvironment ¶
type BackendEnvironment struct {
CreateTime time.Time `json:"createTime"`
UpdateTime time.Time `json:"updateTime"`
EnvironmentName string `json:"environmentName"`
BackendEnvironmentARN string `json:"backendEnvironmentArn"`
AppID string `json:"appId"`
StackName string `json:"stackName,omitzero"`
DeploymentArtifacts string `json:"deploymentArtifacts,omitzero"`
}
BackendEnvironment represents an Amplify backend environment.
type Branch ¶
type Branch struct {
Tags *tags.Tags `json:"tags,omitzero"`
CreateTime time.Time `json:"createTime"`
UpdateTime time.Time `json:"updateTime"`
AppID string `json:"appId"`
BranchARN string `json:"branchArn"`
BranchName string `json:"branchName"`
Description string `json:"description,omitzero"`
Stage Stage `json:"stage,omitzero"`
EnableAutoBuild bool `json:"enableAutoBuild"`
}
Branch represents an Amplify app branch.
type DomainAssociation ¶
type DomainAssociation struct {
AppID string `json:"appId"`
DomainName string `json:"domainName"`
ARN string `json:"domainAssociationArn"`
DomainStatus DomainStatus `json:"domainStatus"`
StatusReason string `json:"statusReason,omitzero"`
CertificateVerificationDNSRecord string `json:"certificateVerificationDNSRecord,omitzero"`
SubDomains []SubDomain `json:"subDomains"`
EnableAutoSubDomain bool `json:"enableAutoSubDomain"`
}
DomainAssociation represents an Amplify custom domain association.
type DomainStatus ¶
type DomainStatus string
DomainStatus represents the status of a domain association.
const ( // DomainStatusCreating is the creating status. DomainStatusCreating DomainStatus = "CREATING" // DomainStatusPendingVerification is waiting for verification. DomainStatusPendingVerification DomainStatus = "PENDING_VERIFICATION" // DomainStatusAvailable is the available status. DomainStatusAvailable DomainStatus = "AVAILABLE" // DomainStatusFailed is the failed status. DomainStatusFailed DomainStatus = "FAILED" )
type Handler ¶
type Handler struct {
Backend StorageBackend
DefaultRegion string
AccountID string
// contains filtered or unexported fields
}
Handler is the Echo HTTP handler for Amplify operations.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Amplify handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this Amplify instance handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the Amplify operation from the request path.
func (*Handler) ExtractResource ¶
ExtractResource extracts the app ID from the request path.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported Amplify operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Amplify requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Amplify API requests.
func (*Handler) Snapshot ¶
Snapshot implements persistence.Persistable by delegating to the backend.
func (*Handler) StartWorker ¶
StartWorker starts the background janitor if configured. It implements the worker-lifecycle hook of service.Registerable, so cli.go's generic startup dispatch starts it without any Amplify-specific wiring there.
func (*Handler) WithJanitor ¶
func (h *Handler) WithJanitor( backend *InMemoryBackend, interval time.Duration, taskTimeout ...time.Duration, ) *Handler
WithJanitor attaches a background janitor to the handler. backend must be the concrete *InMemoryBackend backing this Handler -- the janitor needs direct access to the backend's tables and lock, which the StorageBackend interface (used for h.Backend so the handler stays mockable) does not expose.
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is the in-memory implementation of StorageBackend.
Every resource collection is a *store.Table[T] registered on registry (see store_setup.go); branches, jobs, domains, and backendEnvironments were previously nested per-parent maps and are now flattened to a single Table keyed by a composite "parent|child" string with a companion byApp/byBranch store.Index for the "all children of parent X" lookups the nested maps used to answer directly. webhooksByApp was a reverse-lookup map (map[string][]string); it is now a store.Index on webhooks, not its own Table.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new in-memory Amplify backend.
func (*InMemoryBackend) CreateApp ¶
func (b *InMemoryBackend) CreateApp( name, description, repository, platform string, tagMap map[string]string, ) (*App, error)
CreateApp creates a new Amplify application.
func (*InMemoryBackend) CreateBackendEnvironment ¶
func (b *InMemoryBackend) CreateBackendEnvironment( appID, environmentName, stackName, deploymentArtifacts string, ) (*BackendEnvironment, error)
CreateBackendEnvironment creates a new backend environment for an app.
func (*InMemoryBackend) CreateBranch ¶
func (b *InMemoryBackend) CreateBranch( appID, branchName, description, stage string, enableAutoBuild bool, tagMap map[string]string, ) (*Branch, error)
CreateBranch creates a new branch for an Amplify application.
func (*InMemoryBackend) CreateDeployment ¶
func (b *InMemoryBackend) CreateDeployment(appID, branchName string) (string, string, error)
CreateDeployment creates a pre-signed upload URL for a manual deployment.
func (*InMemoryBackend) CreateDomainAssociation ¶
func (b *InMemoryBackend) CreateDomainAssociation( appID, domainName string, subDomains []SubDomainSetting, enableAutoSubDomain bool, ) (*DomainAssociation, error)
CreateDomainAssociation creates a custom domain association for an app.
func (*InMemoryBackend) CreateWebhook ¶
func (b *InMemoryBackend) CreateWebhook(appID, branchName, description string) (*Webhook, error)
CreateWebhook creates a new webhook for an app branch.
func (*InMemoryBackend) DeleteApp ¶
func (b *InMemoryBackend) DeleteApp(appID string) error
DeleteApp deletes an Amplify application by ID.
func (*InMemoryBackend) DeleteBackendEnvironment ¶
func (b *InMemoryBackend) DeleteBackendEnvironment( appID, environmentName string, ) (*BackendEnvironment, error)
DeleteBackendEnvironment deletes a backend environment.
func (*InMemoryBackend) DeleteBranch ¶
func (b *InMemoryBackend) DeleteBranch(appID, branchName string) error
DeleteBranch deletes a branch from an Amplify application.
func (*InMemoryBackend) DeleteDomainAssociation ¶
func (b *InMemoryBackend) DeleteDomainAssociation( appID, domainName string, ) (*DomainAssociation, error)
DeleteDomainAssociation deletes a domain association.
func (*InMemoryBackend) DeleteJob ¶
func (b *InMemoryBackend) DeleteJob(appID, branchName, jobID string) (*Job, error)
DeleteJob deletes a job record.
func (*InMemoryBackend) DeleteWebhook ¶
func (b *InMemoryBackend) DeleteWebhook(webhookID string) (*Webhook, error)
DeleteWebhook deletes a webhook.
func (*InMemoryBackend) GenerateAccessLogs ¶
func (b *InMemoryBackend) GenerateAccessLogs( appID, domainName, startTime, endTime string, ) (string, error)
GenerateAccessLogs generates a presigned URL for access logs.
func (*InMemoryBackend) GetApp ¶
func (b *InMemoryBackend) GetApp(appID string) (*App, error)
GetApp returns an Amplify application by ID.
func (*InMemoryBackend) GetArtifactURL ¶
func (b *InMemoryBackend) GetArtifactURL(artifactID string) (string, string, error)
GetArtifactURL returns the download URL for an artifact.
func (*InMemoryBackend) GetBackendEnvironment ¶
func (b *InMemoryBackend) GetBackendEnvironment( appID, environmentName string, ) (*BackendEnvironment, error)
GetBackendEnvironment returns a backend environment.
func (*InMemoryBackend) GetBranch ¶
func (b *InMemoryBackend) GetBranch(appID, branchName string) (*Branch, error)
GetBranch returns a branch for an Amplify application.
func (*InMemoryBackend) GetDomainAssociation ¶
func (b *InMemoryBackend) GetDomainAssociation( appID, domainName string, ) (*DomainAssociation, error)
GetDomainAssociation returns a domain association.
func (*InMemoryBackend) GetJob ¶
func (b *InMemoryBackend) GetJob(appID, branchName, jobID string) (*Job, error)
GetJob returns a job by ID.
func (*InMemoryBackend) GetWebhook ¶
func (b *InMemoryBackend) GetWebhook(webhookID string) (*Webhook, error)
GetWebhook returns a webhook by ID.
func (*InMemoryBackend) ListArtifacts ¶
func (b *InMemoryBackend) ListArtifacts( appID, _, _, nextToken string, maxResults int, ) ([]*Artifact, string, error)
ListArtifacts lists artifacts for a job.
func (*InMemoryBackend) ListBackendEnvironments ¶
func (b *InMemoryBackend) ListBackendEnvironments( appID, nextToken string, maxResults int, ) ([]*BackendEnvironment, string, error)
ListBackendEnvironments lists backend environments for an app.
func (*InMemoryBackend) ListBranches ¶
func (b *InMemoryBackend) ListBranches( appID, nextToken string, maxResults int, ) ([]*Branch, string, error)
ListBranches returns branches for an Amplify application with optional pagination.
func (*InMemoryBackend) ListDomainAssociations ¶
func (b *InMemoryBackend) ListDomainAssociations( appID, nextToken string, maxResults int, ) ([]*DomainAssociation, string, error)
ListDomainAssociations lists domain associations for an app.
func (*InMemoryBackend) ListJobs ¶
func (b *InMemoryBackend) ListJobs( appID, branchName, nextToken string, maxResults int, ) ([]*Job, string, error)
ListJobs lists all jobs for a branch.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns all tags for an Amplify resource identified by ARN.
func (*InMemoryBackend) ListWebhooks ¶
func (b *InMemoryBackend) ListWebhooks( appID, nextToken string, maxResults int, ) ([]*Webhook, string, error)
ListWebhooks lists webhooks for an app.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON. It implements persistence.Persistable.
func (*InMemoryBackend) StartDeployment ¶
func (b *InMemoryBackend) StartDeployment( appID, branchName, jobID, sourceURL string, ) (*Job, error)
StartDeployment starts a deployment from a pre-uploaded artifact.
func (*InMemoryBackend) StartJob ¶
func (b *InMemoryBackend) StartJob( appID, branchName, jobType, commitID, commitMsg string, ) (*Job, error)
StartJob creates and starts a new deployment job for a branch.
func (*InMemoryBackend) StopJob ¶
func (b *InMemoryBackend) StopJob(appID, branchName, jobID string) (*Job, error)
StopJob cancels a running job.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, tagMap map[string]string) error
TagResource adds or updates tags on an Amplify resource identified by ARN.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
UntagResource removes tags from an Amplify resource identified by ARN.
func (*InMemoryBackend) UpdateApp ¶
func (b *InMemoryBackend) UpdateApp( appID, name, description, repository, platform string, ) (*App, error)
UpdateApp updates an existing Amplify application.
func (*InMemoryBackend) UpdateBranch ¶
func (b *InMemoryBackend) UpdateBranch( appID, branchName, description, stage string, enableAutoBuild bool, ) (*Branch, error)
UpdateBranch updates an existing Amplify branch.
func (*InMemoryBackend) UpdateDomainAssociation ¶
func (b *InMemoryBackend) UpdateDomainAssociation( appID, domainName string, subDomains []SubDomainSetting, enableAutoSubDomain bool, ) (*DomainAssociation, error)
UpdateDomainAssociation updates a domain association.
func (*InMemoryBackend) UpdateWebhook ¶
func (b *InMemoryBackend) UpdateWebhook( webhookID, branchName, description string, ) (*Webhook, error)
UpdateWebhook updates a webhook.
type Janitor ¶
type Janitor struct {
Backend *InMemoryBackend
Interval time.Duration
// TaskTimeout bounds each individual janitor task. When non-zero, each task
// runs with a child context that expires after this duration, preventing a
// stalled operation from blocking the janitor loop indefinitely.
TaskTimeout time.Duration
}
Janitor is the Amplify background worker that advances jobs and domain associations out of their transient starting states.
StartJob/StartDeployment only ever set a job's Status to RUNNING, and CreateDomainAssociation only ever sets a domain's DomainStatus to PENDING_VERIFICATION -- real Amplify eventually finishes the build / verifies the certificate on its own, but nothing else in this backend ever mutates those fields again (StopJob/DeleteDomainAssociation require an explicit caller action). Without this janitor a job or domain association would sit in its transient state forever, and any client polling GetJob/ListJobs or GetDomainAssociation/ListDomainAssociations to wait for completion would spin indefinitely.
func NewJanitor ¶
func NewJanitor(backend *InMemoryBackend, interval time.Duration) *Janitor
NewJanitor creates a new Amplify Janitor for the given backend. A zero interval falls back to defaultAmplifyJanitorInterval.
type Job ¶
type Job struct {
JobID string `json:"jobId"`
JobARN string `json:"jobArn"`
CommitID string `json:"commitId,omitzero"`
CommitMsg string `json:"commitMessage,omitzero"`
Status JobStatus `json:"status"`
Type JobType `json:"jobType"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime,omitzero"`
AppID string `json:"appId"`
BranchName string `json:"branchName"`
}
Job represents an Amplify deployment job.
type JobStatus ¶
type JobStatus string
JobStatus represents the status of a deployment job.
const ( // JobStatusPending is the pending status. JobStatusPending JobStatus = "PENDING" // JobStatusProvisioning is the provisioning status. JobStatusProvisioning JobStatus = "PROVISIONING" // JobStatusRunning is the running status. JobStatusRunning JobStatus = "RUNNING" // JobStatusFailed is the failed status. JobStatusFailed JobStatus = "FAILED" // JobStatusSucceed is the succeed status. JobStatusSucceed JobStatus = "SUCCEED" // JobStatusCancelling is the cancelling status. JobStatusCancelling JobStatus = "CANCELLING" // JobStatusCancelled is the cancelled status. JobStatusCancelled JobStatus = "CANCELLED" )
type JobType ¶
type JobType string
JobType represents the type of deployment job.
const ( // JobTypeRelease is a manual release job. JobTypeRelease JobType = "RELEASE" // JobTypeRetry is a retry job. JobTypeRetry JobType = "RETRY" // JobTypeManual is a direct-upload deployment. JobTypeManual JobType = "MANUAL" // JobTypeWebHook is a webhook-triggered job. JobTypeWebHook JobType = "WEB_HOOK" )
type Provider ¶
type Provider struct{}
Provider implements service.Provider for the Amplify service.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Amplify service backend and handler.
type Stage ¶
type Stage string
Stage represents the branch deployment stage.
const ( // StageProduction is the production stage. StageProduction Stage = "PRODUCTION" // StageStaging is the staging stage. StageStaging Stage = "STAGING" // StageDevelopment is the development stage. StageDevelopment Stage = "DEVELOPMENT" // StageExperimental is the experimental stage. StageExperimental Stage = "EXPERIMENTAL" )
type StorageBackend ¶
type StorageBackend interface {
// Snapshot and Restore implement persistence.Persistable. Handler
// delegates to them (see persistence.go) so cli.go's generic
// setupPersistence picks Amplify up.
Snapshot(ctx context.Context) []byte
Restore(ctx context.Context, data []byte) error
CreateApp(
name, description, repository, platform string,
tagMap map[string]string,
) (*App, error)
GetApp(appID string) (*App, error)
ListApps(nextToken string, maxResults int) ([]*App, string, error)
DeleteApp(appID string) error
UpdateApp(appID, name, description, repository, platform string) (*App, error)
CreateBranch(
appID, branchName, description, stage string,
enableAutoBuild bool,
tagMap map[string]string,
) (*Branch, error)
GetBranch(appID, branchName string) (*Branch, error)
ListBranches(appID, nextToken string, maxResults int) ([]*Branch, string, error)
DeleteBranch(appID, branchName string) error
UpdateBranch(
appID, branchName, description, stage string,
enableAutoBuild bool,
) (*Branch, error)
TagResource(resourceARN string, tagMap map[string]string) error
UntagResource(resourceARN string, tagKeys []string) error
ListTagsForResource(resourceARN string) (map[string]string, error)
// Jobs
StartJob(appID, branchName, jobType, commitID, commitMsg string) (*Job, error)
StopJob(appID, branchName, jobID string) (*Job, error)
GetJob(appID, branchName, jobID string) (*Job, error)
ListJobs(appID, branchName, nextToken string, maxResults int) ([]*Job, string, error)
DeleteJob(appID, branchName, jobID string) (*Job, error)
CreateDeployment(appID, branchName string) (string, string, error)
StartDeployment(appID, branchName, jobID, sourceURL string) (*Job, error)
// Domains
CreateDomainAssociation(
appID, domainName string, subDomains []SubDomainSetting, enableAutoSubDomain bool,
) (*DomainAssociation, error)
UpdateDomainAssociation(
appID, domainName string, subDomains []SubDomainSetting, enableAutoSubDomain bool,
) (*DomainAssociation, error)
DeleteDomainAssociation(appID, domainName string) (*DomainAssociation, error)
GetDomainAssociation(appID, domainName string) (*DomainAssociation, error)
ListDomainAssociations(
appID, nextToken string,
maxResults int,
) ([]*DomainAssociation, string, error)
// Webhooks
CreateWebhook(appID, branchName, description string) (*Webhook, error)
UpdateWebhook(webhookID, branchName, description string) (*Webhook, error)
DeleteWebhook(webhookID string) (*Webhook, error)
GetWebhook(webhookID string) (*Webhook, error)
ListWebhooks(appID, nextToken string, maxResults int) ([]*Webhook, string, error)
// Backend environments
CreateBackendEnvironment(
appID, environmentName, stackName, deploymentArtifacts string,
) (*BackendEnvironment, error)
GetBackendEnvironment(appID, environmentName string) (*BackendEnvironment, error)
DeleteBackendEnvironment(appID, environmentName string) (*BackendEnvironment, error)
ListBackendEnvironments(
appID, nextToken string,
maxResults int,
) ([]*BackendEnvironment, string, error)
// Logs and artifacts
GenerateAccessLogs(appID, domainName, startTime, endTime string) (string, error)
GetArtifactURL(artifactID string) (string, string, error)
ListArtifacts(
appID, _, _, nextToken string,
maxResults int,
) ([]*Artifact, string, error)
}
StorageBackend defines the interface for Amplify storage operations.
type SubDomain ¶
type SubDomain struct {
SubDomainSetting SubDomainSetting `json:"subDomainSetting"`
DNSRecord string `json:"dnsRecord,omitzero"`
Verified bool `json:"verified"`
}
SubDomain represents a configured subdomain.
type SubDomainSetting ¶
type SubDomainSetting struct {
Prefix string `json:"prefix"`
BranchName string `json:"branchName"`
}
SubDomainSetting represents a subdomain setting.
type Webhook ¶
type Webhook struct {
CreateTime time.Time `json:"createTime"`
UpdateTime time.Time `json:"updateTime"`
WebhookID string `json:"webhookId"`
WebhookARN string `json:"webhookArn"`
AppID string `json:"appId"`
BranchName string `json:"branchName"`
Description string `json:"description,omitzero"`
WebhookURL string `json:"webhookUrl"`
}
Webhook represents an Amplify webhook.
Source Files
¶
- apps.go
- artifacts.go
- branches.go
- deployments.go
- domains.go
- environments.go
- errors.go
- handler.go
- handler_apps.go
- handler_artifacts.go
- handler_branches.go
- handler_deployments.go
- handler_domains.go
- handler_environments.go
- handler_jobs.go
- handler_tags.go
- handler_webhooks.go
- interfaces.go
- janitor.go
- jobs.go
- models.go
- persistence.go
- provider.go
- store.go
- store_setup.go
- tags.go
- webhooks.go