mirror of https://github.com/docker/docs.git
A few spelling/grammar corrections.
This commit is contained in:
parent
c298a91f95
commit
13d2b08638
|
@ -131,6 +131,7 @@ func Login(authConfig *AuthConfig) (string, error) {
|
||||||
status = "Account Created\n"
|
status = "Account Created\n"
|
||||||
storeConfig = true
|
storeConfig = true
|
||||||
} else if reqStatusCode == 400 {
|
} else if reqStatusCode == 400 {
|
||||||
|
// FIXME: This should be 'exists', not 'exist'. Need to change on the server first.
|
||||||
if string(reqBody) == "Username or email already exist" {
|
if string(reqBody) == "Username or email already exist" {
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
req, err := http.NewRequest("GET", REGISTRY_SERVER+"/v1/users", nil)
|
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
|
||||||
// Read a line on raw terminal with support for simple backspace
|
// Read a line on raw terminal with support for simple backspace
|
||||||
// sequences and echo.
|
// sequences and echo.
|
||||||
//
|
//
|
||||||
// This function is necessary because the login command must be done a
|
// This function is necessary because the login command must be done in a
|
||||||
// raw terminal for two reasons:
|
// raw terminal for two reasons:
|
||||||
// - we have to read a password (without echoing it);
|
// - we have to read a password (without echoing it);
|
||||||
// - the rcli "protocol" only supports cannonical and raw modes and you
|
// - the rcli "protocol" only supports cannonical and raw modes and you
|
||||||
|
|
20
graph.go
20
graph.go
|
@ -10,13 +10,13 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A Graph is a store for versioned filesystem images, and the relationship between them.
|
// A Graph is a store for versioned filesystem images and the relationship between them.
|
||||||
type Graph struct {
|
type Graph struct {
|
||||||
Root string
|
Root string
|
||||||
idIndex *TruncIndex
|
idIndex *TruncIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGraph instanciates a new graph at the given root path in the filesystem.
|
// NewGraph instantiates a new graph at the given root path in the filesystem.
|
||||||
// `root` will be created if it doesn't exist.
|
// `root` will be created if it doesn't exist.
|
||||||
func NewGraph(root string) (*Graph, error) {
|
func NewGraph(root string) (*Graph, error) {
|
||||||
abspath, err := filepath.Abs(root)
|
abspath, err := filepath.Abs(root)
|
||||||
|
@ -140,14 +140,14 @@ func (graph *Graph) Mktemp(id string) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Garbage returns the "garbage", a staging area for deleted images.
|
// Garbage returns the "garbage", a staging area for deleted images.
|
||||||
// This allows images ot be deleted atomically by os.Rename(), instead of
|
// This allows images to be deleted atomically by os.Rename(), instead of
|
||||||
// os.RemoveAll() which is prone to race conditions
|
// os.RemoveAll() which is prone to race conditions.
|
||||||
func (graph *Graph) Garbage() (*Graph, error) {
|
func (graph *Graph) Garbage() (*Graph, error) {
|
||||||
return NewGraph(path.Join(graph.Root, ":garbage:"))
|
return NewGraph(path.Join(graph.Root, ":garbage:"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if given error is "not empty"
|
// Check if given error is "not empty".
|
||||||
// Note: this is the way golang do it internally with os.IsNotExists
|
// Note: this is the way golang does it internally with os.IsNotExists.
|
||||||
func isNotEmpty(err error) bool {
|
func isNotEmpty(err error) bool {
|
||||||
switch pe := err.(type) {
|
switch pe := err.(type) {
|
||||||
case nil:
|
case nil:
|
||||||
|
@ -190,7 +190,7 @@ func (graph *Graph) Delete(id string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Undelete moves an image back from the garbage to the main graph
|
// Undelete moves an image back from the garbage to the main graph.
|
||||||
func (graph *Graph) Undelete(id string) error {
|
func (graph *Graph) Undelete(id string) error {
|
||||||
garbage, err := graph.Garbage()
|
garbage, err := graph.Garbage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -203,7 +203,7 @@ func (graph *Graph) Undelete(id string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GarbageCollect definitely deletes all images moved to the garbage
|
// GarbageCollect definitely deletes all images moved to the garbage.
|
||||||
func (graph *Graph) GarbageCollect() error {
|
func (graph *Graph) GarbageCollect() error {
|
||||||
garbage, err := graph.Garbage()
|
garbage, err := graph.Garbage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -212,7 +212,7 @@ func (graph *Graph) GarbageCollect() error {
|
||||||
return os.RemoveAll(garbage.Root)
|
return os.RemoveAll(garbage.Root)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map returns a list of all images in the graph, addressable by ID
|
// Map returns a list of all images in the graph, addressable by ID.
|
||||||
func (graph *Graph) Map() (map[string]*Image, error) {
|
func (graph *Graph) Map() (map[string]*Image, error) {
|
||||||
// FIXME: this should replace All()
|
// FIXME: this should replace All()
|
||||||
all, err := graph.All()
|
all, err := graph.All()
|
||||||
|
@ -226,7 +226,7 @@ func (graph *Graph) Map() (map[string]*Image, error) {
|
||||||
return images, nil
|
return images, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// All returns a list of all images in the graph
|
// All returns a list of all images in the graph.
|
||||||
func (graph *Graph) All() ([]*Image, error) {
|
func (graph *Graph) All() ([]*Image, error) {
|
||||||
var images []*Image
|
var images []*Image
|
||||||
err := graph.WalkAll(func(image *Image) {
|
err := graph.WalkAll(func(image *Image) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ func NewImgJson(src []byte) (*Image, error) {
|
||||||
ret := &Image{}
|
ret := &Image{}
|
||||||
|
|
||||||
Debugf("Json string: {%s}\n", src)
|
Debugf("Json string: {%s}\n", src)
|
||||||
// FIXME: Is there a cleaner way to "puryfy" the input json?
|
// FIXME: Is there a cleaner way to "purify" the input json?
|
||||||
if err := json.Unmarshal(src, ret); err != nil {
|
if err := json.Unmarshal(src, ret); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue