cmd

package
v0.0.0-...-ecc7113 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2017 License: Apache-2.0 Imports: 102 Imported by: 0

Documentation

Overview

Package cmd This file implements AWS Access Policy Language parser in accordance with http://docs.aws.amazon.com/AmazonS3/latest/dev/access-policy-language-overview.html

Package cmd This file implements helper functions to validate AWS Signature Version '4' authorization header.

This package provides comprehensive helpers for following signature types. - Based on Authorization header. - Based on Query parameters. - Based on Form POST policy.

Package cmd This file implements helper functions to validate Streaming AWS Signature Version '4' authorization header.

Index

Constants

View Source
const MaxJitter = 1.0

MaxJitter will randomize over the full exponential backoff time

View Source
const NoJitter = 0.0

NoJitter disables the use of jitter for randomizing the exponential backoff time

Variables

View Source
var (
	// GOPATH - GOPATH value at the time of build.
	GOPATH = ""

	// Version - version time.RFC3339.
	Version = goGetTag
	// ReleaseTag - release tag in TAG.%Y-%m-%dT%H-%M-%SZ.
	ReleaseTag = goGetTag
	// CommitID - latest commit id.
	CommitID = goGetTag
	// ShortCommitID - first 12 characters from CommitID.
	ShortCommitID = CommitID[:12]
)

DO NOT EDIT THIS FILE DIRECTLY. These are build-time constants set through ‘buildscripts/gen-ldflags.go’.

Functions

func AddBucketListenerConfig

func AddBucketListenerConfig(bucket string, lcfg *listenerConfig, objAPI ObjectLayer) error

AddBucketListenerConfig - Updates on disk state of listeners, and updates all peers with the change in listener config.

func CheckLocalServerAddr

func CheckLocalServerAddr(serverAddr string) error

CheckLocalServerAddr - checks if serverAddr is valid and local host.

func CreateEndpoints

func CreateEndpoints(serverAddr string, args ...string) (string, EndpointList, SetupType, error)

CreateEndpoints - validates and creates new endpoints for given args.

func DownloadReleaseData

func DownloadReleaseData(timeout time.Duration, mode string) (data string, err error)

DownloadReleaseData - downloads release data from minio official server.

func Fallocate

func Fallocate(fd int, offset int64, len int64) error

Fallocate uses the linux Fallocate syscall, which helps us to be sure that subsequent writes on a file just created will not fail, in addition, file allocation will be contigous on the disk

func GetCurrentReleaseTime

func GetCurrentReleaseTime() (releaseTime time.Time, err error)

GetCurrentReleaseTime - returns this process's release time. If it is official minio version, parsed version is returned else minio binary's mod time is returned.

func GetMaxCacheSize

func GetMaxCacheSize() (cacheSize uint64, err error)

GetMaxCacheSize returns maximum cache size based on current RAM size and memory limit.

func GetRemotePeers

func GetRemotePeers(endpoints EndpointList) []string

GetRemotePeers - get hosts information other than this minio service.

func InitConsoleLogger

func InitConsoleLogger(logger *ConsoleLogger)

InitConsoleLogger - initializes console logger.

func InitFileLogger

func InitFileLogger(logger *FileLogger) (err error)

InitFileLogger - initializes file logger.

func IsDCOS

func IsDCOS() bool

IsDCOS returns true if minio is running in DCOS.

func IsDocker

func IsDocker() bool

IsDocker - returns if the environment minio is running is docker or not.

func IsKubernetes

func IsKubernetes() bool

IsKubernetes returns true if minio is running in kubernetes.

func IsSourceBuild

func IsSourceBuild() bool

IsSourceBuild - returns if this binary is made from source or not.

func IsValidBucketName

func IsValidBucketName(bucket string) bool

IsValidBucketName verifies that a bucket name is in accordance with Amazon's requirements (i.e. DNS naming conventions). It must be 3-63 characters long, and it must be a sequence of one or more labels separated by periods. Each label can contain lowercase ascii letters, decimal digits and hyphens, but must not begin or end with a hyphen. See: http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html

func IsValidObjectName

func IsValidObjectName(object string) bool

IsValidObjectName verifies an object name in accordance with Amazon's requirements. It cannot exceed 1024 characters and must be a valid UTF8 string.

See: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html

You should avoid the following characters in a key name because of significant special handling for consistency across all applications.

Rejects strings with following characters.

- Backslash ("\")

additionally minio does not support object names with trailing "/".

func IsValidObjectPrefix

func IsValidObjectPrefix(object string) bool

IsValidObjectPrefix verifies whether the prefix is a valid object name. Its valid to have a empty prefix.

func Main

func Main(args []string)

Main main for minio server.

func PutBucketNotificationConfig

func PutBucketNotificationConfig(bucket string, ncfg *notificationConfig, objAPI ObjectLayer) error

PutBucketNotificationConfig - Put a new notification config for a bucket (overwrites any previous config) persistently, updates global in-memory state, and notify other nodes in the cluster (if any)

func RemoveBucketListenerConfig

func RemoveBucketListenerConfig(bucket string, lcfg *listenerConfig, objAPI ObjectLayer)

RemoveBucketListenerConfig - removes a given bucket notification config

func S3PeersUpdateBucketListener

func S3PeersUpdateBucketListener(bucket string, lcfg []listenerConfig)

S3PeersUpdateBucketListener - Sends Update Bucket listeners request to all peers. Currently we log an error and continue.

func S3PeersUpdateBucketNotification

func S3PeersUpdateBucketNotification(bucket string, ncfg *notificationConfig)

S3PeersUpdateBucketNotification - Sends Update Bucket notification request to all peers. Currently we log an error and continue.

func S3PeersUpdateBucketPolicy

func S3PeersUpdateBucketPolicy(bucket string, pCh policyChange)

S3PeersUpdateBucketPolicy - Sends update bucket policy request to all peers. Currently we log an error and continue.

func UNCPath

func UNCPath(path string) string

UNCPath converts a absolute windows path to a UNC long path.

func UTCNow

func UTCNow() time.Time

UTCNow - returns current UTC time.

Types

type APIError

type APIError struct {
	Code           string
	Description    string
	HTTPStatusCode int
}

APIError structure

type APIErrorCode

type APIErrorCode int

APIErrorCode type of error status.

const (
	ErrNone APIErrorCode = iota
	ErrAccessDenied
	ErrBadDigest
	ErrEntityTooSmall
	ErrEntityTooLarge
	ErrIncompleteBody
	ErrInternalError
	ErrInvalidAccessKeyID
	ErrInvalidBucketName
	ErrInvalidDigest
	ErrInvalidRange
	ErrInvalidCopyPartRange
	ErrInvalidCopyPartRangeSource
	ErrInvalidMaxKeys
	ErrInvalidMaxUploads
	ErrInvalidMaxParts
	ErrInvalidPartNumberMarker
	ErrInvalidRequestBody
	ErrInvalidCopySource
	ErrInvalidMetadataDirective
	ErrInvalidCopyDest
	ErrInvalidPolicyDocument
	ErrInvalidObjectState
	ErrMalformedXML
	ErrMissingContentLength
	ErrMissingContentMD5
	ErrMissingRequestBodyError
	ErrNoSuchBucket
	ErrNoSuchBucketPolicy
	ErrNoSuchKey
	ErrNoSuchUpload
	ErrNotImplemented
	ErrPreconditionFailed
	ErrRequestTimeTooSkewed
	ErrSignatureDoesNotMatch
	ErrMethodNotAllowed
	ErrInvalidPart
	ErrInvalidPartOrder
	ErrAuthorizationHeaderMalformed
	ErrMalformedPOSTRequest
	ErrPOSTFileRequired
	ErrSignatureVersionNotSupported
	ErrBucketNotEmpty
	ErrAllAccessDisabled
	ErrMalformedPolicy
	ErrMissingFields
	ErrMissingCredTag
	ErrCredMalformed
	ErrInvalidRegion
	ErrInvalidService
	ErrInvalidRequestVersion
	ErrMissingSignTag
	ErrMissingSignHeadersTag
	ErrPolicyAlreadyExpired
	ErrMalformedDate
	ErrMalformedPresignedDate
	ErrMalformedCredentialDate
	ErrMalformedCredentialRegion
	ErrMalformedExpires
	ErrNegativeExpires
	ErrAuthHeaderEmpty
	ErrExpiredPresignRequest
	ErrRequestNotReadyYet
	ErrUnsignedHeaders
	ErrMissingDateHeader
	ErrInvalidQuerySignatureAlgo
	ErrInvalidQueryParams
	ErrBucketAlreadyOwnedByYou
	ErrInvalidDuration
	ErrNotSupported
	ErrBucketAlreadyExists

	// Bucket notification related errors.
	ErrEventNotification
	ErrARNNotification
	ErrRegionNotification
	ErrOverlappingFilterNotification
	ErrFilterNameInvalid
	ErrFilterNamePrefix
	ErrFilterNameSuffix
	ErrFilterValueInvalid
	ErrOverlappingConfigs

	// S3 extended errors.
	ErrContentSHA256Mismatch

	// Minio extended errors.
	ErrReadQuorum
	ErrWriteQuorum
	ErrStorageFull
	ErrObjectExistsAsDirectory
	ErrPolicyNesting
	ErrInvalidObjectName
	ErrInvalidResourceName
	ErrServerNotInitialized

	ErrAdminInvalidAccessKey
	ErrAdminInvalidSecretKey
	ErrAdminConfigNoQuorum
	ErrInsecureClientRequest
)

Error codes, non exhaustive list - http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

type APIErrorResponse

type APIErrorResponse struct {
	XMLName    xml.Name `xml:"Error" json:"-"`
	Code       string
	Message    string
	Key        string
	BucketName string
	Resource   string
	RequestID  string `xml:"RequestId"`
	HostID     string `xml:"HostId"`
}

APIErrorResponse - error response format

type AllAccessDisabled

type AllAccessDisabled GenericError

AllAccessDisabled All access to this object has been disabled

func (AllAccessDisabled) Error

func (e AllAccessDisabled) Error() string

Return string an error formatted as the given text.

type AppendFileArgs

type AppendFileArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string

	// Data buffer to be saved at path.
	Buffer []byte
}

AppendFileArgs represents append file RPC arguments.

type AuthRPCArgs

type AuthRPCArgs struct {
	// Authentication token to be verified by the server for every RPC call.
	AuthToken string
}

AuthRPCArgs represents minimum required arguments to make any authenticated RPC call.

func (AuthRPCArgs) IsAuthenticated

func (args AuthRPCArgs) IsAuthenticated() error

IsAuthenticated - validated whether this auth RPC args are already authenticated or not.

func (*AuthRPCArgs) SetAuthToken

func (args *AuthRPCArgs) SetAuthToken(authToken string)

SetAuthToken - sets the token to the supplied value.

type AuthRPCClient

type AuthRPCClient struct {
	sync.RWMutex // Mutex to lock this object.
	// contains filtered or unexported fields
}

AuthRPCClient is a authenticated RPC client which does authentication before doing Call().

func (*AuthRPCClient) Call

func (authClient *AuthRPCClient) Call(serviceMethod string, args interface {
	SetAuthToken(authToken string)
}, reply interface{}) (err error)

Call executes RPC call till success or globalAuthRPCRetryThreshold on ErrShutdown.

func (*AuthRPCClient) Close

func (authClient *AuthRPCClient) Close() error

Close closes underlying RPC Client.

func (*AuthRPCClient) Login

func (authClient *AuthRPCClient) Login() (err error)

Login a JWT based authentication is performed with rpc server.

func (*AuthRPCClient) ServerAddr

func (authClient *AuthRPCClient) ServerAddr() string

ServerAddr returns the serverAddr (network address) of the connection.

func (*AuthRPCClient) ServiceEndpoint

func (authClient *AuthRPCClient) ServiceEndpoint() string

ServiceEndpoint returns the RPC service endpoint of the connection.

type AuthRPCReply

type AuthRPCReply struct{}

AuthRPCReply represents minimum required reply for any authenticated RPC call.

type AuthRPCServer

type AuthRPCServer struct {
}

AuthRPCServer RPC server authenticates using JWT.

func (AuthRPCServer) Login

func (b AuthRPCServer) Login(args *LoginRPCArgs, reply *LoginRPCReply) error

Login - Handles JWT based RPC login.

type BackendType

type BackendType int

BackendType - represents different backend types.

const (
	Unknown BackendType = iota
	// Filesystem backend.
	FS
	// Multi disk Erasure (single, distributed) backend.
	Erasure
)

Enum for different backend types.

type BadDigest

type BadDigest struct {
	ExpectedMD5   string
	CalculatedMD5 string
}

BadDigest - Content-MD5 you specified did not match what we received.

func (BadDigest) Error

func (e BadDigest) Error() string

type BaseLogTarget

type BaseLogTarget struct {
	Enable bool `json:"enable"`
	// contains filtered or unexported fields
}

BaseLogTarget - base log target.

type BrowserFlag

type BrowserFlag bool

BrowserFlag - wrapper bool type.

func ParseBrowserFlag

func ParseBrowserFlag(s string) (bf BrowserFlag, err error)

ParseBrowserFlag - parses string into BrowserFlag.

func (BrowserFlag) MarshalJSON

func (bf BrowserFlag) MarshalJSON() ([]byte, error)

MarshalJSON - converts BrowserFlag into JSON data.

func (BrowserFlag) String

func (bf BrowserFlag) String() string

String - returns string of BrowserFlag.

func (*BrowserFlag) UnmarshalJSON

func (bf *BrowserFlag) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON - parses given data into BrowserFlag.

type Bucket

type Bucket struct {
	Name           string
	CreationDate   string          // time string of format "2006-01-02T15:04:05.000Z"
	HealBucketInfo *HealBucketInfo `xml:"HealBucketInfo,omitempty"`
}

Bucket container for bucket metadata

type BucketAccessPolicy

type BucketAccessPolicy struct {
	Prefix string              `json:"prefix"`
	Policy policy.BucketPolicy `json:"policy"`
}

BucketAccessPolicy - Collection of canned bucket policy at a given prefix.

type BucketAlreadyExists

type BucketAlreadyExists GenericError

BucketAlreadyExists the requested bucket name is not available.

func (BucketAlreadyExists) Error

func (e BucketAlreadyExists) Error() string

type BucketAlreadyOwnedByYou

type BucketAlreadyOwnedByYou GenericError

BucketAlreadyOwnedByYou already owned by you.

func (BucketAlreadyOwnedByYou) Error

func (e BucketAlreadyOwnedByYou) Error() string

type BucketExists

type BucketExists GenericError

BucketExists bucket exists.

func (BucketExists) Error

func (e BucketExists) Error() string

type BucketInfo

type BucketInfo struct {
	// Name of the bucket.
	Name string

	// Date and time when the bucket was created.
	Created time.Time

	// Healing information
	HealBucketInfo *HealBucketInfo `xml:"HealBucketInfo,omitempty"`
}

BucketInfo - represents bucket metadata.

type BucketMetaState

type BucketMetaState interface {
	// Updates bucket notification
	UpdateBucketNotification(args *SetBucketNotificationPeerArgs) error

	// Updates bucket listener
	UpdateBucketListener(args *SetBucketListenerPeerArgs) error

	// Updates bucket policy
	UpdateBucketPolicy(args *SetBucketPolicyPeerArgs) error

	// Sends event
	SendEvent(args *EventArgs) error
}

BucketMetaState - Interface to update bucket metadata in-memory state.

type BucketNameInvalid

type BucketNameInvalid GenericError

BucketNameInvalid - bucketname provided is invalid.

func (BucketNameInvalid) Error

func (e BucketNameInvalid) Error() string

Return string an error formatted as the given text.

type BucketNotEmpty

type BucketNotEmpty GenericError

BucketNotEmpty bucket is not empty.

func (BucketNotEmpty) Error

func (e BucketNotEmpty) Error() string

type BucketNotFound

type BucketNotFound GenericError

BucketNotFound bucket does not exist.

func (BucketNotFound) Error

func (e BucketNotFound) Error() string

type BucketPolicyNotFound

type BucketPolicyNotFound GenericError

BucketPolicyNotFound - no bucket policy found.

func (BucketPolicyNotFound) Error

func (e BucketPolicyNotFound) Error() string

type BucketUpdater

type BucketUpdater interface {
	BucketUpdate(client BucketMetaState) error
}

BucketUpdater - Interface implementer calls one of BucketMetaState's methods.

type CommitConfigArgs

type CommitConfigArgs struct {
	AuthRPCArgs
	FileName string
}

CommitConfigArgs - wraps the config file name that needs to be committed into config.json on this node.

type CommitConfigReply

type CommitConfigReply struct {
	AuthRPCReply
}

CommitConfigReply - represents response to commit of config file on this node.

type CommonPrefix

type CommonPrefix struct {
	Prefix string
}

CommonPrefix container for prefix response in ListObjectsResponse

type CompleteMultipartUploadResponse

type CompleteMultipartUploadResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CompleteMultipartUploadResult" json:"-"`

	Location string
	Bucket   string
	Key      string
	ETag     string
}

CompleteMultipartUploadResponse container for completed multipart upload response

type ConfigDir

type ConfigDir struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ConfigDir - configuration directory with locking.

func (*ConfigDir) Create

func (config *ConfigDir) Create() error

Create - creates configuration directory tree.

func (*ConfigDir) Get

func (config *ConfigDir) Get() string

Get - returns current configuration directory.

func (*ConfigDir) GetCADir

func (config *ConfigDir) GetCADir() string

GetCADir - returns certificate CA directory.

func (*ConfigDir) GetMinioConfigFile

func (config *ConfigDir) GetMinioConfigFile() string

GetMinioConfigFile - returns absolute path of config.json file.

func (*ConfigDir) GetPrivateKeyFile

func (config *ConfigDir) GetPrivateKeyFile() string

GetPrivateKeyFile - returns absolute path of private.key file.

func (*ConfigDir) GetPublicCertFile

func (config *ConfigDir) GetPublicCertFile() string

GetPublicCertFile - returns absolute path of public.crt file.

func (*ConfigDir) Set

func (config *ConfigDir) Set(dir string)

Set - saves given directory as configuration directory.

type ConfigReply

type ConfigReply struct {
	AuthRPCReply
	Config []byte // json-marshalled bytes of serverConfigV13
}

ConfigReply - wraps the server config response over RPC.

type ConnStats

type ConnStats struct {
	// contains filtered or unexported fields
}

ConnStats - Network statistics Count total input/output transferred bytes during the server's life.

type ConsoleLogger

type ConsoleLogger struct {
	BaseLogTarget
}

ConsoleLogger - console logger which logs into stderr.

func NewConsoleLogger

func NewConsoleLogger() (logger ConsoleLogger)

NewConsoleLogger - return new console logger object.

func (ConsoleLogger) Fire

func (logger ConsoleLogger) Fire(entry *logrus.Entry) error

Fire - log entry handler.

func (ConsoleLogger) String

func (logger ConsoleLogger) String() string

String - represents ConsoleLogger as string.

type CopyObjectPartResponse

type CopyObjectPartResponse struct {
	XMLName      xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopyPartResult" json:"-"`
	LastModified string   // time string of format "2006-01-02T15:04:05.000Z"
	ETag         string   // md5sum of the copied object part.
}

CopyObjectPartResponse container returns ETag and LastModified of the successfully copied object

type CopyObjectResponse

type CopyObjectResponse struct {
	XMLName      xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CopyObjectResult" json:"-"`
	LastModified string   // time string of format "2006-01-02T15:04:05.000Z"
	ETag         string   // md5sum of the copied object.
}

CopyObjectResponse container returns ETag and LastModified of the successfully copied object

type DeleteError

type DeleteError struct {
	Code    string
	Message string
	Key     string
}

DeleteError structure.

type DeleteFileArgs

type DeleteFileArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string
}

DeleteFileArgs represents delete file RPC arguments.

type DeleteObjectsRequest

type DeleteObjectsRequest struct {
	// Element to enable quiet mode for the request
	Quiet bool
	// List of objects to be deleted
	Objects []ObjectIdentifier `xml:"Object"`
}

DeleteObjectsRequest - xml carrying the object key names which needs to be deleted.

type DeleteObjectsResponse

type DeleteObjectsResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteResult" json:"-"`

	// Collection of all deleted objects
	DeletedObjects []ObjectIdentifier `xml:"Deleted,omitempty"`

	// Collection of errors deleting certain objects.
	Errors []DeleteError `xml:"Error,omitempty"`
}

DeleteObjectsResponse container for multiple object deletes.

type DownloadZipArgs

type DownloadZipArgs struct {
	Objects    []string `json:"objects"`    // can be files or sub-directories
	Prefix     string   `json:"prefix"`     // current directory in the browser-ui
	BucketName string   `json:"bucketname"` // bucket name.
}

DownloadZipArgs - Argument for downloading a bunch of files as a zip file. JSON will look like: '{"bucketname":"testbucket","prefix":"john/pics/","objects":["hawaii/","maldives/","sanjose.jpg"]}'

type Endpoint

type Endpoint struct {
	*url.URL
	IsLocal bool
}

Endpoint - any type of endpoint.

func NewEndpoint

func NewEndpoint(arg string) (ep Endpoint, e error)

NewEndpoint - returns new endpoint based on given arguments.

func (Endpoint) SetHTTP

func (endpoint Endpoint) SetHTTP()

SetHTTP - sets insecure http for URLEndpointType.

func (Endpoint) SetHTTPS

func (endpoint Endpoint) SetHTTPS()

SetHTTPS - sets secure http for URLEndpointType.

func (Endpoint) String

func (endpoint Endpoint) String() string

func (Endpoint) Type

func (endpoint Endpoint) Type() EndpointType

Type - returns type of endpoint.

type EndpointList

type EndpointList []Endpoint

EndpointList - list of same type of endpoint.

func NewEndpointList

func NewEndpointList(args ...string) (endpoints EndpointList, err error)

NewEndpointList - returns new endpoint list based on input args.

func (EndpointList) Len

func (endpoints EndpointList) Len() int

Len - helper method for sorting.

func (EndpointList) Less

func (endpoints EndpointList) Less(i, j int) bool

Less - helper method for sorting.

func (EndpointList) SetHTTP

func (endpoints EndpointList) SetHTTP()

SetHTTP - sets insecure http for URLEndpointType.

func (EndpointList) SetHTTPS

func (endpoints EndpointList) SetHTTPS()

SetHTTPS - sets secure http for URLEndpointType.

func (EndpointList) Swap

func (endpoints EndpointList) Swap(i, j int)

Swap - helper method for sorting.

type EndpointType

type EndpointType int

EndpointType - enum for endpoint type.

const (
	// PathEndpointType - path style endpoint type enum.
	PathEndpointType EndpointType = iota + 1

	// URLEndpointType - URL style endpoint type enum.
	URLEndpointType
)

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error - error type containing cause and the stack trace.

func (Error) Error

func (e Error) Error() string

Implement error interface.

func (Error) Trace

func (e Error) Trace() []string

Trace - returns stack trace.

type EventArgs

type EventArgs struct {
	// For Auth
	AuthRPCArgs

	// event being sent
	Event []NotificationEvent

	// client that it is meant for
	Arn string
}

EventArgs - Arguments collection for Event RPC call

type EventName

type EventName int

EventName is AWS S3 event type: http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html

const (
	// ObjectCreatedPut is s3:ObjectCreated:Put
	ObjectCreatedPut EventName = iota
	// ObjectCreatedPost is s3:ObjectCreated:Post
	ObjectCreatedPost
	// ObjectCreatedCopy is s3:ObjectCreated:Copy
	ObjectCreatedCopy
	// ObjectCreatedCompleteMultipartUpload is s3:ObjectCreated:CompleteMultipartUpload
	ObjectCreatedCompleteMultipartUpload
	// ObjectRemovedDelete is s3:ObjectRemoved:Delete
	ObjectRemovedDelete
	// ObjectAccessedGet is s3:ObjectAccessed:Get
	ObjectAccessedGet
	// ObjectAccessedHead is s3:ObjectAccessed:Head
	ObjectAccessedHead
)

func (EventName) String

func (eventName EventName) String() string

Stringer interface for event name.

type FileInfo

type FileInfo struct {
	// Name of the volume.
	Volume string

	// Name of the file.
	Name string

	// Date and time when the file was last modified.
	ModTime time.Time

	// Total file size.
	Size int64

	// File mode bits.
	Mode os.FileMode
}

FileInfo - represents file stat information.

type FileLogger

type FileLogger struct {
	BaseLogTarget
	Filename string `json:"filename"`
	// contains filtered or unexported fields
}

FileLogger - file logger which logs to a file.

func NewFileLogger

func NewFileLogger(filename string) (logger FileLogger)

NewFileLogger - creates new file logger object.

func (FileLogger) Fire

func (logger FileLogger) Fire(entry *logrus.Entry) (err error)

Fire - log entry handler.

func (FileLogger) String

func (logger FileLogger) String() string

String - represents ConsoleLogger as string.

type GatewayLayer

type GatewayLayer interface {
	ObjectLayer

	AnonGetObject(bucket, object string, startOffset int64, length int64, writer io.Writer) (err error)
	AnonGetObjectInfo(bucket, object string) (objInfo ObjectInfo, err error)

	AnonPutObject(bucket string, object string, size int64, data io.Reader, metadata map[string]string, sha256sum string) (ObjectInfo, error)

	SetBucketPolicies(string, policy.BucketAccessPolicy) error
	GetBucketPolicies(string) (policy.BucketAccessPolicy, error)
	DeleteBucketPolicies(string) error
	AnonListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (result ListObjectsInfo, err error)
	AnonListObjectsV2(bucket, prefix, continuationToken string, fetchOwner bool, delimiter string, maxKeys int) (result ListObjectsV2Info, err error)
	ListObjectsV2(bucket, prefix, continuationToken string, fetchOwner bool, delimiter string, maxKeys int) (result ListObjectsV2Info, err error)
	AnonGetBucketInfo(bucket string) (bucketInfo BucketInfo, err error)
}

GatewayLayer - Interface to implement gateway mode.

type GenerateAuthReply

type GenerateAuthReply struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
	UIVersion string `json:"uiVersion"`
}

GenerateAuthReply - reply for GenerateAuth

type GenericError

type GenericError struct {
	Bucket string
	Object string
}

GenericError - generic object layer error.

type GenericVolArgs

type GenericVolArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string
}

GenericVolArgs - generic volume args.

type GetAuthReply

type GetAuthReply struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
	UIVersion string `json:"uiVersion"`
}

GetAuthReply - Reply current credentials.

type GetBucketPolicyArgs

type GetBucketPolicyArgs struct {
	BucketName string `json:"bucketName"`
	Prefix     string `json:"prefix"`
}

GetBucketPolicyArgs - get bucket policy args.

type GetBucketPolicyRep

type GetBucketPolicyRep struct {
	UIVersion string              `json:"uiVersion"`
	Policy    policy.BucketPolicy `json:"policy"`
}

GetBucketPolicyRep - get bucket policy reply.

type HTTPMethodStats

type HTTPMethodStats struct {
	Counter  atomic.Uint64
	Duration atomic.Float64
}

HTTPMethodStats holds statistics information about a given HTTP method made by all clients

type HTTPStats

type HTTPStats struct {
	// contains filtered or unexported fields
}

HTTPStats holds statistics information about HTTP requests made by all clients

type HandlerFunc

type HandlerFunc func(http.Handler) http.Handler

HandlerFunc - useful to chain different middleware http.Handler

type HashAlgo

type HashAlgo string

HashAlgo - represents a supported hashing algorithm for bitrot verification.

const (
	// HashBlake2b represents the Blake 2b hashing algorithm
	HashBlake2b HashAlgo = "blake2b"
	// HashSha256 represents the SHA256 hashing algorithm
	HashSha256 HashAlgo = "sha256"
)

type HealBucketInfo

type HealBucketInfo struct {
	Status healStatus
}

HealBucketInfo - represents healing related information of a bucket.

type HealObjectInfo

type HealObjectInfo struct {
	Status             healStatus
	MissingDataCount   int
	MissingParityCount int
}

HealObjectInfo - represents healing related information of an object.

type IncompleteBody

type IncompleteBody GenericError

IncompleteBody You did not provide the number of bytes specified by the Content-Length HTTP header.

func (IncompleteBody) Error

func (e IncompleteBody) Error() string

Return string an error formatted as the given text.

type InitActions

type InitActions int

InitActions - a type synonym for enumerating initialization activities.

const (
	// FormatDisks - see above table for disk states where it
	// is applicable.
	FormatDisks InitActions = iota

	// WaitForHeal - Wait for disks to heal.
	WaitForHeal

	// WaitForQuorum - Wait for quorum number of disks to be online.
	WaitForQuorum

	// WaitForAll - Wait for all disks to be online.
	WaitForAll

	// WaitForFormatting - Wait for formatting to be triggered
	// from the '1st' server in the cluster.
	WaitForFormatting

	// WaitForConfig - Wait for all servers to have the same config
	// including (credentials, version and time).
	WaitForConfig

	// InitObjectLayer - Initialize object layer.
	InitObjectLayer

	// Abort initialization of object layer since there aren't enough good
	// copies of format.json to recover.
	Abort
)

type InitiateMultipartUploadResponse

type InitiateMultipartUploadResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ InitiateMultipartUploadResult" json:"-"`

	Bucket   string
	Key      string
	UploadID string `xml:"UploadId"`
}

InitiateMultipartUploadResponse container for InitiateMultiPartUpload response, provides uploadID to start MultiPart upload

type Initiator

type Initiator Owner

Initiator inherit from Owner struct, fields are same

type InsufficientReadQuorum

type InsufficientReadQuorum struct{}

InsufficientReadQuorum storage cannot satisfy quorum for read operation.

func (InsufficientReadQuorum) Error

func (e InsufficientReadQuorum) Error() string

type InsufficientWriteQuorum

type InsufficientWriteQuorum struct{}

InsufficientWriteQuorum storage cannot satisfy quorum for write operation.

func (InsufficientWriteQuorum) Error

func (e InsufficientWriteQuorum) Error() string

type InvalidMarkerPrefixCombination

type InvalidMarkerPrefixCombination struct {
	Marker, Prefix string
}

InvalidMarkerPrefixCombination - invalid marker and prefix combination.

func (InvalidMarkerPrefixCombination) Error

type InvalidPart

type InvalidPart struct{}

InvalidPart One or more of the specified parts could not be found

func (InvalidPart) Error

func (e InvalidPart) Error() string

type InvalidRange

type InvalidRange struct {
	// contains filtered or unexported fields
}

InvalidRange - invalid range typed error.

func (InvalidRange) Error

func (e InvalidRange) Error() string

type InvalidUploadID

type InvalidUploadID struct {
	UploadID string
}

InvalidUploadID invalid upload id.

func (InvalidUploadID) Error

func (e InvalidUploadID) Error() string

type InvalidUploadIDKeyCombination

type InvalidUploadIDKeyCombination struct {
	UploadIDMarker, KeyMarker string
}

InvalidUploadIDKeyCombination - invalid upload id and key marker combination.

func (InvalidUploadIDKeyCombination) Error

type ListAllBucketPoliciesArgs

type ListAllBucketPoliciesArgs struct {
	BucketName string `json:"bucketName"`
}

ListAllBucketPoliciesArgs - get all bucket policies.

type ListAllBucketPoliciesRep

type ListAllBucketPoliciesRep struct {
	UIVersion string               `json:"uiVersion"`
	Policies  []BucketAccessPolicy `json:"policies"`
}

ListAllBucketPoliciesRep - get all bucket policy reply.

type ListBucketsRep

type ListBucketsRep struct {
	Buckets   []WebBucketInfo `json:"buckets"`
	UIVersion string          `json:"uiVersion"`
}

ListBucketsRep - list buckets response

type ListBucketsResponse

type ListBucketsResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListAllMyBucketsResult" json:"-"`

	Owner Owner

	// Container for one or more buckets.
	Buckets struct {
		Buckets []Bucket `xml:"Bucket"`
	} // Buckets are nested
}

ListBucketsResponse - format for list buckets response

type ListDirArgs

type ListDirArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string
}

ListDirArgs represents list contents RPC arguments.

type ListLocksQuery

type ListLocksQuery struct {
	AuthRPCArgs
	// contains filtered or unexported fields
}

ListLocksQuery - wraps ListLocks API's query values to send over RPC.

type ListLocksReply

type ListLocksReply struct {
	AuthRPCReply
	// contains filtered or unexported fields
}

ListLocksReply - wraps ListLocks response over RPC.

type ListMultipartUploadsResponse

type ListMultipartUploadsResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListMultipartUploadsResult" json:"-"`

	Bucket             string
	KeyMarker          string
	UploadIDMarker     string `xml:"UploadIdMarker"`
	NextKeyMarker      string
	NextUploadIDMarker string `xml:"NextUploadIdMarker"`
	Delimiter          string
	Prefix             string
	EncodingType       string `xml:"EncodingType,omitempty"`
	MaxUploads         int
	IsTruncated        bool

	// List of pending uploads.
	Uploads []Upload `xml:"Upload"`

	// Delimed common prefixes.
	CommonPrefixes []CommonPrefix
}

ListMultipartUploadsResponse - format for list multipart uploads response.

type ListMultipartsInfo

type ListMultipartsInfo struct {
	// Together with upload-id-marker, this parameter specifies the multipart upload
	// after which listing should begin.
	KeyMarker string

	// Together with key-marker, specifies the multipart upload after which listing
	// should begin. If key-marker is not specified, the upload-id-marker parameter
	// is ignored.
	UploadIDMarker string

	// When a list is truncated, this element specifies the value that should be
	// used for the key-marker request parameter in a subsequent request.
	NextKeyMarker string

	// When a list is truncated, this element specifies the value that should be
	// used for the upload-id-marker request parameter in a subsequent request.
	NextUploadIDMarker string

	// Maximum number of multipart uploads that could have been included in the
	// response.
	MaxUploads int

	// Indicates whether the returned list of multipart uploads is truncated. A
	// value of true indicates that the list was truncated. The list can be truncated
	// if the number of multipart uploads exceeds the limit allowed or specified
	// by max uploads.
	IsTruncated bool

	// List of all pending uploads.
	Uploads []uploadMetadata

	// When a prefix is provided in the request, The result contains only keys
	// starting with the specified prefix.
	Prefix string

	// A character used to truncate the object prefixes.
	// NOTE: only supported delimiter is '/'.
	Delimiter string

	// CommonPrefixes contains all (if there are any) keys between Prefix and the
	// next occurrence of the string specified by delimiter.
	CommonPrefixes []string

	EncodingType string // Not supported yet.
}

ListMultipartsInfo - represnets bucket resources for incomplete multipart uploads.

type ListObjectsArgs

type ListObjectsArgs struct {
	BucketName string `json:"bucketName"`
	Prefix     string `json:"prefix"`
	Marker     string `json:"marker"`
}

ListObjectsArgs - list object args.

type ListObjectsInfo

type ListObjectsInfo struct {
	// Indicates whether the returned list objects response is truncated. A
	// value of true indicates that the list was truncated. The list can be truncated
	// if the number of objects exceeds the limit allowed or specified
	// by max keys.
	IsTruncated bool

	// When response is truncated (the IsTruncated element value in the response
	// is true), you can use the key name in this field as marker in the subsequent
	// request to get next set of objects.
	//
	// NOTE: This element is returned only if you have delimiter request parameter
	// specified.
	NextMarker string

	// List of objects info for this request.
	Objects []ObjectInfo

	// List of prefixes for this request.
	Prefixes []string
}

ListObjectsInfo - container for list objects.

type ListObjectsRep

type ListObjectsRep struct {
	Objects     []WebObjectInfo `json:"objects"`
	NextMarker  string          `json:"nextmarker"`
	IsTruncated bool            `json:"istruncated"`
	Writable    bool            `json:"writable"` // Used by client to show "upload file" button.
	UIVersion   string          `json:"uiVersion"`
}

ListObjectsRep - list objects response.

type ListObjectsResponse

type ListObjectsResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult" json:"-"`

	Name   string
	Prefix string
	Marker string

	// When response is truncated (the IsTruncated element value in the response
	// is true), you can use the key name in this field as marker in the subsequent
	// request to get next set of objects. Server lists objects in alphabetical
	// order Note: This element is returned only if you have delimiter request parameter
	// specified. If response does not include the NextMaker and it is truncated,
	// you can use the value of the last Key in the response as the marker in the
	// subsequent request to get the next set of object keys.
	NextMarker string `xml:"NextMarker,omitempty"`

	MaxKeys   int
	Delimiter string
	// A flag that indicates whether or not ListObjects returned all of the results
	// that satisfied the search criteria.
	IsTruncated bool

	Contents       []Object
	CommonPrefixes []CommonPrefix

	// Encoding type used to encode object keys in the response.
	EncodingType string `xml:"EncodingType,omitempty"`
}

ListObjectsResponse - format for list objects response.

type ListObjectsV2Info

type ListObjectsV2Info struct {
	// Indicates whether the returned list objects response is truncated. A
	// value of true indicates that the list was truncated. The list can be truncated
	// if the number of objects exceeds the limit allowed or specified
	// by max keys.
	IsTruncated bool

	// When response is truncated (the IsTruncated element value in the response
	// is true), you can use the key name in this field as marker in the subsequent
	// request to get next set of objects.
	//
	// NOTE: This element is returned only if you have delimiter request parameter
	// specified.
	ContinuationToken     string
	NextContinuationToken string

	// List of objects info for this request.
	Objects []ObjectInfo

	// List of prefixes for this request.
	Prefixes []string
}

ListObjectsV2Info - container for list objects version 2.

type ListObjectsV2Response

type ListObjectsV2Response struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListBucketResult" json:"-"`

	Name       string
	Prefix     string
	StartAfter string `xml:"StartAfter,omitempty"`
	// When response is truncated (the IsTruncated element value in the response
	// is true), you can use the key name in this field as marker in the subsequent
	// request to get next set of objects. Server lists objects in alphabetical
	// order Note: This element is returned only if you have delimiter request parameter
	// specified. If response does not include the NextMaker and it is truncated,
	// you can use the value of the last Key in the response as the marker in the
	// subsequent request to get the next set of object keys.
	ContinuationToken     string `xml:"ContinuationToken,omitempty"`
	NextContinuationToken string `xml:"NextContinuationToken,omitempty"`

	KeyCount  int
	MaxKeys   int
	Delimiter string
	// A flag that indicates whether or not ListObjects returned all of the results
	// that satisfied the search criteria.
	IsTruncated bool

	Contents       []Object
	CommonPrefixes []CommonPrefix

	// Encoding type used to encode object keys in the response.
	EncodingType string `xml:"EncodingType,omitempty"`
}

ListObjectsV2Response - format for list objects response.

type ListPartsInfo

type ListPartsInfo struct {
	// Name of the bucket.
	Bucket string

	// Name of the object.
	Object string

	// Upload ID identifying the multipart upload whose parts are being listed.
	UploadID string

	// The class of storage used to store the object.
	StorageClass string

	// Part number after which listing begins.
	PartNumberMarker int

	// When a list is truncated, this element specifies the last part in the list,
	// as well as the value to use for the part-number-marker request parameter
	// in a subsequent request.
	NextPartNumberMarker int

	// Maximum number of parts that were allowed in the response.
	MaxParts int

	// Indicates whether the returned list of parts is truncated.
	IsTruncated bool

	// List of all parts.
	Parts []PartInfo

	EncodingType string // Not supported yet.
}

ListPartsInfo - represents list of all parts.

type ListPartsResponse

type ListPartsResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ ListPartsResult" json:"-"`

	Bucket   string
	Key      string
	UploadID string `xml:"UploadId"`

	Initiator Initiator
	Owner     Owner

	// The class of storage used to store the object.
	StorageClass string

	PartNumberMarker     int
	NextPartNumberMarker int
	MaxParts             int
	IsTruncated          bool

	// List of parts.
	Parts []Part `xml:"Part"`
}

ListPartsResponse - format for list parts response.

type ListVolsReply

type ListVolsReply struct {
	// List of volumes stat information.
	Vols []VolInfo
}

ListVolsReply represents list of vols RPC reply.

type LocationResponse

type LocationResponse struct {
	XMLName  xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint" json:"-"`
	Location string   `xml:",chardata"`
}

LocationResponse - format for location response.

type LockArgs

type LockArgs struct {
	AuthRPCArgs
	LockArgs dsync.LockArgs
}

LockArgs represents arguments for any authenticated lock RPC call.

type LockInfoOpsIDNotFound

type LockInfoOpsIDNotFound struct {
	// contains filtered or unexported fields
}

LockInfoOpsIDNotFound - represents error when lock info entry for a given operation ID doesn't exist.

func (LockInfoOpsIDNotFound) Error

func (l LockInfoOpsIDNotFound) Error() string

type LockInfoOriginMismatch

type LockInfoOriginMismatch struct {
	// contains filtered or unexported fields
}

LockInfoOriginMismatch - represents error when lock origin don't match.

func (LockInfoOriginMismatch) Error

func (l LockInfoOriginMismatch) Error() string

type LockInfoStateNotBlocked

type LockInfoStateNotBlocked struct {
	// contains filtered or unexported fields
}

LockInfoStateNotBlocked - represents error when lock info isn't in blocked state when it should be.

func (LockInfoStateNotBlocked) Error

func (l LockInfoStateNotBlocked) Error() string

type LockInfoVolPathMissing

type LockInfoVolPathMissing struct {
	// contains filtered or unexported fields
}

LockInfoVolPathMissing - represents error when lock information is missing for a given (volume, path).

func (LockInfoVolPathMissing) Error

func (l LockInfoVolPathMissing) Error() string

type LockRPCClient

type LockRPCClient struct {
	*AuthRPCClient
}

LockRPCClient is authenticable lock RPC client compatible to dsync.NetLocker

func (*LockRPCClient) Expired

func (lockRPCClient *LockRPCClient) Expired(args dsync.LockArgs) (reply bool, err error)

Expired calls expired RPC.

func (*LockRPCClient) ForceUnlock

func (lockRPCClient *LockRPCClient) ForceUnlock(args dsync.LockArgs) (reply bool, err error)

ForceUnlock calls force unlock RPC.

func (*LockRPCClient) Lock

func (lockRPCClient *LockRPCClient) Lock(args dsync.LockArgs) (reply bool, err error)

Lock calls write lock RPC.

func (*LockRPCClient) RLock

func (lockRPCClient *LockRPCClient) RLock(args dsync.LockArgs) (reply bool, err error)

RLock calls read lock RPC.

func (*LockRPCClient) RUnlock

func (lockRPCClient *LockRPCClient) RUnlock(args dsync.LockArgs) (reply bool, err error)

RUnlock calls read unlock RPC.

func (*LockRPCClient) Unlock

func (lockRPCClient *LockRPCClient) Unlock(args dsync.LockArgs) (reply bool, err error)

Unlock calls write unlock RPC.

type LogTarget

type LogTarget interface {
	Fire(entry *logrus.Entry) error
	String() string
}

LogTarget - interface for log target.

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger - higher level logger.

func NewLogger

func NewLogger() *Logger

