| ... | ... |
@@ -131,6 +131,7 @@ func Login(authConfig *AuthConfig) (string, error) {
|
| 131 | 131 |
status = "Account Created\n" |
| 132 | 132 |
storeConfig = true |
| 133 | 133 |
} else if reqStatusCode == 400 {
|
| 134 |
+ // FIXME: This should be 'exists', not 'exist'. Need to change on the server first. |
|
| 134 | 135 |
if string(reqBody) == "Username or email already exist" {
|
| 135 | 136 |
client := &http.Client{}
|
| 136 | 137 |
req, err := http.NewRequest("GET", REGISTRY_SERVER+"/v1/users", nil)
|
| ... | ... |
@@ -65,7 +65,7 @@ func (srv *Server) CmdLogin(stdin io.ReadCloser, stdout io.Writer, args ...strin |
| 65 | 65 |
// Read a line on raw terminal with support for simple backspace |
| 66 | 66 |
// sequences and echo. |
| 67 | 67 |
// |
| 68 |
- // This function is necessary because the login command must be done a |
|
| 68 |
+ // This function is necessary because the login command must be done in a |
|
| 69 | 69 |
// raw terminal for two reasons: |
| 70 | 70 |
// - we have to read a password (without echoing it); |
| 71 | 71 |
// - the rcli "protocol" only supports cannonical and raw modes and you |
| ... | ... |
@@ -10,13 +10,13 @@ import ( |
| 10 | 10 |
"time" |
| 11 | 11 |
) |
| 12 | 12 |
|
| 13 |
-// A Graph is a store for versioned filesystem images, and the relationship between them. |
|
| 13 |
+// A Graph is a store for versioned filesystem images and the relationship between them. |
|
| 14 | 14 |
type Graph struct {
|
| 15 | 15 |
Root string |
| 16 | 16 |
idIndex *TruncIndex |
| 17 | 17 |
} |
| 18 | 18 |
|
| 19 |
-// NewGraph instanciates a new graph at the given root path in the filesystem. |
|
| 19 |
+// NewGraph instantiates a new graph at the given root path in the filesystem. |
|
| 20 | 20 |
// `root` will be created if it doesn't exist. |
| 21 | 21 |
func NewGraph(root string) (*Graph, error) {
|
| 22 | 22 |
abspath, err := filepath.Abs(root) |
| ... | ... |
@@ -140,14 +140,14 @@ func (graph *Graph) Mktemp(id string) (string, error) {
|
| 140 | 140 |
} |
| 141 | 141 |
|
| 142 | 142 |
// Garbage returns the "garbage", a staging area for deleted images. |
| 143 |
-// This allows images ot be deleted atomically by os.Rename(), instead of |
|
| 144 |
-// os.RemoveAll() which is prone to race conditions |
|
| 143 |
+// This allows images to be deleted atomically by os.Rename(), instead of |
|
| 144 |
+// os.RemoveAll() which is prone to race conditions. |
|
| 145 | 145 |
func (graph *Graph) Garbage() (*Graph, error) {
|
| 146 | 146 |
return NewGraph(path.Join(graph.Root, ":garbage:")) |
| 147 | 147 |
} |
| 148 | 148 |
|
| 149 |
-// Check if given error is "not empty" |
|
| 150 |
-// Note: this is the way golang do it internally with os.IsNotExists |
|
| 149 |
+// Check if given error is "not empty". |
|
| 150 |
+// Note: this is the way golang does it internally with os.IsNotExists. |
|
| 151 | 151 |
func isNotEmpty(err error) bool {
|
| 152 | 152 |
switch pe := err.(type) {
|
| 153 | 153 |
case nil: |
| ... | ... |
@@ -190,7 +190,7 @@ func (graph *Graph) Delete(id string) error {
|
| 190 | 190 |
return nil |
| 191 | 191 |
} |
| 192 | 192 |
|
| 193 |
-// Undelete moves an image back from the garbage to the main graph |
|
| 193 |
+// Undelete moves an image back from the garbage to the main graph. |
|
| 194 | 194 |
func (graph *Graph) Undelete(id string) error {
|
| 195 | 195 |
garbage, err := graph.Garbage() |
| 196 | 196 |
if err != nil {
|
| ... | ... |
@@ -203,7 +203,7 @@ func (graph *Graph) Undelete(id string) error {
|
| 203 | 203 |
return nil |
| 204 | 204 |
} |
| 205 | 205 |
|
| 206 |
-// GarbageCollect definitely deletes all images moved to the garbage |
|
| 206 |
+// GarbageCollect definitely deletes all images moved to the garbage. |
|
| 207 | 207 |
func (graph *Graph) GarbageCollect() error {
|
| 208 | 208 |
garbage, err := graph.Garbage() |
| 209 | 209 |
if err != nil {
|
| ... | ... |
@@ -212,7 +212,7 @@ func (graph *Graph) GarbageCollect() error {
|
| 212 | 212 |
return os.RemoveAll(garbage.Root) |
| 213 | 213 |
} |
| 214 | 214 |
|
| 215 |
-// Map returns a list of all images in the graph, addressable by ID |
|
| 215 |
+// Map returns a list of all images in the graph, addressable by ID. |
|
| 216 | 216 |
func (graph *Graph) Map() (map[string]*Image, error) {
|
| 217 | 217 |
// FIXME: this should replace All() |
| 218 | 218 |
all, err := graph.All() |
| ... | ... |
@@ -226,7 +226,7 @@ func (graph *Graph) Map() (map[string]*Image, error) {
|
| 226 | 226 |
return images, nil |
| 227 | 227 |
} |
| 228 | 228 |
|
| 229 |
-// All returns a list of all images in the graph |
|
| 229 |
+// All returns a list of all images in the graph. |
|
| 230 | 230 |
func (graph *Graph) All() ([]*Image, error) {
|
| 231 | 231 |
var images []*Image |
| 232 | 232 |
err := graph.WalkAll(func(image *Image) {
|
| ... | ... |
@@ -21,7 +21,7 @@ func NewImgJson(src []byte) (*Image, error) {
|
| 21 | 21 |
ret := &Image{}
|
| 22 | 22 |
|
| 23 | 23 |
Debugf("Json string: {%s}\n", src)
|
| 24 |
- // FIXME: Is there a cleaner way to "puryfy" the input json? |
|
| 24 |
+ // FIXME: Is there a cleaner way to "purify" the input json? |
|
| 25 | 25 |
if err := json.Unmarshal(src, ret); err != nil {
|
| 26 | 26 |
return nil, err |
| 27 | 27 |
} |