Documentation ¶
Index ¶
- Constants
- func Compile(sc scanner.Scanner, path string, download bool) (string, error)
- func GetQuiltPath() string
- func GetSpec(repoName string) error
- type AvailabilitySet
- func (avSet AvailabilitySet) Check(label string) bool
- func (avSet AvailabilitySet) CopyAvSet() AvailabilitySet
- func (avSet AvailabilitySet) Insert(labels ...string)
- func (avSet AvailabilitySet) Nodes() []string
- func (avSet AvailabilitySet) Remove(labels ...string)
- func (avSet AvailabilitySet) Str() string
- type Connection
- type ConnectionSlice
- type Container
- type Edge
- type Graph
- type Machine
- type Node
- type Placement
- type Range
- type Stitch
- func (stitch Stitch) QueryConnections() []Connection
- func (stitch Stitch) QueryContainers() []*Container
- func (stitch Stitch) QueryFloat(key string) (float64, error)
- func (stitch Stitch) QueryLabels() map[string][]int
- func (stitch Stitch) QueryMachines() []Machine
- func (stitch Stitch) QueryPlacements() []Placement
- func (stitch Stitch) QueryStrSlice(key string) []string
- func (stitch Stitch) QueryString(key string) string
- func (stitch Stitch) String() string
Constants ¶
const PublicInternetLabel = "public"
PublicInternetLabel is a magic label that allows connections to or from the public network.
Variables ¶
This section is empty.
Functions ¶
func Compile ¶
Compile takes a Stitch (possibly with imports), and transforms it into a single string that can be evaluated without other dependencies. It also confirms that the result doesn't have any invariant, syntax, or evaluation errors.
func GetQuiltPath ¶
func GetQuiltPath() string
GetQuiltPath returns the user-defined QUILT_PATH, or the default absolute QUILT_PATH, which is ~/.quilt if the user did not specify a QUILT_PATH.
Types ¶
type AvailabilitySet ¶
type AvailabilitySet map[string]struct{}
AvailabilitySet represents a set of containers which can be placed together on a VM.
func (AvailabilitySet) Check ¶
func (avSet AvailabilitySet) Check(label string) bool
Check checks set membership.
func (AvailabilitySet) CopyAvSet ¶
func (avSet AvailabilitySet) CopyAvSet() AvailabilitySet
CopyAvSet returns a copy of the set.
func (AvailabilitySet) Insert ¶
func (avSet AvailabilitySet) Insert(labels ...string)
Insert inserts labels into the set.
func (AvailabilitySet) Nodes ¶
func (avSet AvailabilitySet) Nodes() []string
Nodes returns the membership of the set.
func (AvailabilitySet) Remove ¶
func (avSet AvailabilitySet) Remove(labels ...string)
Remove removes labels from the set.
func (AvailabilitySet) Str ¶
func (avSet AvailabilitySet) Str() string
Str returns the string representation of the set.
type Connection ¶
A Connection allows containers implementing the From label to speak to containers implementing the To label in ports in the range [MinPort, MaxPort]
type ConnectionSlice ¶
type ConnectionSlice []Connection
A ConnectionSlice allows for slices of Collections to be used in joins
func (ConnectionSlice) Get ¶
func (cs ConnectionSlice) Get(ii int) interface{}
Get returns the value contained at the given index
func (ConnectionSlice) Len ¶
func (cs ConnectionSlice) Len() int
Len returns the number of items in the slice
type Graph ¶
type Graph struct { Nodes map[string]Node // A set of containers which can be placed together on a VM. Availability []AvailabilitySet // Constraints on which containers can be placed together. Placement map[string][]string Machines []Machine }
A Graph represents permission to communicate across a series of Nodes. Each Node is a container and each edge is permissions to initiate a connection.
func InitializeGraph ¶
InitializeGraph queries the Stitch to fill in the Graph structure.
func (Graph) GetConnections ¶
GetConnections returns a list of the edges in the Graph.
type Machine ¶
type Machine struct { Provider string Role string Size string CPU Range RAM Range DiskSize int Region string SSHKeys []string }
A Machine specifies the type of VM that should be booted.
type Placement ¶
type Placement struct { TargetLabel string Exclusive bool // Label Constraint OtherLabel string // Machine Constraints Provider string Size string Region string }
A Placement constraint guides where containers may be scheduled, either relative to the labels of other containers, or the machine the container will run on.
type Stitch ¶
type Stitch struct {
// contains filtered or unexported fields
}
A Stitch is an abstract representation of the policy language.
func (Stitch) QueryConnections ¶
func (stitch Stitch) QueryConnections() []Connection
QueryConnections returns the connections declared in the stitch.
func (Stitch) QueryContainers ¶
QueryContainers retrieves all containers declared in stitch.
func (Stitch) QueryFloat ¶
QueryFloat returns a float value defined in the stitch.
func (Stitch) QueryLabels ¶
QueryLabels returns a map where the keys are labels defined in the stitch, and the values are a slice of container IDs.
func (Stitch) QueryMachines ¶
QueryMachines returns all machines declared in the stitch.
func (Stitch) QueryPlacements ¶
QueryPlacements returns the placements declared in the stitch.
func (Stitch) QueryStrSlice ¶
QueryStrSlice returns a string slice value defined in the stitch.
func (Stitch) QueryString ¶
QueryString returns a string value defined in the stitch.