NewLogger - returns a new initialized logger.

func (*Logger) AddTarget

func (log *Logger) AddTarget(logTarget LogTarget)

AddTarget - add logger to this hook.

func (*Logger) EnableQuiet

func (log *Logger) EnableQuiet()

EnableQuiet - sets quiet option.

func (*Logger) Fire

func (log *Logger) Fire(entry *logrus.Entry) (err error)

Fire - log entry handler to save logs.

func (*Logger) Levels

func (log *Logger) Levels() []logrus.Level

Levels - returns list of log levels support.

func (*Logger) Printf

func (log *Logger) Printf(format string, args ...interface{})

Printf - wrapper to console.Printf() with quiet flag.

func (*Logger) Println

func (log *Logger) Println(args ...interface{})

Println - wrapper to console.Println() with quiet flag.

func (*Logger) SetConsoleTarget

func (log *Logger) SetConsoleTarget(consoleTarget ConsoleLogger)

SetConsoleTarget - sets console target to this hook.

type LoginArgs

type LoginArgs struct {
	Username string `json:"username" form:"username"`
	Password string `json:"password" form:"password"`
}

LoginArgs - login arguments.

type LoginRPCArgs

type LoginRPCArgs struct {
	Username    string
	Password    string
	Version     string
	RequestTime time.Time
}

LoginRPCArgs - login username and password for RPC.

func (LoginRPCArgs) IsValid

func (args LoginRPCArgs) IsValid() error

IsValid - validates whether this LoginRPCArgs are valid for authentication.

type LoginRPCReply

type LoginRPCReply struct {
	AuthToken string
}

LoginRPCReply - login reply provides generated token to be used with subsequent requests.

type LoginRep

type LoginRep struct {
	Token     string `json:"token"`
	UIVersion string `json:"uiVersion"`
}

LoginRep - login reply.

type MakeBucketArgs

type MakeBucketArgs struct {
	BucketName string `json:"bucketName"`
}

MakeBucketArgs - make bucket args.

type MalformedUploadID

type MalformedUploadID struct {
	UploadID string
}

MalformedUploadID malformed upload id.

func (MalformedUploadID) Error

func (e MalformedUploadID) Error() string

type NotImplemented

type NotImplemented struct{}

NotImplemented If a feature is not implemented

func (NotImplemented) Error

func (e NotImplemented) Error() string

type NotSupported

type NotSupported struct{}

NotSupported If a feature is not supported

func (NotSupported) Error

func (e NotSupported) Error() string

type NotificationEvent

type NotificationEvent struct {
	EventVersion      string            `json:"eventVersion"`
	EventSource       string            `json:"eventSource"`
	AwsRegion         string            `json:"awsRegion"`
	EventTime         string            `json:"eventTime"`
	EventName         string            `json:"eventName"`
	UserIdentity      identity          `json:"userIdentity"`
	RequestParameters map[string]string `json:"requestParameters"`
	ResponseElements  map[string]string `json:"responseElements"`
	S3                eventMeta         `json:"s3"`
	Source            sourceInfo        `json:"source"`
}

NotificationEvent represents an Amazon an S3 bucket notification event.

type Object

type Object struct {
	Key          string
	LastModified string // time string of format "2006-01-02T15:04:05.000Z"
	ETag         string
	Size         int64

	// Owner of the object.
	Owner Owner

	// The class of storage used to store the object.
	StorageClass   string
	HealObjectInfo *HealObjectInfo `xml:"HealObjectInfo,omitempty"`
}

Object container for object metadata

type ObjectExistsAsDirectory

type ObjectExistsAsDirectory GenericError

ObjectExistsAsDirectory object already exists as a directory.

func (ObjectExistsAsDirectory) Error

func (e ObjectExistsAsDirectory) Error() string

type ObjectIdentifier

type ObjectIdentifier struct {
	ObjectName string `xml:"Key"`
}

ObjectIdentifier carries key name for the object to delete.

type ObjectInfo

type ObjectInfo struct {
	// Name of the bucket.
	Bucket string

	// Name of the object.
	Name string

	// Date and time when the object was last modified.
	ModTime time.Time

	// Total object size.
	Size int64

	// IsDir indicates if the object is prefix.
	IsDir bool

	// Hex encoded unique entity tag of the object.
	ETag string

	// A standard MIME type describing the format of the object.
	ContentType string

	// Specifies what content encodings have been applied to the object and thus
	// what decoding mechanisms must be applied to obtain the object referenced
	// by the Content-Type header field.
	ContentEncoding string

	// User-Defined metadata
	UserDefined    map[string]string
	HealObjectInfo *HealObjectInfo `xml:"HealObjectInfo,omitempty"`
}

ObjectInfo - represents object metadata.

type ObjectLayer

type ObjectLayer interface {
	// Storage operations.
	Shutdown() error
	StorageInfo() StorageInfo

	// Bucket operations.
	MakeBucketWithLocation(bucket string, location string) error
	GetBucketInfo(bucket string) (bucketInfo BucketInfo, err error)
	ListBuckets() (buckets []BucketInfo, err error)
	DeleteBucket(bucket string) error
	ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (result ListObjectsInfo, err error)

	// Object operations.
	GetObject(bucket, object string, startOffset int64, length int64, writer io.Writer) (err error)
	GetObjectInfo(bucket, object string) (objInfo ObjectInfo, err error)
	PutObject(bucket, object string, size int64, data io.Reader, metadata map[string]string, sha256sum string) (objInfo ObjectInfo, err error)
	CopyObject(srcBucket, srcObject, destBucket, destObject string, metadata map[string]string) (objInfo ObjectInfo, err error)
	DeleteObject(bucket, object string) error

	// Multipart operations.
	ListMultipartUploads(bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (result ListMultipartsInfo, err error)
	NewMultipartUpload(bucket, object string, metadata map[string]string) (uploadID string, err error)
	CopyObjectPart(srcBucket, srcObject, destBucket, destObject string, uploadID string, partID int, startOffset int64, length int64) (info PartInfo, err error)
	PutObjectPart(bucket, object, uploadID string, partID int, size int64, data io.Reader, md5Hex string, sha256sum string) (info PartInfo, err error)
	ListObjectParts(bucket, object, uploadID string, partNumberMarker int, maxParts int) (result ListPartsInfo, err error)
	AbortMultipartUpload(bucket, object, uploadID string) error
	CompleteMultipartUpload(bucket, object, uploadID string, uploadedParts []completePart) (objInfo ObjectInfo, err error)

	// Healing operations.
	HealBucket(bucket string) error
	ListBucketsHeal() (buckets []BucketInfo, err error)
	HealObject(bucket, object string) (int, int, error)
	ListObjectsHeal(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, error)
	ListUploadsHeal(bucket, prefix, marker, uploadIDMarker,
		delimiter string, maxUploads int) (ListMultipartsInfo, error)
}

ObjectLayer implements primitives for object API layer.

type ObjectNameInvalid

type ObjectNameInvalid GenericError

ObjectNameInvalid - object name provided is invalid.

func (ObjectNameInvalid) Error

func (e ObjectNameInvalid) Error() string

Return string an error formatted as the given text.

type ObjectNotFound

type ObjectNotFound GenericError

ObjectNotFound object does not exist.

func (ObjectNotFound) Error

func (e ObjectNotFound) Error() string

type ObjectTooLarge

type ObjectTooLarge GenericError

ObjectTooLarge error returned when the size of the object > max object size allowed (5G) per request.

func (ObjectTooLarge) Error

func (e ObjectTooLarge) Error() string

type ObjectTooSmall

type ObjectTooSmall GenericError

ObjectTooSmall error returned when the size of the object < what is expected.

func (ObjectTooSmall) Error

func (e ObjectTooSmall) Error() string

type OpsLockState

type OpsLockState struct {
	OperationID string     `json:"id"`     // String containing operation ID.
	LockSource  string     `json:"source"` // Operation type (GetObject, PutObject...)
	LockType    lockType   `json:"type"`   // Lock type (RLock, WLock)
	Status      statusType `json:"status"` // Status can be Running/Ready/Blocked.
	Since       time.Time  `json:"since"`  // Time when the lock was initially held.
}

OpsLockState - structure to fill in state information of the lock. structure to fill in status information for each operation with given operation ID.

type Owner

type Owner struct {
	ID          string
	DisplayName string
}

Owner - bucket owner/principal

type Part

type Part struct {
	PartNumber   int
	LastModified string
	ETag         string
	Size         int64
}

Part container for part metadata.

type PartInfo

type PartInfo struct {
	// Part number that identifies the part. This is a positive integer between
	// 1 and 10,000.
	PartNumber int

	// Date and time at which the part was uploaded.
	LastModified time.Time

	// Entity tag returned when the part was initially uploaded.
	ETag string

	// Size in bytes of the part.
	Size int64
}

PartInfo - represents individual part metadata.

type PartTooBig

type PartTooBig struct{}

PartTooBig returned if size of part is bigger than the allowed limit.

func (PartTooBig) Error

func (e PartTooBig) Error() string

type PartTooSmall

type PartTooSmall struct {
	PartSize   int64
	PartNumber int
	PartETag   string
}

PartTooSmall - error if part size is less than 5MB.

func (PartTooSmall) Error

func (e PartTooSmall) Error() string

type PolicyNesting

type PolicyNesting struct{}

PolicyNesting - policy nesting conflict.

func (PolicyNesting) Error

func (e PolicyNesting) Error() string

type PolicyNotFound

type PolicyNotFound GenericError

PolicyNotFound - policy not found

func (PolicyNotFound) Error

func (e PolicyNotFound) Error() string

type PostPolicyForm

type PostPolicyForm struct {
	Expiration time.Time // Expiration date and time of the POST policy.
	Conditions struct {
		Policies map[string]struct {
			Operator string
			Value    string
		}
		ContentLengthRange contentLengthRange
	}
}

PostPolicyForm provides strict static type conversion and validation for Amazon S3's POST policy JSON string.

type PostResponse

type PostResponse struct {
	Bucket   string
	Key      string
	ETag     string
	Location string
}

PostResponse container for POST object request when success_action_status is set to 201

type PrefixAccessDenied

type PrefixAccessDenied GenericError

PrefixAccessDenied object access is denied.

func (PrefixAccessDenied) Error

func (e PrefixAccessDenied) Error() string

type PrepareFileArgs

type PrepareFileArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string

	// Size of the file to be prepared
	Size int64
}

