Documentation
¶
Overview ¶
Package project provides project orchestration infrastructure.
Index ¶
Constants ¶
const ( // DefaultConfigurationFileName is the name of the Mutagen project // configuration file. DefaultConfigurationFileName = "mutagen.yml" // LockFileExtension is the extension added to a configuration file path in // order to compute the corresponding lock file. LockFileExtension = ".lock" )
const ( // LabelKey is the label key that's applied to sessions orchestrated by the // project, with the label value being the orchestration session identifier. LabelKey = "io.mutagen.project" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶ added in v0.12.0
type Configuration struct { // BeforeCreate are setup commands to be run before session creation. BeforeCreate []string `yaml:"beforeCreate"` // AfterCreate are setup commands to be run after session creation. AfterCreate []string `yaml:"afterCreate"` // BeforePause are setup commands to be run before session pausing. BeforePause []string `yaml:"beforePause"` // AfterPause are setup commands to be run after session pausing. AfterPause []string `yaml:"afterPause"` // BeforeResume are setup commands to be run before session resumption. BeforeResume []string `yaml:"beforeResume"` // AfterResume are setup commands to be run after session resumption. AfterResume []string `yaml:"afterResume"` // BeforeTerminate are teardown commands to be run before session // termination. BeforeTerminate []string `yaml:"beforeTerminate"` // AfterTerminate are teardown commands to be run after session termination. AfterTerminate []string `yaml:"afterTerminate"` // Commands are commands that can be invoked while a project is running. Commands map[string]string `yaml:"commands"` // Forwarding represents the forwarding sessions to be created. If a // "defaults" key is present, it is treated as a template upon which other // configurations are layered, thus keeping syntactic compatibility with the // global Mutagen configuration file. Forwarding map[string]ForwardingConfiguration `yaml:"forward"` // Synchronization represents the forwarding sessions to be created. If a // "defaults" key is present, it is treated as a template upon which other // configurations are layered, thus keeping syntactic compatibility with the // global Mutagen configuration file. Synchronization map[string]SynchronizationConfiguration `yaml:"sync"` }
Configuration is the orchestration configuration object type.
func LoadConfiguration ¶ added in v0.12.0
func LoadConfiguration(path string) (*Configuration, error)
LoadConfiguration attempts to load a YAML-based Mutagen orchestration configuration file from the specified path.
type FlushOnCreateBehavior ¶ added in v0.12.0
type FlushOnCreateBehavior uint8
FlushOnCreateBehavior is a custom YAML type that can encode various flush-on-create specifications, including a lack of specification.
const ( // FlushOnCreateBehaviorDefault indicates that flush-on-create behavior is // unspecified. FlushOnCreateBehaviorDefault FlushOnCreateBehavior = iota // FlushOnCreateBehaviorNoFlush indicates that flush-on-create behavior has // been disabled. FlushOnCreateBehaviorNoFlush // FlushOnCreateBehaviorFlush indicates that flush-on-create behavior has // been enabled. FlushOnCreateBehaviorFlush )
func (FlushOnCreateBehavior) FlushOnCreate ¶ added in v0.12.0
func (b FlushOnCreateBehavior) FlushOnCreate() bool
FlushOnCreate converts the behavior specification to an actual boolean indicating behavior.
func (FlushOnCreateBehavior) IsDefault ¶ added in v0.12.0
func (b FlushOnCreateBehavior) IsDefault() bool
IsDefault indicates whether or not the flush-on-create behavior is FlushOnCreateBehaviorDefault.
func (*FlushOnCreateBehavior) UnmarshalYAML ¶ added in v0.12.0
func (b *FlushOnCreateBehavior) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements Unmarshaler.UnmarshalYAML.
type ForwardingConfiguration ¶ added in v0.12.0
type ForwardingConfiguration struct { // Source is the source URL for the session. Source string `yaml:"source"` // Destination is the destination URL for the session. Destination string `yaml:"destination"` // Configuration is the configuration for the session. Configuration forwarding.Configuration `yaml:",inline"` // ConfigurationSource is the source-specific configuration for the session. ConfigurationSource forwarding.Configuration `yaml:"configurationSource"` // ConfigurationDestination is the destination-specific configuration for // the session. ConfigurationDestination forwarding.Configuration `yaml:"configurationDestination"` }
ForwardingConfiguration encodes a forwarding session specification.
type SynchronizationConfiguration ¶ added in v0.12.0
type SynchronizationConfiguration struct { // Alpha is the alpha URL for the session. Alpha string `yaml:"alpha"` // Beta is the beta URL for the session. Beta string `yaml:"beta"` // FlushOnCreate indicates the flush-on-create behavior for the session. FlushOnCreate FlushOnCreateBehavior `yaml:"flushOnCreate"` // Configuration is the configuration for the session. Configuration synchronization.Configuration `yaml:",inline"` // ConfigurationAlpha is the alpha-specific configuration for the session. ConfigurationAlpha synchronization.Configuration `yaml:"configurationAlpha"` // ConfigurationBeta is the beta-specific configuration for the session. ConfigurationBeta synchronization.Configuration `yaml:"configurationBeta"` }
SynchronizationConfiguration encodes a synchronization session specification.