project

package
v0.0.0-...-611bec0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DotenvFileName      = ".env"
	LocalDotenvFileName = ".env.local"
)
View Source
const (
	DefaultFileName = configStem + jsonSuffix
	YAMLFileName    = configStem + yamlSuffix
	TSFileName      = configStem + tsSuffix
)
View Source
const DefaultLifecycleTimeout = 30 * time.Minute

Variables

This section is empty.

Functions

func DeriveSlug

func DeriveSlug(name string) string

func EnvLookup

func EnvLookup(dir string) (configdoc.Lookup, error)

func FindConfig

func FindConfig(startDir, explicitPath string) (string, error)

func FindRoot

func FindRoot(startDir, explicitPath string) (string, error)

func IsConfig

func IsConfig(path string) bool

func IsTypeScript

func IsTypeScript(path string) bool

func IsYAML

func IsYAML(path string) bool

func OtherConfigFiles

func OtherConfigFiles(configPath string) []string

func PreviewBaseDomain

func PreviewBaseDomain(previewDomain string) string

func SharedFolder

func SharedFolder(apps []App) string

func ValidateFolder

func ValidateFolder(folder string) error

func ValidatePreviewDomain

func ValidatePreviewDomain(domain string) error

func ValidateSlug

func ValidateSlug(s string) error

Types

type App

type App struct {
	Name              string
	Path              string
	Folder            string
	Arch              string
	ProductionDomains []string
	Compute           provider.Compute
	Framework         string
	Language          language.Language
	Languages         []language.Language
	Entrypoint        string
	FrameworkSource   language.Source
	Evidence          string
	GoModule          *gomodule.Module
	GoPackage         string
	Container         *Container

	BuildsWithResources bool
	// contains filtered or unexported fields
}

func (App) Architecture

func (a App) Architecture() string

func (App) HasLanguageManifest

func (a App) HasLanguageManifest() bool

func (App) IsBuiltAsFunctions

func (a App) IsBuiltAsFunctions() bool

func (App) IsBuiltAsImage

func (a App) IsBuiltAsImage() bool

func (App) IsBuiltFromFunction

func (a App) IsBuiltFromFunction() bool

func (App) Program

func (a App) Program() workspace.Program

func (App) RunsOn

func (a App) RunsOn(compute provider.Compute) bool

type Binding

type Binding struct {
	Type     resourcesv1.ResourceType
	Name     string
	Tier     environmentv1.Tier
	External string
	Inline   *Inline
}

func (Binding) Group

func (b Binding) Group() string

func (Binding) RecordName

func (b Binding) RecordName() string

type BucketInline

type BucketInline struct {
	Endpoint        Text
	Region          Text
	Bucket          Text
	Prefix          Text
	PathStyle       bool
	AccessKeyID     string
	SecretAccessKey string
	PublicBaseURL   Text
}

type Build

type Build struct {
	Dockerfile string
	Context    string
	Command    string
}

type Container

type Container struct {
	Build        *Build
	Health       *Health
	MinInstances *int
	MaxInstances *int

	FromFunction bool
}

func (*Container) Instances

func (c *Container) Instances() provider.Instances

type DNS

type DNS struct {
	Kind string
	Zone string
}

type Domains

type Domains struct {
	Production []string
	Preview    string
}

type Edge

type Edge struct {
	Kind    edge.Kind
	Options *structpb.Struct
}

type FrameworkUnstatedError

type FrameworkUnstatedError struct {
	App  string
	Path string
}

func (*FrameworkUnstatedError) Error

func (e *FrameworkUnstatedError) Error() string

type Health

type Health struct {
	Path string
}

type Hostname

type Hostname struct {
	Name string
	App  string
}

type Inline

type Inline struct {
	Postgres *PostgresInline
	Bucket   *BucketInline
}

func (*Inline) Variables

func (i *Inline) Variables() []string

type Lifecycle

