Documentation ¶
Overview ¶
Package cmd contains all the global variables and constants. ONLY TO BE ACCESSED VIA GET/SET FUNCTIONS.
Package cmd - session V8 - Version 8 stores session header and session data in two separate files. Session data contains fully prepared URL list.
Index ¶
- Constants
- Variables
- func DownloadReleaseData(timeout time.Duration) (data string, err *probe.Error)
- func GetCurrentReleaseTime() (releaseTime time.Time, err *probe.Error)
- func IsDCOS() bool
- func IsDeleteEvent(event notify.Event) bool
- func IsDocker() bool
- func IsGetEvent(event notify.Event) bool
- func IsKubernetes() bool
- func IsPutEvent(event notify.Event) bool
- func IsSourceBuild() bool
- func Main()
- func PipeChan(capacity int) (inputCh chan notify.EventInfo, outputCh chan notify.EventInfo)
- func UTCNow() time.Time
- type APINotImplemented
- type BrokenSymlink
- type BucketDoesNotExist
- type BucketExists
- type BucketInvalid
- type BucketNameEmpty
- type BucketNameTopLevel
- type CheckResult
- type Client
- type Config
- type DirOpt
- type DummyStatus
- func (ds *DummyStatus) Add(v int64) Status
- func (ds *DummyStatus) Finish()
- func (ds *DummyStatus) Get() int64
- func (ds *DummyStatus) PrintMsg(msg message)
- func (ds *DummyStatus) Println(data ...interface{})
- func (ds *DummyStatus) Read(p []byte) (n int, err error)
- func (ds *DummyStatus) SetCaption(s string)
- func (ds *DummyStatus) SetTotal(v int64) Status
- func (ds *DummyStatus) Start()
- func (ds *DummyStatus) Total() int64
- func (ds *DummyStatus) Update()
- type EmptyPath
- type EventInfo
- type EventType
- type Field
- type GenericBucketError
- type GenericFileError
- type ObjectAlreadyExists
- type ObjectAlreadyExistsAsDirectory
- type ObjectMissing
- type ObjectOnGlacier
- type ParallelManager
- type PathInsufficientPermission
- type PathIsNotRegular
- type PathNotFound
- type PrettyTable
- type Progress
- type ProgressReader
- type ProgressStatus
- func (ps *ProgressStatus) Add(v int64) Status
- func (ps *ProgressStatus) Finish()
- func (ps *ProgressStatus) PrintMsg(msg message)
- func (ps *ProgressStatus) Println(data ...interface{})
- func (ps *ProgressStatus) Read(p []byte) (n int, err error)
- func (p ProgressStatus) Set64(length int64) *progressBar
- func (ps *ProgressStatus) SetCaption(s string)
- func (ps *ProgressStatus) SetTotal(v int64) Status
- func (ps *ProgressStatus) Start()
- func (ps *ProgressStatus) Total() int64
- func (ps *ProgressStatus) Update()
- type QuietStatus
- func (qs *QuietStatus) Add(v int64) Status
- func (qs *QuietStatus) Finish()
- func (a QuietStatus) Get() int64
- func (qs *QuietStatus) PrintMsg(msg message)
- func (qs *QuietStatus) Println(data ...interface{})
- func (qs *QuietStatus) Read(p []byte) (n int, err error)
- func (a QuietStatus) Set(n int64) *accounter
- func (qs *QuietStatus) SetCaption(s string)
- func (qs *QuietStatus) SetTotal(v int64) Status
- func (qs *QuietStatus) Start()
- func (a QuietStatus) Stat() accountStat
- func (qs *QuietStatus) Total() int64
- func (qs *QuietStatus) Update()
- type SameFile
- type ServerInfo
- type Status
- type TooManyLevelsSymlink
- type URLs
- type UnexpectedEOF
- type UnexpectedExcessRead
- type UnexpectedShortWrite
- type Watcher
Constants ¶
const ( // EventCreate notifies when a new object is created EventCreate EventType = "ObjectCreated" // EventRemove notifies when a new object is deleted EventRemove = "ObjectRemoved" // EventAccessed notifies when an object is accessed. EventAccessed = "ObjectAccessed" // EventAccessedRead notifies when an object is accessed (specifically read). EventAccessedRead = "ObjectAccessed:Read" // EventAccessedStat notifies when an object is accessed (specifically stat). EventAccessedStat = "ObjectAccessed:Stat" )
const Day = 24 * time.Hour
Day time.Duration for day.
Variables ¶
var ( // Version - version time.RFC3339. Version = "DEVELOPMENT.GOGET" // ReleaseTag - release tag in TAG.%Y-%m-%dT%H-%M-%SZ. ReleaseTag = "DEVELOPMENT.GOGET" // CommitID - latest commit id. CommitID = "DEVELOPMENT.GOGET" // ShortCommitID - first 12 characters from CommitID. ShortCommitID = CommitID[:12] )
var ( // EventTypePut contains the notify events that will cause a put (write) EventTypePut = []notify.Event{notify.InCloseWrite | notify.InMovedTo} // EventTypeDelete contains the notify events that will cause a delete (remove) EventTypeDelete = []notify.Event{notify.InDelete | notify.InDeleteSelf | notify.InMovedFrom} // EventTypeGet contains the notify events that will cause a get (read) EventTypeGet = []notify.Event{notify.InAccess | notify.InOpen} )
Functions ¶
func DownloadReleaseData ¶
DownloadReleaseData - downloads release data from mc official server.
func GetCurrentReleaseTime ¶
GetCurrentReleaseTime - returns this process's release time. If it is official mc version, parsed version is returned else mc binary's mod time is returned.
func IsDeleteEvent ¶
IsDeleteEvent checks if the event returned is a delete event
func IsDocker ¶
func IsDocker() bool
IsDocker - returns if the environment mc is running in docker or not. The check is a simple file existence check.
https://github.com/moby/moby/blob/master/daemon/initlayer/setup_unix.go#L25
"/.dockerenv": "file",
func IsGetEvent ¶
IsGetEvent checks if the event return is a get event.
func IsKubernetes ¶
func IsKubernetes() bool
IsKubernetes returns true if minio is running in kubernetes.
func IsPutEvent ¶
IsPutEvent checks if the event returned is a put event
func IsSourceBuild ¶
func IsSourceBuild() bool
IsSourceBuild - returns if this binary is a non-official build from source code.
Types ¶
type APINotImplemented ¶
APINotImplemented - api not implemented
func (APINotImplemented) Error ¶
func (e APINotImplemented) Error() string
type BrokenSymlink ¶
type BrokenSymlink GenericFileError
BrokenSymlink (ENOTENT) - file has broken symlink.
func (BrokenSymlink) Error ¶
func (e BrokenSymlink) Error() string
type BucketDoesNotExist ¶
type BucketDoesNotExist GenericBucketError
BucketDoesNotExist - bucket does not exist.
func (BucketDoesNotExist) Error ¶
func (e BucketDoesNotExist) Error() string
type BucketExists ¶
type BucketExists GenericBucketError
BucketExists - bucket exists.
func (BucketExists) Error ¶
func (e BucketExists) Error() string
type BucketInvalid ¶
type BucketInvalid struct {
Bucket string
}
BucketInvalid - bucket name invalid.
func (BucketInvalid) Error ¶
func (e BucketInvalid) Error() string
type BucketNameEmpty ¶
type BucketNameEmpty struct{}
BucketNameEmpty - bucket name empty (http://goo.gl/wJlzDz)
func (BucketNameEmpty) Error ¶
func (e BucketNameEmpty) Error() string
type BucketNameTopLevel ¶
type BucketNameTopLevel struct{}
BucketNameTopLevel - generic error
func (BucketNameTopLevel) Error ¶
func (e BucketNameTopLevel) Error() string
type CheckResult ¶
type Client ¶
type Client interface { // Common operations Stat(isIncomplete, isFetchMeta bool, sseKey string) (content *clientContent, err *probe.Error) List(isRecursive, isIncomplete bool, showDir DirOpt) <-chan *clientContent // Bucket operations MakeBucket(region string, ignoreExisting bool) *probe.Error // Access policy operations. GetAccess() (access string, error *probe.Error) GetAccessRules() (policyRules map[string]string, error *probe.Error) SetAccess(access string) *probe.Error // I/O operations Copy(source string, size int64, progress io.Reader, srcSSEKey, tgtSSEKey string) *probe.Error // Runs select expression on object storage on specific files. Select(expression string, sseKey string) (io.ReadCloser, *probe.Error) // I/O operations with metadata. Get(sseKey string) (reader io.ReadCloser, err *probe.Error) Put(ctx context.Context, reader io.Reader, size int64, metadata map[string]string, progress io.Reader, sseKey string) (n int64, err *probe.Error) // I/O operations with expiration // Watch events Watch(params watchParams) (*watchObject, *probe.Error) // Delete operations Remove(isIncomplete bool, contentCh <-chan *clientContent) (errorCh <-chan *probe.Error) // GetURL returns back internal url GetURL() clientURL GetObjetPartsInfo() (partsInfo map[int]minio.ObjectPart, err error) ReadAt(b []byte, offset int64) (err error) }
Client - client interface
type Config ¶
type Config struct { AccessKey string SecretKey string Signature string HostURL string AppName string AppVersion string AppComments []string Debug bool Insecure bool Lookup minio.BucketLookupType }
Config - see http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html
type DummyStatus ¶
type DummyStatus struct {
// contains filtered or unexported fields
}
DummyStatus will not show anything.
func (*DummyStatus) Add ¶
func (ds *DummyStatus) Add(v int64) Status
Add bytes to current number of bytes
func (*DummyStatus) Println ¶
func (ds *DummyStatus) Println(data ...interface{})
Println prints line, ignored for quietstatus
func (*DummyStatus) Read ¶
func (ds *DummyStatus) Read(p []byte) (n int, err error)
Read implements the io.Reader interface
func (*DummyStatus) SetCaption ¶
func (ds *DummyStatus) SetCaption(s string)
SetCaption sets the caption of the progressbar, ignored for quietstatus
func (*DummyStatus) SetTotal ¶
func (ds *DummyStatus) SetTotal(v int64) Status
SetTotal sets the total of the progressbar, ignored for quietstatus
func (*DummyStatus) Total ¶
func (ds *DummyStatus) Total() int64
Total returns the total number of bytes
type EventInfo ¶
type EventInfo struct { Time string Size int64 Path string Type EventType Host string Port string UserAgent string }
EventInfo contains the information of the event that occurred and the source IP:PORT of the client which triggerred the event.
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field configuration: color theme and max content length
type GenericBucketError ¶
type GenericBucketError struct {
Bucket string
}
GenericBucketError - generic bucket operations error
type GenericFileError ¶
type GenericFileError struct {
Path string
}
GenericFileError - generic file error.
type ObjectAlreadyExists ¶
type ObjectAlreadyExists struct {
Object string
}
ObjectAlreadyExists - typed return for MethodNotAllowed
func (ObjectAlreadyExists) Error ¶
func (e ObjectAlreadyExists) Error() string
type ObjectAlreadyExistsAsDirectory ¶
type ObjectAlreadyExistsAsDirectory struct {
Object string
}
ObjectAlreadyExistsAsDirectory - typed return for XMinioObjectExistsAsDirectory
func (ObjectAlreadyExistsAsDirectory) Error ¶
func (e ObjectAlreadyExistsAsDirectory) Error() string
type ObjectMissing ¶
type ObjectMissing struct{}
ObjectMissing (EINVAL) - object key missing.
func (ObjectMissing) Error ¶
func (e ObjectMissing) Error() string
type ObjectOnGlacier ¶
type ObjectOnGlacier struct {
Object string
}
ObjectOnGlacier - object is of storage class glacier.
func (ObjectOnGlacier) Error ¶
func (e ObjectOnGlacier) Error() string
type ParallelManager ¶
type ParallelManager struct {
// contains filtered or unexported fields
}
ParallelManager - helps manage parallel workers to run tasks
type PathInsufficientPermission ¶
type PathInsufficientPermission GenericFileError
PathInsufficientPermission (EPERM) - permission denied.
func (PathInsufficientPermission) Error ¶
func (e PathInsufficientPermission) Error() string
type PathIsNotRegular ¶
type PathIsNotRegular GenericFileError
PathIsNotRegular (ENOTREG) - file is not a regular file.
func (PathIsNotRegular) Error ¶
func (e PathIsNotRegular) Error() string
type PathNotFound ¶
type PathNotFound GenericFileError
PathNotFound (ENOENT) - file not found.
func (PathNotFound) Error ¶
func (e PathNotFound) Error() string
type PrettyTable ¶
type PrettyTable struct {
// contains filtered or unexported fields
}
PrettyTable - an easy struct to format a set of line
type Progress ¶
type Progress interface {
Get() int64
}
Progress - an interface which describes current amount of data written.
type ProgressReader ¶
ProgressReader can be used to update the progress of an on-going transfer progress.
type ProgressStatus ¶
type ProgressStatus struct {
// contains filtered or unexported fields
}
ProgressStatus shows a progressbar
func (*ProgressStatus) Add ¶
func (ps *ProgressStatus) Add(v int64) Status
Add bytes to current number of bytes
func (*ProgressStatus) Finish ¶
func (ps *ProgressStatus) Finish()
Finish displays the accounting summary
func (*ProgressStatus) PrintMsg ¶
func (ps *ProgressStatus) PrintMsg(msg message)
PrintMsg prints message
func (*ProgressStatus) Println ¶
func (ps *ProgressStatus) Println(data ...interface{})
Println prints line, ignored for quietstatus
func (*ProgressStatus) Read ¶
func (ps *ProgressStatus) Read(p []byte) (n int, err error)
Read implements the io.Reader interface
func (*ProgressStatus) SetCaption ¶
func (ps *ProgressStatus) SetCaption(s string)
SetCaption sets the caption of the progressbar
func (*ProgressStatus) SetTotal ¶
func (ps *ProgressStatus) SetTotal(v int64) Status
SetTotal sets the total of the progressbar
func (*ProgressStatus) Total ¶
func (ps *ProgressStatus) Total() int64
Total returns the total number of bytes
func (*ProgressStatus) Update ¶
func (ps *ProgressStatus) Update()
Update is ignored for quietstatus
type QuietStatus ¶
type QuietStatus struct {
// contains filtered or unexported fields
}
QuietStatus will only show the progress and summary
func (*QuietStatus) Add ¶
func (qs *QuietStatus) Add(v int64) Status
Add bytes to current number of bytes
func (*QuietStatus) Println ¶
func (qs *QuietStatus) Println(data ...interface{})
Println prints line, ignored for quietstatus
func (*QuietStatus) Read ¶
func (qs *QuietStatus) Read(p []byte) (n int, err error)
Read implements the io.Reader interface
func (QuietStatus) Set ¶
func (a QuietStatus) Set(n int64) *accounter
Set sets the current value atomically.
func (*QuietStatus) SetCaption ¶
func (qs *QuietStatus) SetCaption(s string)
SetCaption sets the caption of the progressbar, ignored for quietstatus
func (*QuietStatus) SetTotal ¶
func (qs *QuietStatus) SetTotal(v int64) Status
SetTotal sets the total of the progressbar, ignored for quietstatus
func (QuietStatus) Stat ¶
func (a QuietStatus) Stat() accountStat
Stat provides current stats captured.
func (*QuietStatus) Total ¶
func (qs *QuietStatus) Total() int64
Total returns the total number of bytes
type SameFile ¶
type SameFile struct {
Source, Destination string
}
SameFile - source and destination are same files.
type ServerInfo ¶
type ServerInfo struct { StorageInfo backendStatus `json:"storage"` ConnStats madmin.ServerConnStats `json:"network"` Properties madmin.ServerProperties `json:"server"` }
ServerInfo holds the whole server information that will be returned by ServerInfo API.
type Status ¶
type Status interface { Println(data ...interface{}) Add(int64) Status Get() int64 Start() Finish() PrintMsg(msg message) Update() Total() int64 SetTotal(int64) Status SetCaption(string) Read(p []byte) (n int, err error) // contains filtered or unexported methods }
Status implements a interface that can be used in quit mode or with progressbar.
func NewDummyStatus ¶
NewDummyStatus returns a dummy status object
func NewProgressStatus ¶
NewProgressStatus returns a progress status object
func NewQuietStatus ¶
NewQuietStatus returns a quiet status object
type TooManyLevelsSymlink ¶
type TooManyLevelsSymlink GenericFileError
TooManyLevelsSymlink (ELOOP) - file has too many levels of symlinks.
func (TooManyLevelsSymlink) Error ¶
func (e TooManyLevelsSymlink) Error() string
type URLs ¶
type URLs struct { SourceAlias string SourceContent *clientContent TargetAlias string TargetContent *clientContent TotalCount int64 TotalSize int64 SrcSSEKey string TgtSSEKey string Error *probe.Error `json:"-"` // contains filtered or unexported fields }
URLs contains source and target urls
type UnexpectedEOF ¶
UnexpectedEOF (EPIPE) - reader closed prematurely.
func (UnexpectedEOF) Error ¶
func (e UnexpectedEOF) Error() string
type UnexpectedExcessRead ¶
type UnexpectedExcessRead UnexpectedEOF
UnexpectedExcessRead - reader wrote more data than requested.
func (UnexpectedExcessRead) Error ¶
func (e UnexpectedExcessRead) Error() string
type UnexpectedShortWrite ¶
UnexpectedShortWrite - write wrote less bytes than expected.
func (UnexpectedShortWrite) Error ¶
func (e UnexpectedShortWrite) Error() string
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher can be used to have one or multiple clients watch for notifications
func NewWatcher ¶
NewWatcher creates a new watcher
Source Files ¶
- access-perms.go
- accounting-reader.go
- admin-config-get.go
- admin-config-set.go
- admin-config.go
- admin-credential.go
- admin-heal-result-item.go
- admin-heal-ui.go
- admin-heal.go
- admin-info.go
- admin-main.go
- admin-policy-add.go
- admin-policy-list.go
- admin-policy-remove.go
- admin-policy.go
- admin-profile-start.go
- admin-profile-stop.go
- admin-profile.go
- admin-service-restart.go
- admin-service-status.go
- admin-service-stop.go
- admin-service.go
- admin-user-add-policy.go
- admin-user-add.go
- admin-user-disable.go
- admin-user-enable.go
- admin-user-list.go
- admin-user-remove.go
- admin-user.go
- build-constants.go
- cat-main.go
- certs.go
- check-main.go
- check.go
- client-admin.go
- client-errors.go
- client-fs.go
- client-fs_linux.go
- client-s3-trace_v2.go
- client-s3-trace_v4.go
- client-s3.go
- client-url.go
- client.go
- common-methods.go
- config-fix.go
- config-host-add.go
- config-host-list.go
- config-host-remove.go
- config-host.go
- config-main.go
- config-migrate.go
- config-old.go
- config-utils.go
- config-v9.go
- config-validate.go
- config.go
- cp-main.go
- cp-url-syntax.go
- cp-url.go
- diff-main.go
- difference.go
- error.go
- event-add.go
- event-list.go
- event-main.go
- event-remove.go
- find-main.go
- find.go
- flags.go
- fs-pathutils_nix.go
- globals.go
- humanized-duration.go
- ls-main.go
- ls.go
- main.go
- mb-main.go
- mirror-main.go
- mirror-url.go
- parallel-manager.go
- pipe-main.go
- pipechan.go
- policy-main.go
- pretty-table.go
- print.go
- progress-bar.go
- rm-main.go
- runtime-checks.go
- scan-bar.go
- session-clear.go
- session-list.go
- session-main.go
- session-migrate.go
- session-old.go
- session-resume.go
- session-v8.go
- session.go
- share-db-v1.go
- share-download-main.go
- share-list-main.go
- share-main.go
- share-upload-main.go
- share.go
- signals.go
- sql-main.go
- stat-main.go
- stat.go
- status.go
- table-ui.go
- typed-errors.go
- update-main.go
- update-notifier.go
- urls.go
- utils.go
- version-main.go
- watch-main.go
- watch.go