Documentation
¶
Index ¶
- Variables
- func Deploy(ctx context.Context, cfg *config.NextDeployConfig, ...) error
- func GenerateQuickReference(resMap ServerlessResourceMap) string
- func GenerateResourceView(appCfg *config.AppConfig, resMap ServerlessResourceMap) (string, error)
- func Rollback(ctx context.Context, cfg *config.NextDeployConfig) error
- type AWSProvider
- func (p *AWSProvider) DeployCompute(ctx context.Context, pkg *packaging.PackageResult, ...) error
- func (p *AWSProvider) DeployStatic(ctx context.Context, pkg *packaging.PackageResult, ...) error
- func (p *AWSProvider) Destroy(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
- func (p *AWSProvider) GetResourceMap(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) (ServerlessResourceMap, error)
- func (p *AWSProvider) GetSecrets(ctx context.Context, appName string) (map[string]string, error)
- func (p *AWSProvider) Initialize(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
- func (p *AWSProvider) InvalidateCache(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
- func (p *AWSProvider) Rollback(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
- func (p *AWSProvider) SetSecret(ctx context.Context, appName string, key, value string) error
- func (p *AWSProvider) UnsetSecret(ctx context.Context, appName string, key string) error
- func (p *AWSProvider) UpdateSecrets(ctx context.Context, appName string, secrets map[string]string) error
- type Provider
- type ProviderRules
- type ServerlessResourceMap
Constants ¶
This section is empty.
Variables ¶
View Source
var DNSProviderRules = map[string]ProviderRules{ "namecheap": { Name: "Namecheap", Icon: "🧢", RootFormat: "@", WwwFormat: "www", SSLFormat: func(record dns.ValidationRecord) string { if strings.Contains(record.Name, ".www") { return record.Name } return strings.Split(record.Name, ".")[0] }, Warning: "⚠️ CRITICAL: NEVER include your domain name in the Host field! Use only the hash or '@'.", ProTip: "For www SSL records, the Host must include '.www' (e.g., '_5ab8c33b39a.www')", }, "cloudflare": { Name: "Cloudflare", Icon: "☁️", RootFormat: "@", WwwFormat: "www", SSLFormat: func(record dns.ValidationRecord) string { return strings.TrimSuffix(record.Name, ".") }, Warning: "⚠️ IMPORTANT: Set proxy status to DNS only (gray cloud) for SSL validation records!", ProTip: "After SSL is issued, you can enable the orange cloud (proxied) for better performance.", ProxyWarning: "🔴 SSL validation WILL FAIL if the cloud is orange! Keep it gray until certificate is issued.", }, "godaddy": { Name: "GoDaddy", Icon: "🇬", RootFormat: "@", WwwFormat: "www", SSLFormat: func(record dns.ValidationRecord) string { return strings.TrimSuffix(record.Name, ".") }, Warning: "⚠️ Do not include trailing dots in the 'Points to' field.", ProTip: "Use '@' for root domain, leave TTL as 1 hour.", }, "route53": { Name: "Route 53", Icon: "📡", RootFormat: "@", WwwFormat: "www", SSLFormat: func(record dns.ValidationRecord) string { return record.Name }, Warning: "✅ Use Alias records (A type) for better performance!", ProTip: "Route 53 handles validation automatically if domain is hosted here.", }, "other": { Name: "Other Provider", Icon: "🌐", RootFormat: "@", WwwFormat: "www", SSLFormat: func(record dns.ValidationRecord) string { return strings.TrimSuffix(record.Name, ".") }, Warning: "⚠️ Check your provider's documentation for exact field names.", ProTip: "Common field names: Host, Name, Alias, Points to.", }, }
DNSProviderRules maps provider names to their specific instructions
Functions ¶
func Deploy ¶
func Deploy(ctx context.Context, cfg *config.NextDeployConfig, meta *nextcore.NextCorePayload) error
Deploy orchestrates the full serverless deployment pipeline:
- Discovers the build artifact (app.tar.gz)
- Fetches local secrets via SecretManager and pushes them to the cloud secret store
- Uploads static assets to CDN/Storage
- Deploys the compute layer (Lambda, Workers, etc.)
- Invalidates the CDN cache
func GenerateQuickReference ¶ added in v0.1.118
func GenerateQuickReference(resMap ServerlessResourceMap) string
GenerateQuickReference creates a markdown quick reference
func GenerateResourceView ¶ added in v0.1.95
func GenerateResourceView(appCfg *config.AppConfig, resMap ServerlessResourceMap) (string, error)
GenerateResourceView creates a premium HTML report of the provisioned resources
Types ¶
type AWSProvider ¶ added in v0.1.60
type AWSProvider struct {
// contains filtered or unexported fields
}
func NewAWSProvider ¶ added in v0.1.60
func NewAWSProvider() *AWSProvider
func (*AWSProvider) DeployCompute ¶ added in v0.1.60
func (p *AWSProvider) DeployCompute(ctx context.Context, pkg *packaging.PackageResult, appCfg *cfgTypes.NextDeployConfig, meta *nextcore.NextCorePayload) error
func (*AWSProvider) DeployStatic ¶ added in v0.1.60
func (p *AWSProvider) DeployStatic(ctx context.Context, pkg *packaging.PackageResult, appCfg *cfgTypes.NextDeployConfig, meta *nextcore.NextCorePayload) error
func (*AWSProvider) Destroy ¶ added in v0.1.76
func (p *AWSProvider) Destroy(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
func (*AWSProvider) GetResourceMap ¶ added in v0.1.95
func (p *AWSProvider) GetResourceMap(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) (ServerlessResourceMap, error)
func (*AWSProvider) GetSecrets ¶ added in v0.1.94
func (*AWSProvider) Initialize ¶ added in v0.1.60
func (p *AWSProvider) Initialize(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
func (*AWSProvider) InvalidateCache ¶ added in v0.1.60
func (p *AWSProvider) InvalidateCache(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
func (*AWSProvider) Rollback ¶ added in v0.1.89
func (p *AWSProvider) Rollback(ctx context.Context, appCfg *cfgTypes.NextDeployConfig) error
Rollback reverts the Lambda function to the previous deployed zip using the S3 deployment history. This is instant — no HTTP download required.
func (*AWSProvider) UnsetSecret ¶ added in v0.1.94
func (*AWSProvider) UpdateSecrets ¶ added in v0.1.60
type Provider ¶ added in v0.1.60
type Provider interface {
// Initialize validates credentials and prepares the environment.
Initialize(ctx context.Context, cfg *config.NextDeployConfig) error
// DeployStatic uploads static assets (public/, .next/static/) to a CDN/Storage bucket.
DeployStatic(ctx context.Context, pkg *packaging.PackageResult, cfg *config.NextDeployConfig, meta *nextcore.NextCorePayload) error
// GetSecrets retrieves all secrets for the application.
GetSecrets(ctx context.Context, appName string) (map[string]string, error)
// SetSecret sets a single secret for the application.
SetSecret(ctx context.Context, appName string, key, value string) error
// UnsetSecret removes a single secret from the application.
UnsetSecret(ctx context.Context, appName string, key string) error
// UpdateSecrets securely injects/syncs a batch of secrets.
UpdateSecrets(ctx context.Context, appName string, secrets map[string]string) error
// DeployCompute packages the standalone build and updates the compute layer
// (e.g., AWS Lambda + Web Adapter, Cloudflare Workers).
DeployCompute(ctx context.Context, pkg *packaging.PackageResult, cfg *config.NextDeployConfig, meta *nextcore.NextCorePayload) error
// InvalidateCache clears the CDN cache to ensure fresh assets are served.
InvalidateCache(ctx context.Context, cfg *config.NextDeployConfig) error
// Rollback reverts the compute layer to the previous version and
// invalidates the CDN cache so the old version is served immediately.
Rollback(ctx context.Context, cfg *config.NextDeployConfig) error
// Destroy removes all application resources from the cloud provider.
Destroy(ctx context.Context, cfg *config.NextDeployConfig) error
// GetResourceMap returns a summary of all provisioned cloud resources.
GetResourceMap(ctx context.Context, cfg *config.NextDeployConfig) (ServerlessResourceMap, error)
}
Provider defines the interface for deploying to various serverless platforms (e.g., AWS, Cloudflare, GCP, Azure).
type ProviderRules ¶ added in v0.1.122
type ProviderRules struct {
Name string
Icon string
RootFormat string
WwwFormat string
SSLFormat func(record dns.ValidationRecord) string
Warning string
ProTip string
ProxyWarning string
}
ProviderRules holds DNS provider-specific display instructions
type ServerlessResourceMap ¶ added in v0.1.95
type ServerlessResourceMap struct {
AppName string
Environment string
Region string
LambdaARN string
FunctionURL string
S3BucketName string
CloudFrontID string
CloudFrontDomain string
CustomDomain string
CertificateARN string
CertificateStatus string // "PENDING_VALIDATION", "ISSUED", "FAILED"
ValidationRecords []dns.ValidationRecord
DeploymentTime time.Time
DNSProvider string // "namecheap", "cloudflare", "godaddy", "route53", "other"
}
ServerlessResourceMap holds the metadata for the visual report
Click to show internal directories.
Click to hide internal directories.