Documentation ¶
Index ¶
- Variables
- type Context
- type ContextWithMutableModule
- type EditableWorkspaceData
- type ExpectedResourceInstance
- type Location
- type Module
- func (mod *Module) Abs() string
- func (mod *Module) ErrorLocation() string
- func (mod *Module) IsExternal() bool
- func (mod *Module) MakeLocation(relPath string) Location
- func (mod *Module) ModuleName() string
- func (mod *Module) ReadOnlyFS() fs.FS
- func (mod *Module) ReadWriteFS() fnfs.ReadWriteFS
- func (mod *Module) RootLocation() Location
- func (mod *Module) VCS(ctx context.Context) (*runtime.BuildVCS, error)
- func (mod *Module) Version() string
- func (mod *Module) VersionedFS(rel string, observeChanges bool) compute.Computable[wscontents.Versioned]
- type MutableModule
- type Package
- func (pr *Package) LookupBinary(name string) (*schema.Binary, error)
- func (pr *Package) LookupResourceClass(name string) *ResourceClass
- func (pr *Package) LookupResourceInstance(name string) *ResourceInstance
- func (pr *Package) LookupResourceProvider(classRef *schema.PackageRef) *ResourceProvider
- func (pr *Package) LookupSecret(name string) *schema.SecretSpec
- func (pr *Package) Node() *schema.Node
- func (pr *Package) PackageName() schema.PackageName
- type PackageLoader
- type PreProvision
- type PreStartup
- type PrepareHook
- type PreparedProvisionPlan
- type ProvisionInputs
- type ProvisionPlan
- type ResourceClass
- type ResourceInstance
- type ResourceProvider
- type ResourceSpec
- type SealedContext
- type SealedPackageLoader
- type StackEndpoints
- type StartupInputs
- type UserType
- type ValueWithPath
- type WorkspaceData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PackageLoaderInjection = execution.Define[PackageLoader]("ns.pkggraph.package-loader") MutableModuleInjection = execution.Define[MutableModule]("ns.pkggraph.mutable-module") )
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface { cfg.Context PackageLoader }
type ContextWithMutableModule ¶
type ContextWithMutableModule interface { Context MutableModule }
type EditableWorkspaceData ¶
type EditableWorkspaceData interface { FormatTo(io.Writer) error WithSetDependency(...*schema.Workspace_Dependency) WorkspaceData WithReplacedDependencies([]*schema.Workspace_Dependency) WorkspaceData }
type ExpectedResourceInstance ¶
type ExpectedResourceInstance struct { Name *schema.PackageRef Class ResourceClass }
type Location ¶
type Location struct { Module *Module PackageName schema.PackageName // contains filtered or unexported fields }
func NewLocationForTesting ¶
func (Location) Abs ¶
Abs returns an absolute path to the location. If path segments are passed in, the combined relative path is returned.
func (Location) CheckRel ¶
CheckRel returns a path relative to the module. If the path attempts to escape the module, an error is returned.
func (Location) ErrorLocation ¶
ErrorLocation implements the fnerrors.Location interface.
type Module ¶
type Module struct { Workspace *schema.Workspace WorkspaceData WorkspaceData // contains filtered or unexported fields }
func (*Module) ErrorLocation ¶
Implements fnerrors.Location.
func (*Module) IsExternal ¶
An external module is downloaded from a remote location and stored in the cache. It always has a version.
func (*Module) MakeLocation ¶
func (*Module) ModuleName ¶
func (*Module) ReadOnlyFS ¶
func (*Module) ReadWriteFS ¶
func (mod *Module) ReadWriteFS() fnfs.ReadWriteFS
func (*Module) RootLocation ¶
func (*Module) VersionedFS ¶
func (mod *Module) VersionedFS(rel string, observeChanges bool) compute.Computable[wscontents.Versioned]
type MutableModule ¶
type MutableModule interface { ModuleName() string // The module that this workspace corresponds to. ReadWriteFS() fnfs.ReadWriteFS }
type Package ¶
type Package struct { Location Location PackageSources fs.FS // Filenames included will be relative to the module root, not the package. NewFrontend bool // If set to true, the new frontend parser was used to load this package. Parsed PreProvision // One of. Extension *schema.Node Service *schema.Node Server *schema.Server ExperimentalFunction *schema.ExperimentalFunction // Includes auto-generated (e.g. server startup) tests. Tests []*schema.Test // Inlined or explicitly defined binaries. Binaries []*schema.Binary // Integration that has been applied to the server in this package. May be nil. // Shouldn't be used outside of workspace.FinalizePackage. Integration *schema.Integration // Parsed secret definitions within the package. Secrets []*schema.SecretSpec // Parsed volume definitions within the package. Volumes []*schema.Volume // Resources associated with node types. Provides map[string]*protos.FileDescriptorSetAndDeps // key: `Provides.Name` Services map[string]*protos.FileDescriptorSetAndDeps // key: fully qualified service name PackageData []*types.Resource // Parsed resources Resources []ResourceInstance ResourceClasses []ResourceClass ResourceProviders []ResourceProvider // Hooks PrepareHooks []PrepareHook // Raw resources definitions within a package. ResourceClassSpecs []*schema.ResourceClass ResourceProvidersSpecs []*schema.ResourceProvider ResourceInstanceSpecs []*schema.ResourceInstance }
func LoadBinary ¶
func LoadBinary(ctx context.Context, pl PackageLoader, ref *schema.PackageRef) (*Package, *schema.Binary, error)
func (*Package) LookupResourceClass ¶
func (pr *Package) LookupResourceClass(name string) *ResourceClass
func (*Package) LookupResourceInstance ¶
func (pr *Package) LookupResourceInstance(name string) *ResourceInstance
func (*Package) LookupResourceProvider ¶
func (pr *Package) LookupResourceProvider(classRef *schema.PackageRef) *ResourceProvider
func (*Package) LookupSecret ¶
func (pr *Package) LookupSecret(name string) *schema.SecretSpec
func (*Package) PackageName ¶
func (pr *Package) PackageName() schema.PackageName
type PackageLoader ¶
type PreProvision ¶
type PreProvision interface {
EvalProvision(context.Context, cfg.Context, ProvisionInputs) (ProvisionPlan, error)
}
type PreStartup ¶
type PreStartup interface {
EvalStartup(context.Context, Context, StartupInputs, []ValueWithPath) (*schema.StartupPlan, error)
}
type PrepareHook ¶
type PrepareHook struct { InvokeInternal string InvokeBinary *schema.Invocation }
type PreparedProvisionPlan ¶
type PreparedProvisionPlan struct { DeclaredStack []schema.PackageName Sidecars []*schema.SidecarContainer Inits []*schema.SidecarContainer ComputePlanWith []*schema.Invocation // Will generate further plan contents. }
func (*PreparedProvisionPlan) AppendWith ¶
func (p *PreparedProvisionPlan) AppendWith(rhs PreparedProvisionPlan)
type ProvisionInputs ¶
type ProvisionInputs struct {
ServerLocation Location
}
type ProvisionPlan ¶
type ProvisionPlan struct { Startup PreStartup // All fields on Nodes. Servers only allow specifying `Provisioning`. PreparedProvisionPlan // Server only. Naming *schema.Naming }
type ResourceClass ¶
type ResourceClass struct { Ref *schema.PackageRef Source *schema.ResourceClass IntentType UserType InstanceType UserType }
func LookupResourceClass ¶
func LookupResourceClass(ctx context.Context, pl PackageLoader, ref *schema.PackageRef) (*ResourceClass, error)
func (ResourceClass) PackageName ¶
func (rc ResourceClass) PackageName() schema.PackageName
type ResourceInstance ¶
type ResourceInstance struct { ResourceRef *schema.PackageRef Spec ResourceSpec }
type ResourceProvider ¶
type ResourceProvider struct { Spec *schema.ResourceProvider Resources []ResourceInstance ResourceInputs []ExpectedResourceInstance }
func (ResourceProvider) LookupExpected ¶
func (rp ResourceProvider) LookupExpected(name *schema.PackageRef) *ExpectedResourceInstance
type ResourceSpec ¶
type ResourceSpec struct { Source *schema.ResourceInstance Class ResourceClass Provider *ResourceProvider ResourceInputs []ResourceInstance // Resources passed to the provider. }
type SealedContext ¶
type SealedContext interface { cfg.Context SealedPackageLoader }
func MakeSealedContext ¶
func MakeSealedContext(env cfg.Context, pr SealedPackageLoader) SealedContext
type SealedPackageLoader ¶
type SealedPackageLoader interface { PackageLoader Modules() []*Module Packages() []*Package }
type StackEndpoints ¶
type StackEndpoints interface {
EndpointsBy(schema.PackageName) []*schema.Endpoint
}
type StartupInputs ¶
type StartupInputs struct { ServerImage string // Result of imageID.ImageRef(), not oci.ImageID to avoid cycles. Stack StackEndpoints ServerRootAbs string }
type UserType ¶
type UserType struct { Descriptor protoreflect.MessageDescriptor Sources *protos.FileDescriptorSetAndDeps Registry *protoregistry.Files }
type ValueWithPath ¶
type WorkspaceData ¶
Click to show internal directories.
Click to hide internal directories.