Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2374)

Delta Between Two Patch Sets: environs/interface.go

Issue 6215045: environs: add NewEnviron(kind, config) (Closed)
Left Patch Set: environs: add NewEnviron(kind, config) Created 12 years, 10 months ago
Right Patch Set: environs: add NewEnviron(kind, config) Created 12 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « environs/config.go ('k') | environs/open.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package environs 1 package environs
2 2
3 import ( 3 import (
4 "errors" 4 "errors"
5 "io" 5 "io"
6 "launchpad.net/juju/go/schema" 6 "launchpad.net/juju/go/schema"
7 "launchpad.net/juju/go/state" 7 "launchpad.net/juju/go/state"
8 ) 8 )
9 9
10 // A EnvironProvider represents a computing and storage provider. 10 // A EnvironProvider represents a computing and storage provider.
11 type EnvironProvider interface { 11 type EnvironProvider interface {
12 // ConfigChecker is used to check sections of the environments.yaml 12 // ConfigChecker is used to check sections of the environments.yaml
13 // file that specify this provider. The value passed to the Checker is 13 // file that specify this provider. The value passed to the Checker is
14 // that returned from the yaml parse, of type schema.MapType. 14 // that returned from the yaml parse, of type schema.MapType.
15 ConfigChecker() schema.Checker 15 ConfigChecker() schema.Checker
16 16
17 » // Open creates a new Environ with the attributes returned by· 17 » // Open opens an environment with config, which must
18 » // schema.Checker.Coerce(). The name is that given in environments.yaml. 18 » // have been processed and validated by the schema
niemeyer 2012/05/17 01:23:08 There's a relationship between ConfigChecker and O
dave_cheney.net 2012/05/17 01:46:52 Done.
19 » Open(name string, attributes interface{}) (Environ, error) 19 » // checker returned by ConfigChecker.
20 » Open(name string, config interface{}) (Environ, error)
20 } 21 }
21 22
22 var ErrNoDNSName = errors.New("DNS name not allocated") 23 var ErrNoDNSName = errors.New("DNS name not allocated")
23 24
24 // Instance represents the provider-specific notion of a machine. 25 // Instance represents the provider-specific notion of a machine.
25 type Instance interface { 26 type Instance interface {
26 // Id returns a provider-generated identifier for the Instance. 27 // Id returns a provider-generated identifier for the Instance.
27 Id() string 28 Id() string
28 29
29 // DNSName returns the DNS name for the instance. 30 // DNSName returns the DNS name for the instance.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 RemoveFile(file string) error 98 RemoveFile(file string) error
98 99
99 // Destroy shuts down all known machines and destroys the 100 // Destroy shuts down all known machines and destroys the
100 // rest of the environment. A list of instances known to 101 // rest of the environment. A list of instances known to
101 // be part of the environment can be given with insts. 102 // be part of the environment can be given with insts.
102 // This is because recently started machines might not 103 // This is because recently started machines might not
103 // yet be visible in the environment, so this method 104 // yet be visible in the environment, so this method
104 // can wait until they are. 105 // can wait until they are.
105 Destroy(insts []Instance) error 106 Destroy(insts []Instance) error
106 } 107 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b