project

package
v0.11.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package project provides the infrastructure need to load project configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

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

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.11.1

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
	// FlushOnCreateBehaviorNoFlush indicates that flush-on-create behavior has
	// been enabled.
	FlushOnCreateBehaviorFlush
)

func (FlushOnCreateBehavior) FlushOnCreate added in v0.11.1

func (b FlushOnCreateBehavior) FlushOnCreate() bool

FlushOnCreate converts the behavior specification to an actual boolean indicating behavior.

func (FlushOnCreateBehavior) IsDefault added in v0.11.1

func (b FlushOnCreateBehavior) IsDefault() bool

IsDefault indicates whether or not the flush-on-create behavior is FlushOnCreateBehaviorDefault.

func (*FlushOnCreateBehavior) UnmarshalYAML added in v0.11.1

func (b *FlushOnCreateBehavior) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements Unmarshaler.UnmarshalYAML.

type ForwardingConfiguration

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 full forwarding session specification.

type SynchronizationConfiguration

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 full synchronization session specification.

Jump to

Keyboard shortcuts

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