Documentation
¶
Index ¶
- Constants
- Variables
- func GetQuiltPath() string
- 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 Image
- type ImportGetter
- type Label
- type Machine
- type Node
- type Placement
- type Range
- type Stitch
Constants ¶
const PublicInternetLabel = "public"
PublicInternetLabel is a magic label that allows connections to or from the public network.
const QuiltPathKey = "QUILT_PATH"
QuiltPathKey is the environment variable key we use to lookup the Quilt path.
Variables ¶
var DefaultImportGetter = NewImportGetter(GetQuiltPath())
DefaultImportGetter uses the default QUILT_PATH, and doesn't automatically download imports.
var HTTPGet = http.Get
HTTPGet is the function used to make the HTTP GET request for the GitHub keys. Exported so that we can run specs in tests without actually interacting with the network.
Functions ¶
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 ¶
type Connection struct { From string `json:",omitempty"` To string `json:",omitempty"` MinPort int `json:",omitempty"` MaxPort int `json:",omitempty"` }
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 Container ¶
type Container struct { ID string `json:",omitempty"` Image Image `json:",omitempty"` Command []string `json:",omitempty"` Env map[string]string `json:",omitempty"` FilepathToContent map[string]string `json:",omitempty"` Hostname string `json:",omitempty"` }
A Container may be instantiated in the stitch and queried by users.
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 Image ¶
An Image represents a Docker image that can be run. If the Dockerfile is non-empty, the image should be built and hosted by Quilt.
type ImportGetter ¶
type ImportGetter struct { Path string AutoDownload bool // contains filtered or unexported fields }
ImportGetter provides functions for working with imports.
func NewImportGetter ¶
func NewImportGetter(path string) ImportGetter
NewImportGetter returns an ImporGetter with the given path and without automatic downloads.
func (ImportGetter) Get ¶
func (getter ImportGetter) Get(repoName string) error
Get takes in an import path `repoName`, and attempts to download the repository associated with that repoName.
type Label ¶
type Label struct { Name string `json:",omitempty"` IDs []string `json:",omitempty"` Annotations []string `json:",omitempty"` }
A Label represents a logical group of containers.
type Machine ¶
type Machine struct { ID string `json:",omitempty"` Provider string `json:",omitempty"` Role string `json:",omitempty"` Size string `json:",omitempty"` CPU Range `json:",omitempty"` RAM Range `json:",omitempty"` DiskSize int `json:",omitempty"` Region string `json:",omitempty"` SSHKeys []string `json:",omitempty"` FloatingIP string `json:",omitempty"` Preemptible bool `json:",omitempty"` }
A Machine specifies the type of VM that should be booted.
type Node ¶
type Node struct { Name string Label string Annotations map[string]struct{} Connections map[string]Node }
A Node in the communiction Graph.
type Placement ¶
type Placement struct { TargetLabel string `json:",omitempty"` Exclusive bool `json:",omitempty"` // Label Constraint OtherLabel string `json:",omitempty"` // Machine Constraints Provider string `json:",omitempty"` Size string `json:",omitempty"` Region string `json:",omitempty"` FloatingIP string `json:",omitempty"` }
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 { Containers []Container `json:",omitempty"` Labels []Label `json:",omitempty"` Connections []Connection `json:",omitempty"` Placements []Placement `json:",omitempty"` Machines []Machine `json:",omitempty"` AdminACL []string `json:",omitempty"` MaxPrice float64 `json:",omitempty"` Namespace string `json:",omitempty"` Invariants []invariant `json:",omitempty"` }
A Stitch is an abstract representation of the policy language.
func FromFile ¶
func FromFile(filename string, getter ImportGetter) (Stitch, error)
FromFile gets a Stitch handle from a file on disk.
func FromJavascript ¶
func FromJavascript(specStr string, getter ImportGetter) (Stitch, error)
FromJavascript gets a Stitch handle from a string containing Javascript code.