PrepareFileArgs represents append file RPC arguments.

type PresignedGetArgs

type PresignedGetArgs struct {
	// Host header required for signed headers.
	HostName string `json:"host"`

	// Bucket name of the object to be presigned.
	BucketName string `json:"bucket"`

	// Object name to be presigned.
	ObjectName string `json:"object"`

	// Expiry in seconds.
	Expiry int64 `json:"expiry"`
}

PresignedGetArgs - presigned-get API args.

type PresignedGetRep

type PresignedGetRep struct {
	UIVersion string `json:"uiVersion"`
	// Presigned URL of the object.
	URL string `json:"url"`
}

PresignedGetRep - presigned-get URL reply.

type RPCClient

type RPCClient struct {
	sync.Mutex // Mutex to lock net rpc client.
	// contains filtered or unexported fields
}

RPCClient is a reconnectable RPC client on Call().

func (*RPCClient) Call

func (rpcClient *RPCClient) Call(serviceMethod string, args interface{}, reply interface{}) error

Call makes a RPC call to the remote endpoint using the default codec, namely encoding/gob.

func (*RPCClient) Close

func (rpcClient *RPCClient) Close() error

Close closes underlying rpc.Client.

type RWLocker

type RWLocker interface {
	sync.Locker
	RLock()
	RUnlock()
}

RWLocker - locker interface extends sync.Locker to introduce RLock, RUnlock.

type ReadAllArgs

type ReadAllArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string
}

ReadAllArgs represents read all RPC arguments.

type ReadFileArgs

type ReadFileArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string

	// Starting offset to start reading into Buffer.
	Offset int64

	// Data buffer read from the path at offset.
	Buffer []byte
}

ReadFileArgs represents read file RPC arguments.

type ReadFileWithVerifyArgs

type ReadFileWithVerifyArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string

	// Starting offset to start reading into Buffer.
	Offset int64

	// Data buffer read from the path at offset.
	Buffer []byte

	// Algorithm used in bit-rot hash computation.
	Algo HashAlgo

	// Stored hash value (hex-encoded) used to compare with
	// computed value.
	ExpectedHash string
}

ReadFileWithVerifyArgs represents read file RPC arguments.

type RemoveObjectArgs

type RemoveObjectArgs struct {
	Objects    []string `json:"objects"`    // Contains objects, prefixes.
	BucketName string   `json:"bucketname"` // Contains bucket name.
}

RemoveObjectArgs - args to remove an object, JSON will look like.

{
    "bucketname": "testbucket",
    "objects": [
        "photos/hawaii/",
        "photos/maldives/",
        "photos/sanjose.jpg"
    ]
}

type RenameFileArgs

type RenameFileArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of source volume.
	SrcVol string

	// Source path to be renamed.
	SrcPath string

	// Name of destination volume.
	DstVol string

	// Destination path of renamed file.
	DstPath string
}

RenameFileArgs represents rename file RPC arguments.

type SHA256Mismatch

type SHA256Mismatch struct{}

SHA256Mismatch - when content sha256 does not match with what was sent from client.

func (SHA256Mismatch) Error

func (e SHA256Mismatch) Error() string

type ServerConnStats

type ServerConnStats struct {
	TotalInputBytes  uint64 `json:"transferred"`
	TotalOutputBytes uint64 `json:"received"`
	Throughput       uint64 `json:"throughput,omitempty"`
}

ServerConnStats holds transferred bytes from/to the server

type ServerHTTPMethodStats

type ServerHTTPMethodStats struct {
	Count       uint64 `json:"count"`
	AvgDuration string `json:"avgDuration"`
}

ServerHTTPMethodStats holds total number of HTTP operations from/to the server, including the average duration the call was spent.

type ServerHTTPStats

type ServerHTTPStats struct {
	TotalHEADStats     ServerHTTPMethodStats `json:"totalHEADs"`
	SuccessHEADStats   ServerHTTPMethodStats `json:"successHEADs"`
	TotalGETStats      ServerHTTPMethodStats `json:"totalGETs"`
	SuccessGETStats    ServerHTTPMethodStats `json:"successGETs"`
	TotalPUTStats      ServerHTTPMethodStats `json:"totalPUTs"`
	SuccessPUTStats    ServerHTTPMethodStats `json:"successPUTs"`
	TotalPOSTStats     ServerHTTPMethodStats `json:"totalPOSTs"`
	SuccessPOSTStats   ServerHTTPMethodStats `json:"successPOSTs"`
	TotalDELETEStats   ServerHTTPMethodStats `json:"totalDELETEs"`
	SuccessDELETEStats ServerHTTPMethodStats `json:"successDELETEs"`
}

ServerHTTPStats holds all type of http operations performed to/from the server including their average execution time.

type ServerInfo

type ServerInfo struct {
	Error string          `json:"error"`
	Addr  string          `json:"addr"`
	Data  *ServerInfoData `json:"data"`
}

ServerInfo holds server information result of one node

type ServerInfoData

type ServerInfoData struct {
	StorageInfo StorageInfo      `json:"storage"`
	ConnStats   ServerConnStats  `json:"network"`
	HTTPStats   ServerHTTPStats  `json:"http"`
	Properties  ServerProperties `json:"server"`
}

ServerInfoData holds storage, connections and other information of a given server.

type ServerInfoDataReply

type ServerInfoDataReply struct {
	AuthRPCReply
	ServerInfoData ServerInfoData
}

ServerInfoDataReply - wraps the server info response over RPC.

type ServerInfoRep

type ServerInfoRep struct {
	MinioVersion    string
	MinioMemory     string
	MinioPlatform   string
	MinioRuntime    string
	MinioGlobalInfo map[string]interface{}
	UIVersion       string `json:"uiVersion"`
}

ServerInfoRep - server info reply.

type ServerProperties

type ServerProperties struct {
	Uptime   time.Duration `json:"uptime"`
	Version  string        `json:"version"`
	CommitID string        `json:"commitID"`
	Region   string        `json:"region"`
	SQSARN   []string      `json:"sqsARN"`
}

ServerProperties holds some server information such as, version, region uptime, etc..

type ServerStatus

type ServerStatus struct {
	ServerVersion ServerVersion `json:"serverVersion"`
	Uptime        time.Duration `json:"uptime"`
}

ServerStatus - contains the response of service status API

type ServerVersion

type ServerVersion struct {
	Version  string `json:"version"`
	CommitID string `json:"commitID"`
}

ServerVersion - server version

type ServiceConfig

type ServiceConfig struct {
	Events []string     `xml:"Event" json:"Event"`
	Filter filterStruct `xml:"Filter" json:"Filter"`
	ID     string       `xml:"Id" json:"Id"`
}

ServiceConfig - Common elements of service notification.

type SetAuthArgs

type SetAuthArgs struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
}

SetAuthArgs - argument for SetAuth

type SetAuthPeerArgs

type SetAuthPeerArgs struct {
	// For Auth
	AuthRPCArgs

	// New credentials that receiving peer should update to.
	Creds credential
}

SetAuthPeerArgs - Arguments collection for SetAuth RPC call

type SetAuthReply

type SetAuthReply struct {
	Token       string            `json:"token"`
	UIVersion   string            `json:"uiVersion"`
	PeerErrMsgs map[string]string `json:"peerErrMsgs"`
}

