Documentation
¶
Index ¶
- Constants
- func FindRoot(start string) (string, error)
- func FormatPlan(p JobPlan) string
- func HasManifest(dir string) bool
- func ResolveLinkProjectID(tokenID string, listed []LinkProject, pick func([]LinkProject) (string, error)) (string, error)
- func SetProjectID(folderPath, projectID string) error
- type JobPlan
- type JobSpec
- type LinkProject
- type Manifest
- type Options
- type PlanAction
- type PlanItem
- type PlanOptions
- type Result
- type StampedJob
Constants ¶
const ( // ManifestFileName is the canonical project file. ManifestFileName = "sling_project.yml" // LegacyFileName is the older JSON project file. LegacyFileName = ".sling.json" )
Variables ¶
This section is empty.
Functions ¶
func FormatPlan ¶
FormatPlan prints a job plan as a table plus warnings.
func HasManifest ¶
HasManifest reports whether dir has sling_project.yml or .sling.json.
func ResolveLinkProjectID ¶
func ResolveLinkProjectID(tokenID string, listed []LinkProject, pick func([]LinkProject) (string, error)) (string, error)
ResolveLinkProjectID picks the platform project id to attach a folder to. A token-scoped id wins. Otherwise one listed project is used, or pick() when more than one exists.
func SetProjectID ¶
SetProjectID writes project_id into sling_project.yml and keeps comments.
Types ¶
type JobPlan ¶
JobPlan is the diff of manifest jobs vs stamped jobs.
func PlanJobs ¶
func PlanJobs(m Manifest, stamped []StampedJob, opts PlanOptions) JobPlan
PlanJobs diffs manifest jobs against the stamped (source_key) set.
func (JobPlan) HasPushActions ¶
HasPushActions reports whether the plan creates, updates, renames, or (when prune) deletes.
type JobSpec ¶
type JobSpec struct {
File string `yaml:"file,omitempty" json:"file,omitempty"`
Schedules []string `yaml:"schedules,omitempty" json:"schedules,omitempty"`
Streams []string `yaml:"streams,omitempty" json:"streams,omitempty"`
Mode string `yaml:"mode,omitempty" json:"mode,omitempty"`
Variables map[string]string `yaml:"variables,omitempty" json:"variables,omitempty"`
Retries *int `yaml:"retries,omitempty" json:"retries,omitempty"`
Timezone string `yaml:"timezone,omitempty" json:"timezone,omitempty"`
}
JobSpec is one entry under manifest jobs:. Extra YAML keys are ignored.
type LinkProject ¶
LinkProject is one platform project a token can attach to.
type Manifest ¶
type Manifest struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
ProjectID string `yaml:"project_id,omitempty" json:"id,omitempty"`
Paths []string `yaml:"paths,omitempty" json:"paths,omitempty"`
Jobs map[string]JobSpec `yaml:"jobs,omitempty" json:"jobs,omitempty"`
Root string `yaml:"-" json:"-"`
Path string `yaml:"-" json:"-"`
}
Manifest is a local Sling project file. Unknown YAML/JSON keys are ignored.
type Options ¶
type Options struct {
Dir string
Name string
Source string
Target string
Entity string
Yes bool
Force bool
}
Options controls project scaffolding.
type PlanAction ¶
type PlanAction string
PlanAction is one row in a job deploy plan.
const ( PlanCreate PlanAction = "create" PlanUpdate PlanAction = "update" PlanDelete PlanAction = "delete" PlanOrphan PlanAction = "orphan" PlanRename PlanAction = "rename" PlanKeep PlanAction = "keep" )
type PlanItem ¶
type PlanItem struct {
Action PlanAction
SourceKey string
OldKey string
Spec JobSpec
Warning string
}
PlanItem is one planned change.
type PlanOptions ¶
PlanOptions controls rename mapping and prune.