1
0
mirror of https://github.com/minio/mc.git synced 2025-11-13 12:22:45 +03:00

Simplify target2Client and sourc2Client usage - use url2Stat()

This commit is contained in:
Harshavardhana
2015-06-23 16:48:45 -07:00
parent 6736b26906
commit 01b10bd4b1
5 changed files with 39 additions and 83 deletions

View File

@@ -24,12 +24,13 @@ import (
"github.com/minio/minio/pkg/iodine"
)
// ErrorMessage container for message reason encapsulation
// ErrorMessage container for error reason encapsulation
type ErrorMessage struct {
Message string `json:"message"`
Error error `json:"error"`
}
// String string printer for error message
func (e ErrorMessage) String() string {
var message string
if e.Error != nil {
@@ -53,6 +54,7 @@ type Content struct {
Name string `json:"name"`
}
// String string printer for Content metadata
func (c Content) String() string {
message := console.Time("[%s] ", c.Time)
message = message + console.Size("%6s ", c.Size)
@@ -70,6 +72,7 @@ type InfoMessage struct {
Message string `json:"message"`
}
// String string printer for informational message
func (i InfoMessage) String() string {
return i.Message
}
@@ -81,6 +84,7 @@ type CopyMessage struct {
Target string `json:"target"`
}
// String string printer for copy message
func (c CopyMessage) String() string {
return fmt.Sprintf("%s -> %s", c.Source, c.Target)
}
@@ -88,6 +92,7 @@ func (c CopyMessage) String() string {
// SyncMessage container for file sync messages, inherits CopyMessage
type SyncMessage CopyMessage
// String string printer for sync message
func (s SyncMessage) String() string {
return fmt.Sprintf("%s -> %s", s.Source, s.Target)
}