type Lifecycle struct {
	PreBuild *LifecycleCommand
}

type LifecycleCommand

type LifecycleCommand struct {
	Command  string
	App      string
	Path     string
	Previews Previews
	Timeout  time.Duration
}

func (LifecycleCommand) RunsIn

type NoConfigError

type NoConfigError struct {
	Names    []string
	StartDir string
}

func (NoConfigError) Error

func (e NoConfigError) Error() string

func (NoConfigError) Finding

func (e NoConfigError) Finding() string

func (NoConfigError) Hint

func (NoConfigError) Hint() string

func (NoConfigError) Missing

func (NoConfigError) Missing() prerequisite.Kind

func (NoConfigError) Remedy

func (e NoConfigError) Remedy() string

type PostgresInline

type PostgresInline struct {
	URL      string
	Host     Text
	Port     int
	Database Text
	Username Text
	Password string
	TLS      *PostgresTLS
}

type PostgresTLS

type PostgresTLS struct {
	Mode string
	CA   string
}

type Previews

type Previews string
const (
	PreviewsPersistent Previews = "persistent"
	PreviewsAll        Previews = "all"
	PreviewsNone       Previews = "none"
)

type Project

type Project struct {
	Slug              string
	Transforms        []string
	DiscoveryPaths    []string
	Provider          *Provider
	Edge              *Edge
	DNS               *DNS
	AllowDegraded     []edge.Need
	Apps              []App
	RootAppUndetected error
	Bindings          []Binding
	Domains           Domains
	Registry          *Registry
	Lifecycle         Lifecycle
	Protection        Protection
	EnvSource         envsource.Tiers
	Dir               string
	Path              string
}

func Load

func Load(ctx context.Context, startDir, explicitPath string) (*Project, error)

func LoadOptional

func LoadOptional(ctx context.Context, startDir, explicitPath string) (*Project, error)

func NewUnconfigured

func NewUnconfigured(dir, slug string) *Project

func (*Project) BindingsFor

func (p *Project) BindingsFor(tier environmentv1.Tier) []Binding

func (*Project) ConfiguredHostnames

func (p *Project) ConfiguredHostnames(tier environmentv1.Tier) []*contractv1.ConfiguredHostname

func (*Project) DescribeFrameworks

func (p *Project) DescribeFrameworks() []string

func (*Project) EdgeKind

func (p *Project) EdgeKind() edge.Kind

func (*Project) EdgeSelection

func (p *Project) EdgeSelection() *contractv1.EdgeSelection

func (*Project) HasJSApp

func (p *Project) HasJSApp() bool

func (*Project) HasProvider

func (p *Project) HasProvider() bool

func (*Project) HasUnclearRootApp

func (p *Project) HasUnclearRootApp() bool

func (*Project) HostnameNames

func (p *Project) HostnameNames(tier environmentv1.Tier) []string

func (*Project) Hostnames

func (p *Project) Hostnames(tier environmentv1.Tier) []Hostname

func (*Project) RequireProvider

func (p *Project) RequireProvider() (*Provider, error)

func (*Project) ResolveComputes

func (p *Project) ResolveComputes(runs []string, vendor string) (*Project, error)

func (*Project) ResolveDeclaredComputes

func (p *Project) ResolveDeclaredComputes() (*Project, error)

func (*Project) UnresolvedApps

func (p *Project) UnresolvedApps() []string

type Protection

type Protection struct {
	Production bool
	Preview    bool
}

func (Protection) Protects

func (p Protection) Protects(tier environmentv1.Tier) bool

type Provider

type Provider struct {
	ID      string
	Options json.RawMessage
}

type Registry

type Registry struct {
	Server    string
	Namespace string
	Username  string
	Password  string
}

type Text

type Text struct {
	Literal  string
	Variable string
}

func (Text) Resolve

func (t Text) Resolve(read func(variable string) (string, error)) (string, error)

Jump to

Keyboard shortcuts

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