apps

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectFiles

func CollectFiles(app AppConfig) ([]string, error)

CollectFiles returns all files under dir matching glob, project-root relative.

func ExecutePush

func ExecutePush(ctx context.Context, client *api.Client, app AppConfig, result Result) error

ExecutePush uploads/updates/deletes remote app files.

func ExplicitFiles

func ExplicitFiles(discovered []string, explicit []string) ([]string, error)

ExplicitFiles intersects discovered files with explicit project-relative selections.

func NormalizeHost

func NormalizeHost(raw string) string

NormalizeHost converts an API URL into the stored host form.

func OrderFiles

func OrderFiles(app AppConfig, files []string, provided ...map[string]string) ([]string, error)

OrderFiles topologically orders files by local import/require dependencies.

func RemoteName

func RemoteName(app AppConfig, projectRel string) string

Types

type AppConfig

type AppConfig struct {
	config.AppProjectConfig
	ProjectRoot string
}

AppConfig is one resolved local app config.

func ResolveApp

func ResolveApp(candidates []AppConfig, requested string) (AppConfig, error)

ResolveApp selects one app by local name.

func VisibleApps

func VisibleApps(projectRoot string, project config.ProjectConfig, activeHost, activeSite string) []AppConfig

VisibleApps filters apps by active host/site.

type FileAction

type FileAction struct {
	Action string `json:"action"`
	Local  string `json:"local,omitempty"`
	Name   string `json:"name"`
}

FileAction describes one cloud-code operation.

type PullOptions added in v0.2.2

type PullOptions struct {
	Only []string
}

PullOptions controls app-code pull scope.

type PullResult added in v0.2.2

type PullResult struct {
	AppKey    string       `json:"app_key"`
	LocalName string       `json:"local_name"`
	Files     []string     `json:"files,omitempty"`
	Written   []FileAction `json:"written,omitempty"`
}

PullResult is emitted by apps code pull.

func Pull added in v0.2.2

func Pull(ctx context.Context, client *api.Client, app AppConfig, opts PullOptions) (PullResult, error)

Pull downloads remote app code files into the configured local app directory.

type PushPlan

type PushPlan struct {
	Uploads []FileAction `json:"uploads,omitempty"`
	Deletes []FileAction `json:"deletes,omitempty"`
}

PushPlan groups upload/delete work.

func BuildPushPlan

func BuildPushPlan(app AppConfig, localFiles []string, remoteFiles []api.AppCodeFile, sync bool) PushPlan

BuildPushPlan computes upload/delete actions.

type Result

type Result struct {
	AppKey    string       `json:"app_key"`
	LocalName string       `json:"local_name"`
	Files     []string     `json:"files,omitempty"`
	Uploads   []FileAction `json:"uploads,omitempty"`
	Created   []FileAction `json:"created,omitempty"`
	Updated   []FileAction `json:"updated,omitempty"`
	Deleted   []FileAction `json:"deleted,omitempty"`
	Sync      bool         `json:"sync,omitempty"`
}

Result is emitted by apps push.

func PlanPush

func PlanPush(ctx context.Context, client *api.Client, app AppConfig, selected []string, sync bool) (Result, []string, error)

PlanPush computes a structured push result from local and remote files.

Jump to

Keyboard shortcuts

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