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

Delta Between Two Patch Sets: store/charmd/main.go

Issue 6120052: cmd/juju: working bootstrap and destroy commands
Left Patch Set: Created 12 years, 11 months ago
Right Patch Set: cmd/juju: working bootstrap and destroy commands Created 12 years, 11 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:
Right: Side by side diff | Download
« no previous file with change/comment | « juju/conn.go ('k') | store/server_test.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
(no file at all)
1 package main 1 package main
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "io/ioutil" 5 "io/ioutil"
6 "launchpad.net/goyaml" 6 "launchpad.net/goyaml"
7 "launchpad.net/juju/go/log" 7 "launchpad.net/juju/go/log"
8 "launchpad.net/juju/go/store" 8 "launchpad.net/juju/go/store"
9 stdlog "log" 9 stdlog "log"
10 "net/http" 10 "net/http"
11 "os" 11 "os"
12 "path/filepath" 12 "path/filepath"
13 ) 13 )
14 14
15 func main() { 15 func main() {
16 log.Target = stdlog.New(os.Stdout, "", stdlog.LstdFlags) 16 log.Target = stdlog.New(os.Stdout, "", stdlog.LstdFlags)
17 err := serve() 17 err := serve()
18 if err != nil { 18 if err != nil {
19 fmt.Fprintf(os.Stderr, "%v\n", err) 19 fmt.Fprintf(os.Stderr, "%v\n", err)
20 os.Exit(1) 20 os.Exit(1)
21 } 21 }
22 } 22 }
23 23
24 type config struct { 24 type config struct {
25 MongoURL string `yaml:"mongo-url"` 25 MongoURL string `yaml:"mongo-url"`
26 » APIAddr string `yaml:"api-addr"` 26 » APIAddr string `yaml:"api-addr"`
27 } 27 }
28 28
29 func readConfig(path string, conf interface{}) error { 29 func readConfig(path string, conf interface{}) error {
30 f, err := os.Open(path) 30 f, err := os.Open(path)
31 if err != nil { 31 if err != nil {
32 return fmt.Errorf("opening config file: %v", err) 32 return fmt.Errorf("opening config file: %v", err)
33 } 33 }
34 data, err := ioutil.ReadAll(f) 34 data, err := ioutil.ReadAll(f)
35 f.Close() 35 f.Close()
36 if err != nil { 36 if err != nil {
(...skipping 28 matching lines...) Expand all
65 if err != nil { 65 if err != nil {
66 return err 66 return err
67 } 67 }
68 defer s.Close() 68 defer s.Close()
69 server, err := store.NewServer(s) 69 server, err := store.NewServer(s)
70 if err != nil { 70 if err != nil {
71 return err 71 return err
72 } 72 }
73 return http.ListenAndServe(conf.APIAddr, server) 73 return http.ListenAndServe(conf.APIAddr, server)
74 } 74 }
LEFTRIGHT

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