SetAuthReply - reply for SetAuth

type SetBucketListenerPeerArgs

type SetBucketListenerPeerArgs struct {
	// For Auth
	AuthRPCArgs

	Bucket string

	// Listener config for a given bucket.
	LCfg []listenerConfig
}

SetBucketListenerPeerArgs - Arguments collection to SetBucketListenerPeer RPC call

func (*SetBucketListenerPeerArgs) BucketUpdate

func (s *SetBucketListenerPeerArgs) BucketUpdate(client BucketMetaState) error

BucketUpdate - implements bucket listener updates, the underlying operation is a network call updates all the peers participating in listen bucket notification.

type SetBucketNotificationPeerArgs

type SetBucketNotificationPeerArgs struct {
	// For Auth
	AuthRPCArgs

	Bucket string

	// Notification config for the given bucket.
	NCfg *notificationConfig
}

SetBucketNotificationPeerArgs - Arguments collection to SetBucketNotificationPeer RPC call

func (*SetBucketNotificationPeerArgs) BucketUpdate

func (s *SetBucketNotificationPeerArgs) BucketUpdate(client BucketMetaState) error

BucketUpdate - implements bucket notification updates, the underlying operation is a network call updates all the peers participating in bucket notification.

type SetBucketPolicyArgs

type SetBucketPolicyArgs struct {
	BucketName string `json:"bucketName"`
	Prefix     string `json:"prefix"`
	Policy     string `json:"policy"`
}

SetBucketPolicyArgs - set bucket policy args.

type SetBucketPolicyPeerArgs

type SetBucketPolicyPeerArgs struct {
	// For Auth
	AuthRPCArgs

	Bucket string

	// Policy change (serialized to JSON)
	PChBytes []byte
}

SetBucketPolicyPeerArgs - Arguments collection for SetBucketPolicyPeer RPC call

func (*SetBucketPolicyPeerArgs) BucketUpdate

func (s *SetBucketPolicyPeerArgs) BucketUpdate(client BucketMetaState) error

BucketUpdate - implements bucket policy updates, the underlying operation is a network call updates all the peers participating for new set/unset policies.

type SetupType

type SetupType int

SetupType - enum for setup type.

const (
	// FSSetupType - FS setup type enum.
	FSSetupType SetupType = iota + 1

	// XLSetupType - XL setup type enum.
	XLSetupType

	// DistXLSetupType - Distributed XL setup type enum.
	DistXLSetupType
)

func (SetupType) String

func (setupType SetupType) String() string

type SignatureDoesNotMatch

type SignatureDoesNotMatch struct{}

SignatureDoesNotMatch - when content md5 does not match with what was sent from client.

func (SignatureDoesNotMatch) Error

func (e SignatureDoesNotMatch) Error() string

type StatFileArgs

type StatFileArgs struct {
	// Authentication token generated by Login.
	AuthRPCArgs

	// Name of the volume.
	Vol string

	// Name of the path.
	Path string
}

StatFileArgs represents stat file RPC arguments.

type StorageAPI

type StorageAPI interface {
	// Stringified version of disk.
	String() string

	// Storage operations.
	Init() (err error)
	Close() (err error)
	DiskInfo() (info disk.Info, err error)

	// Volume operations.
	MakeVol(volume string) (err error)
	ListVols() (vols []VolInfo, err error)
	StatVol(volume string) (vol VolInfo, err error)
	DeleteVol(volume string) (err error)

	// File operations.
	ListDir(volume, dirPath string) ([]string, error)
	ReadFile(volume string, path string, offset int64, buf []byte) (n int64, err error)
	ReadFileWithVerify(volume string, path string, offset int64, buf []byte,
		algo HashAlgo, expectedHash string) (n int64, err error)
	PrepareFile(volume string, path string, len int64) (err error)
	AppendFile(volume string, path string, buf []byte) (err error)
	RenameFile(srcVolume, srcPath, dstVolume, dstPath string) error
	StatFile(volume string, path string) (file FileInfo, err error)
	DeleteFile(volume string, path string) (err error)

	// Read all.
	ReadAll(volume string, path string) (buf []byte, err error)
}

StorageAPI interface.

type StorageFull

type StorageFull struct{}

StorageFull storage ran out of space.

func (StorageFull) Error

func (e StorageFull) Error() string

type StorageInfo

type StorageInfo struct {
	// Total disk space.
	Total int64
	// Free available disk space.
	Free int64
	// Backend type.
	Backend struct {
		// Represents various backend types, currently on FS and Erasure.
		Type BackendType

		// Following fields are only meaningful if BackendType is Erasure.
		OnlineDisks  int // Online disks during server startup.
		OfflineDisks int // Offline disks during server startup.
		ReadQuorum   int // Minimum disks required for successful read operations.
		WriteQuorum  int // Minimum disks required for successful write operations.
	}
}

StorageInfo - represents total capacity of underlying storage.

type StorageInfoRep

type StorageInfoRep struct {
	StorageInfo StorageInfo `json:"storageInfo"`
	UIVersion   string      `json:"uiVersion"`
}

StorageInfoRep - contains storage usage statistics.

type SystemLockState

type SystemLockState struct {
	TotalLocks int64 `json:"totalLocks"`
	// Count of operations which are blocked waiting for the lock to
	// be released.
	TotalBlockedLocks int64 `json:"totalBlockedLocks"`
	// Count of operations which has successfully acquired the lock but
	// hasn't unlocked yet (operation in progress).
	TotalAcquiredLocks int64            `json:"totalAcquiredLocks"`
	LocksInfoPerObject []VolumeLockInfo `json:"locksInfoPerObject"`
}

SystemLockState - Structure to fill the lock state of entire object storage. That is the total locks held, total calls blocked on locks and state of all the locks for the entire system.

type UnsupportedDelimiter

type UnsupportedDelimiter struct {
	Delimiter string
}

UnsupportedDelimiter - unsupported delimiter.

func (UnsupportedDelimiter) Error

func (e UnsupportedDelimiter) Error() string

type Upload

type Upload struct {
	Key            string
	UploadID       string `xml:"UploadId"`
	Initiator      Initiator
	Owner          Owner
	StorageClass   string
	Initiated      string
	HealUploadInfo *HealObjectInfo `xml:"HealObjectInfo,omitempty"`
}

Upload container for in progress multipart upload

type VolInfo

type VolInfo struct {
	// Name of the volume.
	Name string

	// Date and time when the volume was created.
	Created time.Time
}

VolInfo - represents volume stat information.

type VolumeLockInfo

type VolumeLockInfo struct {
	Bucket string `json:"bucket"`
	Object string `json:"object"`

	// All locks blocked + running for given <volume,path> pair.
	LocksOnObject int64 `json:"-"`
	// Count of operations which has successfully acquired the lock
	// but hasn't unlocked yet( operation in progress).
	LocksAcquiredOnObject int64 `json:"-"`
	// Count of operations which are blocked waiting for the lock
	// to be released.
	TotalBlockedLocks int64 `json:"-"`

	// Count of all read locks
	TotalReadLocks int64 `json:"readLocks"`
	// Count of all write locks
	TotalWriteLocks int64 `json:"writeLocks"`
	// State information containing state of the locks for all operations
	// on given <volume,path> pair.
	LockDetailsOnObject []OpsLockState `json:"lockOwners"`
}

VolumeLockInfo - Structure to contain the lock state info for volume, path pair.

type WebBucketInfo

type WebBucketInfo struct {
	// The name of the bucket.
	Name string `json:"name"`
	// Date the bucket was created.
	CreationDate time.Time `json:"creationDate"`
}

WebBucketInfo container for list buckets metadata.

type WebGenericArgs

type WebGenericArgs struct{}

WebGenericArgs - empty struct for calls that don't accept arguments for ex. ServerInfo, GenerateAuth

type WebGenericRep

type WebGenericRep struct {
	UIVersion string `json:"uiVersion"`
}

WebGenericRep - reply structure for calls for which reply is success/failure for ex. RemoveObject MakeBucket

type WebObjectInfo

type WebObjectInfo struct {
	// Name of the object
	Key string `json:"name"`
	// Date and time the object was last modified.
	LastModified time.Time `json:"lastModified"`
	// Size in bytes of the object.
	Size int64 `json:"size"`
	// ContentType is mime type of the object.
	ContentType string `json:"contentType"`
}

WebObjectInfo container for list objects metadata.

type WriteConfigArgs

type WriteConfigArgs struct {
	AuthRPCArgs
	TmpFileName string
	Buf         []byte
}

WriteConfigArgs - wraps the bytes to be written and temporary file name.

type WriteConfigReply

type WriteConfigReply struct {
	AuthRPCReply
}

WriteConfigReply - wraps the result of a writing config into a temporary file. the remote node.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL