integrations

package
v0.0.112 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(fmwk schema.Framework, i Integration)

Types

type DevObserver

type DevObserver interface {
	io.Closer
	OnDeployment(context.Context)
}

type HotReloadOpts

type HotReloadOpts struct {
	Sink wsremote.Sink
	// If "eventProcessor" is set:
	//   - If it returns nil, a full rebuild will be triggered instead of a hot reload.
	//   - If it returns a non-nil event, that event will be used instead of the original event.
	EventProcessor func(*wscontents.FileEvent) *wscontents.FileEvent
}

type Integration

type Integration interface {
	parsing.FrameworkHandler

	// Called on `ns build`, `ns deploy`.
	PrepareBuild(context.Context, assets.AvailableBuildAssets, planning.Server, bool) (build.Spec, error)
	PrepareRun(context.Context, planning.Server, *runtime.ContainerRunOpts) error

	// Called on `ns tidy`
	TidyWorkspace(context.Context, cfg.Context, []*pkggraph.Package) error
	TidyNode(context.Context, cfg.Context, pkggraph.PackageLoader, *pkggraph.Package) error
	TidyServer(context.Context, cfg.Context, pkggraph.PackageLoader, pkggraph.Location, *schema.Server) error

	// Called on `ns generate`.
	GenerateNode(*pkggraph.Package, []*schema.Node) ([]*schema.SerializedInvocation, error)
	GenerateServer(*pkggraph.Package, []*schema.Node) ([]*schema.SerializedInvocation, error)

	// Called on `ns dev`.
	PrepareDev(context.Context, runtime.ClusterNamespace, planning.Server) (context.Context, DevObserver, error)
	PrepareHotReload(context.Context, *wsremote.SinkRegistrar, planning.Server) *HotReloadOpts
}

func IntegrationFor

func IntegrationFor(fmwk schema.Framework) Integration

type MaybeGenerate

type MaybeGenerate struct{}

func (MaybeGenerate) GenerateNode

func (MaybeGenerate) GenerateServer

type MaybePrepare

type MaybePrepare struct{}

type MaybeTidy

type MaybeTidy struct{}

func (MaybeTidy) TidyWorkspace

func (MaybeTidy) TidyWorkspace(context.Context, cfg.Context, []*pkggraph.Package) error

type NoDev

type NoDev struct{}

Directories

Path Synopsis
nodejs

Jump to

Keyboard shortcuts

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