cmd

package
v0.0.0-...-f4dd5e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: AGPL-3.0 Imports: 143 Imported by: 34

Documentation

Overview

Package cmd provides extended time.Duration implementation

Package cmd contains all the global variables and constants. ONLY TO BE ACCESSED VIA GET/SET FUNCTIONS.

Index

Constants

View Source
const (

	// AmzObjectLockMode sets object lock mode
	AmzObjectLockMode = "X-Amz-Object-Lock-Mode"
	// AmzObjectLockRetainUntilDate sets object lock retain until date
	AmzObjectLockRetainUntilDate = "X-Amz-Object-Lock-Retain-Until-Date"
	// AmzObjectLockLegalHold sets object lock legal hold
	AmzObjectLockLegalHold = "X-Amz-Object-Lock-Legal-Hold"
)
View Source
const HelpTmpl = `` /* 464-byte string literal not displayed */

HelpTmpl template used by all sub-systems

View Source
const History = `{{range .}}{{colorYellowBold "RestoreId:"}} {{colorYellowBold .RestoreID}}
Date: {{.CreateTime}}

{{.Targets}}

{{end}}`

History template used by all sub-systems

View Source
const Ping = `` /* 986-byte string literal not displayed */

Ping is the template for ping result

View Source
const PingDist = `` /* 987-byte string literal not displayed */

PingDist is the template for ping result in distributed mode

Variables

View Source
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]
	// CopyrightYear - dynamic value of the copyright end year
	CopyrightYear = "0000"
)
View Source
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}
)
View Source
var (
	Nanosecond  = Duration(time.Nanosecond)
	Microsecond = Duration(time.Microsecond)
	Millisecond = Duration(time.Millisecond)
	Second      = Duration(time.Second)
	Minute      = Duration(time.Minute)
	Hour        = Duration(time.Hour)
	Day         = Hour * 24
	Week        = Day * 7
	Fortnight   = Week * 2
	Month       = Day * 30    // Approximation
	Year        = Day * 365   // Approximation
	Decade      = Year * 10   // Approximation
	Century     = Year * 100  // Approximation
	Millennium  = Year * 1000 // Approximation
)

Standard unit of time.

View Source
var (

	// GlobalDevMode is set to true if the program is running in development mode
	GlobalDevMode = false

	// GlobalSubnetProxyURL is the proxy to be used for communication with subnet
	GlobalSubnetProxyURL *url.URL
)
View Source
var ErrInvalidFileSystemAttribute = errors.New("Error in parsing file system attribute")

ErrInvalidFileSystemAttribute reflects invalid fily system attribute

View Source
var ErrInvalidMetadata = errors.New("specified metadata should be of form key1=value1;key2=value2;... and so on")

ErrInvalidMetadata reflects invalid metadata format

View Source
var HelpEnvTemplate = template.Must(template.New("config-help-env").Funcs(funcMap).Parse(HelpTmpl))

HelpEnvTemplate - captures config help template

View Source
var HelpTemplate = template.Must(template.New("config-help").Funcs(funcMap).Parse(HelpTmpl))

HelpTemplate - captures config help template

View Source
var HistoryTemplate = template.Must(template.New("history-list").Funcs(funcMap).Parse(History))

HistoryTemplate - captures history list template

View Source
var PingTemplate = template.Must(template.New("ping-list").Funcs(colorMap).Parse(Ping))

PingTemplate - captures ping template

View Source
var PingTemplateDist = template.Must(template.New("ping-list").Funcs(colorMap).Parse(PingDist))

PingTemplateDist - captures ping template

View Source
var S3New = newFactory()

S3New returns an initialized S3Client structure. If debug is enabled, it also enables an internal trace transport.

Functions

func DownloadReleaseData

func DownloadReleaseData(customReleaseURL string, timeout time.Duration) (data string, err *probe.Error)

DownloadReleaseData - downloads release data from mc official server.

func GetCurrentReleaseTime

func GetCurrentReleaseTime() (releaseTime time.Time, err *probe.Error)

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 IsDCOS

func IsDCOS() bool

IsDCOS returns true if mc is running in DCOS.

func IsDeleteEvent

func IsDeleteEvent(event notify.Event) bool

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

func IsGetEvent(event notify.Event) bool

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

func IsPutEvent(event notify.Event) bool

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.

func Main

func Main(args []string) error

Main starts mc application

func NewAdminFactory

func NewAdminFactory() func(config *Config) (*madmin.AdminClient, *probe.Error)

NewAdminFactory encloses New function with client cache.

func ParseForm

func ParseForm(r *http.Request) error

ParseForm parses a http.Request form and populates the array

func PipeChan

func PipeChan(capacity int) (inputCh, outputCh chan notify.EventInfo)

PipeChan builds a new dynamically sized channel

func SubnetBaseURL

func SubnetBaseURL() string

SubnetBaseURL - returns the base URL of SUBNET

func SubnetLicenseAuthHeaders

func SubnetLicenseAuthHeaders(lic string) map[string]string

SubnetLicenseAuthHeaders - returns the headers for SUBNET license authentication

func SubnetPostReq

func SubnetPostReq(reqURL string, payload interface{}, headers map[string]string) (string, error)

SubnetPostReq - makes a POST request to SUBNET

func SubnetRegisterURL

func SubnetRegisterURL() string

SubnetRegisterURL - returns the cluster registration URL

func SubnetUploadURL

func SubnetUploadURL(uploadType string) string

SubnetUploadURL - returns the upload URL for the given upload type

func TarGZHealthInfo

func TarGZHealthInfo(healthInfo interface{}, version string) ([]byte, error)

TarGZHealthInfo - compress and tar MinIO diagnostics output

func UTCNow

func UTCNow() time.Time

UTCNow - returns current UTC time.

Types

type APINotImplemented

type APINotImplemented struct {
	API     string
	APIType string
}

APINotImplemented - api not implemented

func (APINotImplemented) Error

func (e APINotImplemented) Error() string
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 BucketInfo

type BucketInfo struct {
	URL        ClientURL   `json:"-"`
	Key        string      `json:"name"`
	Date       time.Time   `json:"lastModified"`
	Size       int64       `json:"size"`
	Type       os.FileMode `json:"-"`
	Prefix     bool        `json:"-"`
	Versioning struct {
		Status    string `json:"status"`
		MFADelete string `json:"MFADelete"`
	} `json:"Versioning,omitempty"`
	Encryption struct {
		Algorithm string `json:"algorithm,omitempty"`
		KeyID     string `json:"keyId,omitempty"`
	} `json:"Encryption,omitempty"`
	Locking struct {
		Enabled  string              `json:"enabled"`
		Mode     minio.RetentionMode `json:"mode"`
		Validity string              `json:"validity"`
	} `json:"ObjectLock,omitempty"`
	Replication struct {
		Enabled bool               `json:"enabled"`
		Config  replication.Config `json:"config,omitempty"`
	} `json:"Replication"`
	Policy struct {
		Type string `json:"type"`
		Text string `json:"policy,omitempty"`
	} `json:"Policy,omitempty"`
	Location string            `json:"location"`
	Tagging  map[string]string `json:"tagging,omitempty"`
	ILM      struct {
		Config *lifecycle.Configuration `json:"config,omitempty"`
	} `json:"ilm,omitempty"`
	Notification struct {
		Config notification.Configuration `json:"config,omitempty"`
	} `json:"notification,omitempty"`
}

BucketInfo holds info about a bucket

func (BucketInfo) Tags

func (i BucketInfo) Tags() string

Tags returns stringified tag list.

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 BucketStatOptions

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

BucketStatOptions - bucket stat.

type Client

type Client interface {
	// Common operations
	Stat(ctx context.Context, opts StatOptions) (content *ClientContent, err *probe.Error)
	List(ctx context.Context, opts ListOptions) <-chan *ClientContent

	// Bucket operations
	MakeBucket(ctx context.Context, region string, ignoreExisting, withLock bool) *probe.Error
	RemoveBucket(ctx context.Context, forceRemove bool) *probe.Error
	ListBuckets(ctx context.Context) ([]*ClientContent, *probe.Error)

	// Object lock config
	SetObjectLockConfig(ctx context.Context, mode minio.RetentionMode, validity uint64, unit minio.ValidityUnit) *probe.Error
	GetObjectLockConfig(ctx context.Context) (status string, mode minio.RetentionMode, validity uint64, unit minio.ValidityUnit, perr *probe.Error)

	// Access policy operations.
	GetAccess(ctx context.Context) (access, policyJSON string, err *probe.Error)
	GetAccessRules(ctx context.Context) (policyRules map[string]string, err *probe.Error)
	SetAccess(ctx context.Context, access string, isJSON bool) *probe.Error

	// I/O operations
	Copy(ctx context.Context, source string, opts CopyOptions, progress io.Reader) *probe.Error

	// Runs select expression on object storage on specific files.
	Select(ctx context.Context, expression string, sse encrypt.ServerSide, opts SelectObjectOpts) (io.ReadCloser, *probe.Error)

	// I/O operations with metadata.
	Get(ctx context.Context, opts GetOptions) (reader io.ReadCloser, content *ClientContent, err *probe.Error)
	Put(ctx context.Context, reader io.Reader, size int64, progress io.Reader, opts PutOptions) (n int64, err *probe.Error)

	// Object Locking related API
	PutObjectRetention(ctx context.Context, versionID string, mode minio.RetentionMode, retainUntilDate time.Time, bypassGovernance bool) *probe.Error
	GetObjectRetention(ctx context.Context, versionID string) (minio.RetentionMode, time.Time, *probe.Error)
	PutObjectLegalHold(ctx context.Context, versionID string, hold minio.LegalHoldStatus) *probe.Error
	GetObjectLegalHold(ctx context.Context, versionID string) (minio.LegalHoldStatus, *probe.Error)

	// I/O operations with expiration
	ShareDownload(ctx context.Context, versionID string, expires time.Duration) (string, *probe.Error)
	ShareUpload(context.Context, bool, time.Duration, string) (string, map[string]string, *probe.Error)

	// Watch events
	Watch(ctx context.Context, options WatchOptions) (*WatchObject, *probe.Error)

	// Delete operations
	Remove(ctx context.Context, isIncomplete, isRemoveBucket, isBypass, isForceDel bool, contentCh <-chan *ClientContent) (errorCh <-chan RemoveResult)
	// GetURL returns back internal url
	GetURL() ClientURL
	AddUserAgent(app, version string)

	// Tagging operations
	GetTags(ctx context.Context, versionID string) (map[string]string, *probe.Error)
	SetTags(ctx context.Context, versionID, tags string) *probe.Error
	DeleteTags(ctx context.Context, versionID string) *probe.Error

	// Lifecycle operations
	GetLifecycle(ctx context.Context) (*lifecycle.Configuration, time.Time, *probe.Error)
	SetLifecycle(ctx context.Context, config *lifecycle.Configuration) *probe.Error

	// Versioning operations
	GetVersion(ctx context.Context) (minio.BucketVersioningConfiguration, *probe.Error)
	SetVersion(ctx context.Context, status string, prefixes []string, excludeFolders bool) *probe.Error
	// Replication operations
	GetReplication(ctx context.Context) (replication.Config, *probe.Error)
	SetReplication(ctx context.Context, cfg *replication.Config, opts replication.Options) *probe.Error
	RemoveReplication(ctx context.Context) *probe.Error
	GetReplicationMetrics(ctx context.Context) (replication.MetricsV2, *probe.Error)
	ResetReplication(ctx context.Context, before time.Duration, arn string) (replication.ResyncTargetsInfo, *probe.Error)
	ReplicationResyncStatus(ctx context.Context, arn string) (rinfo replication.ResyncTargetsInfo, err *probe.Error)

	// Encryption operations
	GetEncryption(ctx context.Context) (string, string, *probe.Error)
	SetEncryption(ctx context.Context, algorithm, kmsKeyID string) *probe.Error
	DeleteEncryption(ctx context.Context) *probe.Error
	// Bucket info operation
	GetBucketInfo(ctx context.Context) (BucketInfo, *probe.Error)

	// Restore an object
	Restore(ctx context.Context, versionID string, days int) *probe.Error

	// OD operations
	GetPart(ctx context.Context, part int) (io.ReadCloser, *probe.Error)
	PutPart(ctx context.Context, reader io.Reader, size int64, progress io.Reader, opts PutOptions) (n int64, err *probe.Error)

	// Cors operations
	GetBucketCors(ctx context.Context) (*cors.Config, *probe.Error)
	SetBucketCors(ctx context.Context, corsXML []byte) *probe.Error
	DeleteBucketCors(ctx context.Context) *probe.Error
}

Client - client interface

type ClientContent

type ClientContent struct {
	URL          ClientURL
	BucketName   string // only valid and set for client-type objectStorage
	Time         time.Time
	Size         int64
	Type         os.FileMode
	StorageClass string
	Metadata     map[string]string
	Tags         map[string]string
	UserMetadata map[string]string
	Checksum     map[string]string
	ETag         string
	Expires      time.Time

	Expiration       time.Time
	ExpirationRuleID string

	RetentionEnabled  bool
	RetentionMode     string
	RetentionDuration string
	BypassGovernance  bool
	LegalHoldEnabled  bool
	LegalHold         string
	VersionID         string
	IsDeleteMarker    bool
	IsLatest          bool
	ReplicationStatus string

	Restore *minio.RestoreInfo

	Err *probe.Error
}

ClientContent - Content container for content metadata

type ClientResult

type ClientResult struct {
	BytesSent uint64 `json:"bytesSent"`
	TimeSpent int64  `json:"timeSpent"`
	Endpoint  string `json:"endpoint"`
	Error     string `json:"error"`
}

ClientResult - result of the network from client to server

type ClientURL

type ClientURL struct {
	Type            ClientURLType
	Scheme          string
	Host            string
	Path            string
	SchemeSeparator string
	Separator       rune
}

ClientURL url client url structure

func (ClientURL) Clone

func (u ClientURL) Clone() ClientURL

Clone the url into a new object.

func (ClientURL) String

func (u ClientURL) String() string

String convert URL into its canonical form.

type ClientURLType

type ClientURLType int

ClientURLType - enum of different url types

type ClusterHealthV1

type ClusterHealthV1 struct {
	TimeStamp time.Time   `json:"timestamp,omitempty"`
	Status    string      `json:"status"`
	Error     string      `json:"error,omitempty"`
	Hardware  HwServersV1 `json:"hardware,omitempty"`
	Software  SwInfoV1    `json:"software,omitempty"`
}

ClusterHealthV1 - main struct of the health report

func MapHealthInfoToV1

func MapHealthInfoToV1(healthInfo madmin.HealthInfoV0, err error) ClusterHealthV1

MapHealthInfoToV1 - maps the health info returned by minio server to V1 format

func (ClusterHealthV1) GetError

func (ch ClusterHealthV1) GetError() string

GetError - return error from the health info

func (ClusterHealthV1) GetStatus

func (ch ClusterHealthV1) GetStatus() string

GetStatus - return status of the health info

func (ClusterHealthV1) GetTimestamp

func (ch ClusterHealthV1) GetTimestamp() time.Time

GetTimestamp - return timestamp from the health info

func (ClusterHealthV1) JSON

func (ch ClusterHealthV1) JSON() string

JSON jsonifies service status message.

func (ClusterHealthV1) String

func (ch ClusterHealthV1) String() string

type ClusterInfo

type ClusterInfo struct {
	MinioVersion    string `json:"minio_version"`
	NoOfServerPools int    `json:"no_of_server_pools"`
	NoOfServers     int    `json:"no_of_servers"`
	NoOfDrives      int    `json:"no_of_drives"`
	NoOfBuckets     uint64 `json:"no_of_buckets"`
	NoOfObjects     uint64 `json:"no_of_objects"`
	TotalDriveSpace uint64 `json:"total_drive_space"`
	UsedDriveSpace  uint64 `json:"used_drive_space"`
}

ClusterInfo - The "info" sub-node of the cluster registration information struct Intended to be extensible i.e. more fields will be added as and when required

type ClusterRegistrationInfo

type ClusterRegistrationInfo struct {
	DeploymentID string      `json:"deployment_id"`
	ClusterName  string      `json:"cluster_name"`
	UsedCapacity uint64      `json:"used_capacity"`
	Info         ClusterInfo `json:"info"`
}

ClusterRegistrationInfo - Information stored in the cluster registration token

func GetClusterRegInfo

func GetClusterRegInfo(admInfo madmin.InfoMessage, clusterName string) ClusterRegistrationInfo

GetClusterRegInfo - returns the cluster registration info

type ClusterRegistrationReq

type ClusterRegistrationReq struct {
	Token string `json:"token"`
}

ClusterRegistrationReq - JSON payload of the subnet api for cluster registration Contains a registration token created by base64 encoding of the registration info

type Config

type Config struct {
	Alias             string
	AccessKey         string
	SecretKey         string
	SessionToken      string
	Signature         string
	HostURL           string
	AppName           string
	AppVersion        string
	Debug             bool
	Insecure          bool
	Lookup            minio.BucketLookupType
	ConnReadDeadline  time.Duration
	ConnWriteDeadline time.Duration
	UploadLimit       int64
	DownloadLimit     int64
	Transport         http.RoundTripper
}

Config - see http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html

func BuildS3Config

func BuildS3Config(ctx context.Context, alias, url, accessKey, secretKey, api, path string, peerCert *x509.Certificate) (*Config, *probe.Error)

BuildS3Config constructs an S3 Config and does signature auto-probe when needed.

func NewS3Config

func NewS3Config(alias, urlStr string, aliasCfg *aliasConfigV10) *Config

NewS3Config simply creates a new Config struct using the passed parameters.

type ConfigAnyVersion

type ConfigAnyVersion struct {
	Version string
}

ConfigAnyVersion is a generic structure to parse any config.json version file and only extracts its version number

type CopyOptions

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

CopyOptions holds options for copying operation

type DirOpt

type DirOpt int8

DirOpt - list directory option.

const (
	// DirNone - do not include directories in the list.
	DirNone DirOpt = iota
	// DirFirst - include directories before objects in the list.
	DirFirst
	// DirLast - include directories after objects in the list.
	DirLast
)

type DriveTestResult

type DriveTestResult struct {
	Endpoint string             `json:"endpoint"`
	Perf     []madmin.DrivePerf `json:"perf,omitempty"`
	Error    string             `json:"error,omitempty"`
}

DriveTestResult - result of the drive performance test on a given endpoint

type DriveTestResults

type DriveTestResults struct {
	Results []DriveTestResult `json:"servers"`
}

DriveTestResults - results of drive performance test across all endpoints

type Duration

type Duration time.Duration

Duration is a standard unit of time.

func ParseDuration

func ParseDuration(s string) (Duration, error)

ParseDuration parses a duration string. This implementation is similar to Go's https://cs.opensource.google/go/go/+/refs/tags/go1.18.3:src/time/format.go;l=1546;bpv=1;bpt=1 extends it to parse days, weeks and years..

Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h", "d", "w", "y".

func (Duration) Days

func (d Duration) Days() float64

Days returns the duration as a floating point number of days.

type EmptyPath

type EmptyPath struct{}

EmptyPath (EINVAL) - invalid argument.

func (EmptyPath) Error

func (e EmptyPath) Error() string

type EndPointStats

type EndPointStats struct {
	Endpoint  *url.URL `json:"endpoint"`
	Min       string   `json:"min"`
	Max       string   `json:"max"`
	Average   string   `json:"average"`
	DNS       string   `json:"dns"`
	CountErr  string   `json:"error-count,omitempty"`
	Error     string   `json:"error,omitempty"`
	Roundtrip string   `json:"roundtrip"`
}

EndPointStats - container to hold server ping stats

type EventInfo

type EventInfo struct {
	Time         string
	Size         int64
	UserMetadata map[string]string
	Path         string
	Host         string
	Port         string
	UserAgent    string
	Type         notification.EventType
}

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 GetOptions

type GetOptions struct {
	SSE        encrypt.ServerSide
	VersionID  string
	Zip        bool
	RangeStart int64
	PartNumber int
	Preserve   bool
}

GetOptions holds options of the GET operation

type Health

type Health struct {
	Health SchemaVersion `json:"health"`
}

Health - intermediate struct for subnet health header Just used to achieve the JSON structure we want

type HealthDataTypeFlag

type HealthDataTypeFlag struct {
	Name   string
	Usage  string
	EnvVar string
	Hidden bool
	Value  *HealthDataTypeSlice
}

HealthDataTypeFlag is a typed flag to represent health datatypes

func (HealthDataTypeFlag) Apply

func (f HealthDataTypeFlag) Apply(set *flag.FlagSet)

Apply - applies the flag

func (HealthDataTypeFlag) ApplyWithError

func (f HealthDataTypeFlag) ApplyWithError(set *flag.FlagSet) error

ApplyWithError - applies with error

func (HealthDataTypeFlag) GetName

func (f HealthDataTypeFlag) GetName() string

GetName - returns the name of the flag

func (HealthDataTypeFlag) String

func (f HealthDataTypeFlag) String() string

String - returns the string to be shown in the help message

type HealthDataTypeSlice

type HealthDataTypeSlice []madmin.HealthDataType

HealthDataTypeSlice is a typed list of health tests

func GetGlobalHealthDataTypeSlice

func GetGlobalHealthDataTypeSlice(c *cli.Context, name string) *HealthDataTypeSlice

GetGlobalHealthDataTypeSlice - returns the list of set health tests set globally

func GetHealthDataTypeSlice

func GetHealthDataTypeSlice(c *cli.Context, name string) *HealthDataTypeSlice

GetHealthDataTypeSlice - returns the list of set health tests

func (*HealthDataTypeSlice) Get

func (d *HealthDataTypeSlice) Get() interface{}

Get - returns the value

func (*HealthDataTypeSlice) Set

func (d *HealthDataTypeSlice) Set(value string) error

Set - sets the flag to the given value

func (*HealthDataTypeSlice) String

func (d *HealthDataTypeSlice) String() string

String - returns the string representation of the health datatypes

func (*HealthDataTypeSlice) Value

func (d *HealthDataTypeSlice) Value() []madmin.HealthDataType

Value - returns the value

type HealthReportHeader

type HealthReportHeader struct {
	Subnet Health `json:"subnet"`
}

HealthReportHeader - Header of the subnet health report expected to generate JSON output of the form {"subnet":{"health":{"version":"v1"}}}

type HealthReportInfo

type HealthReportInfo interface {
	GetTimestamp() time.Time
	GetStatus() string
	GetError() string
	// contains filtered or unexported methods
}

HealthReportInfo - interface to be implemented by health report schema struct

type HwCPUV1

type HwCPUV1 struct {
	CPUStat   []cpu.InfoStat  `json:"cpu,omitempty"`
	TimesStat []cpu.TimesStat `json:"time,omitempty"`
	Error     string          `json:"error,omitempty"`
}

HwCPUV1 - CPU Info

type HwDrivePerfV1

type HwDrivePerfV1 struct {
	Serial   []madmin.DrivePerfInfoV0 `json:"serial,omitempty"`
	Parallel []madmin.DrivePerfInfoV0 `json:"parallel,omitempty"`
	Error    string                   `json:"error,omitempty"`
}

HwDrivePerfV1 - Network performance info

type HwDriveV1

type HwDriveV1 struct {
	Counters   map[string]disk.IOCountersStat `json:"counters,omitempty"`
	Partitions []madmin.PartitionStat         `json:"partitions,omitempty"`
	Usage      []*disk.UsageStat              `json:"usage,omitempty"`
	Error      string                         `json:"error,omitempty"`
}

HwDriveV1 - Drive info

type HwMemV1

type HwMemV1 struct {
	SwapMem    *mem.SwapMemoryStat    `json:"swap,omitempty"`
	VirtualMem *mem.VirtualMemoryStat `json:"virtualmem,omitempty"`
	Error      string                 `json:"error,omitempty"`
}

HwMemV1 - Includes host virtual and swap mem information

type HwNetPerfV1

type HwNetPerfV1 struct {
	Serial   []madmin.NetPerfInfoV0 `json:"serial,omitempty"`
	Parallel []madmin.NetPerfInfoV0 `json:"parallel,omitempty"`
}

HwNetPerfV1 - Network performance info

type HwPerfV1

type HwPerfV1 struct {
	Net   HwNetPerfV1   `json:"net,omitempty"`
	Drive HwDrivePerfV1 `json:"drives,omitempty"`
}

HwPerfV1 - hardware performance

type HwServerV1

type HwServerV1 struct {
	Addr    string      `json:"addr"`
	CPUs    []HwCPUV1   `json:"cpus,omitempty"`
	Drives  []HwDriveV1 `json:"drives,omitempty"`
	MemInfo HwMemV1     `json:"meminfo,omitempty"`
	Perf    HwPerfV1    `json:"perf,omitempty"`
}

HwServerV1 - server health Info

type HwServersV1

type HwServersV1 struct {
	Servers []HwServerV1 `json:"servers,omitempty"`
}

HwServersV1 - hardware health Info

type InvalidArgument

type InvalidArgument struct{}

InvalidArgument - passed argument is invalid for this operation

func (InvalidArgument) Error

func (e InvalidArgument) Error() string

type ListOptions

type ListOptions struct {
	Recursive         bool
	Incomplete        bool
	WithMetadata      bool
	WithOlderVersions bool
	WithDeleteMarkers bool
	ListZip           bool
	TimeRef           time.Time
	ShowDir           DirOpt
	Count             int
}

ListOptions holds options for listing operation

type MinioHealthInfoV1

type MinioHealthInfoV1 struct {
	Info     madmin.InfoMessage      `json:"info,omitempty"`
	Config   interface{}             `json:"config,omitempty"`
	ProcInfo []madmin.ServerProcInfo `json:"procinfos,omitempty"`
	Error    string                  `json:"error,omitempty"`
}

MinioHealthInfoV1 - Health info of the MinIO cluster

type NetStats

type NetStats struct {
	TX uint64 `json:"tx"`
	RX uint64 `json:"rx"`
}

NetStats - Network performance stats

type NetTestResult

type NetTestResult struct {
	Endpoint string   `json:"endpoint"`
	Perf     NetStats `json:"perf"`
	Error    string   `json:"error,omitempty"`
}

NetTestResult - result of the network performance test for given endpoint

type NetTestResults

type NetTestResults struct {
	Results []NetTestResult `json:"servers"`
}

NetTestResults - result of the network performance test across all endpoints

type NotificationConfig

type NotificationConfig struct {
	ID     string   `json:"id"`
	Arn    string   `json:"arn"`
	Events []string `json:"events"`
	Prefix string   `json:"prefix"`
	Suffix string   `json:"suffix"`
}

NotificationConfig notification config

type ObjGETPerfResults

type ObjGETPerfResults struct {
	Perf    ObjGETStats     `json:"perf"`
	Servers []ObjStatServer `json:"servers"`
}

ObjGETPerfResults - Object GET performance results

type ObjGETStats

type ObjGETStats struct {
	ObjPUTStats
	TTFB madmin.Timings `json:"ttfb,omitempty"`
}

ObjGETStats - GET stats of all the servers

type ObjPUTPerfResults

type ObjPUTPerfResults struct {
	Perf    ObjPUTStats     `json:"perf"`
	Servers []ObjStatServer `json:"servers"`
}

ObjPUTPerfResults - Object PUT performance results

type ObjPUTStats

type ObjPUTStats struct {
	Throughput    uint64         `json:"throughput"`
	ObjectsPerSec uint64         `json:"objectsPerSec"`
	Response      madmin.Timings `json:"responseTime"`
}

ObjPUTStats - PUT stats of all the servers

type ObjStatServer

type ObjStatServer struct {
	Endpoint string   `json:"endpoint"`
	Perf     ObjStats `json:"perf"`
	Error    string   `json:"error,omitempty"`
}

ObjStatServer - Server level object performance stats

type ObjStats

type ObjStats struct {
	Throughput    uint64 `json:"throughput"`
	ObjectsPerSec uint64 `json:"objectsPerSec"`
}

ObjStats - Object performance stats

type ObjTestResults

type ObjTestResults struct {
	ObjectSize int               `json:"objectSize"`
	Threads    int               `json:"threads"`
	PUTResults ObjPUTPerfResults `json:"PUT"`
	GETResults ObjGETPerfResults `json:"GET"`
}

ObjTestResults - result of the object performance test

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

type ObjectIsDeleteMarker

type ObjectIsDeleteMarker struct{}

ObjectIsDeleteMarker - object is a delete marker as latest

func (ObjectIsDeleteMarker) Error

func (e ObjectIsDeleteMarker) Error() string

type ObjectMissing

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

ObjectMissing (EINVAL) - object key missing.

func (ObjectMissing) Error

func (e ObjectMissing) Error() string

type ObjectNameEmpty

type ObjectNameEmpty struct{}

ObjectNameEmpty - object name empty.

func (ObjectNameEmpty) Error

func (e ObjectNameEmpty) 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

func (*ParallelManager) Read

func (p *ParallelManager) Read(b []byte) (n int, err error)

type PathInsufficientPermission

type PathInsufficientPermission GenericFileError

PathInsufficientPermission (EPERM) - permission denied.

func (PathInsufficientPermission) Error

type PathIsNotRegular

type PathIsNotRegular GenericFileError

PathIsNotRegular (ENOTREG) - file is not a regular file.

func (PathIsNotRegular) Error

func (e PathIsNotRegular) Error() string

type PathNotADirectory

type PathNotADirectory GenericFileError

PathNotADirectory - this path does not correspond to a directory

func (PathNotADirectory) Error

func (e PathNotADirectory) Error() string

type PathNotFound

type PathNotFound GenericFileError

PathNotFound (ENOENT) - file not found.

func (PathNotFound) Error

func (e PathNotFound) Error() string

type PerfTestOutput

type PerfTestOutput struct {
	ObjectResults          *ObjTestResults             `json:"object,omitempty"`
	NetResults             *NetTestResults             `json:"network,omitempty"`
	SiteReplicationResults *SiteReplicationTestResults `json:"siteReplication,omitempty"`
	DriveResults           *DriveTestResults           `json:"drive,omitempty"`
	ClientResults          *ClientResult               `json:"client,omitempty"`
	Error                  string                      `json:"error,omitempty"`
}

PerfTestOutput - stores the final output of performance test(s)

func (PerfTestOutput) JSON

func (p PerfTestOutput) JSON() string

JSON - jsonified output of the perf tests

func (PerfTestOutput) String

func (p PerfTestOutput) String() string

String - dummy function to confirm to the 'message' interface. Not used.

type PerfTestResult

type PerfTestResult struct {
	Type                  PerfTestType                  `json:"type"`
	ObjectResult          *madmin.SpeedTestResult       `json:"object,omitempty"`
	NetResult             *madmin.NetperfResult         `json:"network,omitempty"`
	SiteReplicationResult *madmin.SiteNetPerfResult     `json:"siteReplication,omitempty"`
	ClientResult          *madmin.ClientPerfResult      `json:"client,omitempty"`
	DriveResult           []madmin.DriveSpeedTestResult `json:"drive,omitempty"`
	Err                   string                        `json:"err,omitempty"`
	Final                 bool                          `json:"final,omitempty"`
}

PerfTestResult - stores the result of a performance test

type PerfTestType

type PerfTestType byte

PerfTestType - The type of performance test (net/drive/object)

const (
	NetPerfTest PerfTestType = 1 << iota
	DrivePerfTest
	ObjectPerfTest
	SiteReplicationPerfTest
	ClientPerfTest
)

Constants for performance test type

func (PerfTestType) Name

func (p PerfTestType) Name() string

Name - returns name of the performance test

type PingResult

type PingResult struct {
	Status         string          `json:"status"`
	Counter        string          `json:"counter"`
	EndPointsStats []EndPointStats `json:"servers"`
}

PingResult contains ping output

func (PingResult) JSON

func (pr PingResult) JSON() string

JSON jsonified ping result message.

func (PingResult) String

func (pr PingResult) String() string

String colorized service status message.

type PrettyRecord

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

PrettyRecord - an easy struct to format a set of key-value pairs into a record

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
	SetTotal(int64)
}

Progress - an interface which describes current amount of data written.

type ProgressReader

type ProgressReader interface {
	io.Reader
	Progress
}

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) AddCounts

func (ps *ProgressStatus) AddCounts(v int64)

AddCounts adds 'v' number of files uploaded.

func (*ProgressStatus) Finish

func (ps *ProgressStatus) Finish()

Finish displays the accounting summary

func (*ProgressStatus) Get

func (ps *ProgressStatus) Get() int64

Get returns the current number of bytes

func (*ProgressStatus) GetCounts

func (ps *ProgressStatus) GetCounts() int64

GetCounts returns number of files uploaded

func (*ProgressStatus) PrintMsg

func (ps *ProgressStatus) PrintMsg(_ 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) Set64

func (p ProgressStatus) Set64(length int64) *progressBar

func (*ProgressStatus) SetCaption

func (ps *ProgressStatus) SetCaption(s string)

SetCaption sets the caption of the progressbar

func (*ProgressStatus) SetCounts

func (ps *ProgressStatus) SetCounts(v int64)

SetCounts sets number of files uploaded

func (*ProgressStatus) SetTotal

func (ps *ProgressStatus) SetTotal(v int64) Status

SetTotal sets the total of the progressbar

func (*ProgressStatus) Start

func (ps *ProgressStatus) Start()

Start is ignored for quietstatus

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 PrometheusConfig

type PrometheusConfig struct {
	ScrapeConfigs []ScrapeConfig `yaml:"scrape_configs,omitempty"`
}

PrometheusConfig - container to hold the top level scrape config.

func (PrometheusConfig) JSON

func (c PrometheusConfig) JSON() string

JSON jsonified prometheus config.

func (PrometheusConfig) String

func (c PrometheusConfig) String() string

String colorized prometheus config yaml.

type PutOptions

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

PutOptions holds options for PUT operation

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) AddCounts

func (qs *QuietStatus) AddCounts(v int64)

AddCounts adds 'v' number of files uploaded.

func (*QuietStatus) Finish

func (qs *QuietStatus) Finish()

Finish displays the accounting summary

func (*QuietStatus) Get

func (qs *QuietStatus) Get() int64

Get returns the current number of bytes

func (*QuietStatus) GetCounts

func (qs *QuietStatus) GetCounts() int64

GetCounts returns number of files uploaded

func (*QuietStatus) PrintMsg

func (qs *QuietStatus) PrintMsg(msg message)

PrintMsg prints message

func (*QuietStatus) Println

func (qs *QuietStatus) Println(_ ...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(_ string)

SetCaption sets the caption of the progressbar, ignored for quietstatus

func (*QuietStatus) SetCounts

func (qs *QuietStatus) SetCounts(v int64)

SetCounts sets number of files uploaded

func (*QuietStatus) SetTotal

func (qs *QuietStatus) SetTotal(v int64) Status

SetTotal sets the total of the progressbar, ignored for quietstatus

func (*QuietStatus) Start

func (qs *QuietStatus) Start()

Start is 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

func (*QuietStatus) Update

func (qs *QuietStatus) Update()

Update is ignored for quietstatus

type RemoveResult

type RemoveResult struct {
	minio.RemoveObjectResult
	BucketName string
	Err        *probe.Error
}

RemoveResult returns the error or result of the removed objects.

type Row

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

Row specifies row description and theme

type S3Client

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

S3Client construct

func (*S3Client) AddNotificationConfig

func (c *S3Client) AddNotificationConfig(ctx context.Context, arn string, events []string, prefix, suffix string, ignoreExisting bool) *probe.Error

AddNotificationConfig - Add bucket notification

func (*S3Client) AddUserAgent

func (c *S3Client) AddUserAgent(app, version string)

AddUserAgent - add custom user agent.

func (*S3Client) Copy

func (c *S3Client) Copy(ctx context.Context, source string, opts CopyOptions, progress io.Reader) *probe.Error

Copy - copy object, uses server side copy API. Also uses an abstracted API such that large file sizes will be copied in multipart manner on server side.

func (*S3Client) DeleteBucketCors

func (c *S3Client) DeleteBucketCors(ctx context.Context) *probe.Error

DeleteBucketCors - Delete bucket cors configuration.

func (*S3Client) DeleteEncryption

func (c *S3Client) DeleteEncryption(ctx context.Context) *probe.Error

DeleteEncryption - removes encryption configuration on a bucket

func (*S3Client) DeleteTags

func (c *S3Client) DeleteTags(ctx context.Context, versionID string) *probe.Error

DeleteTags - Delete tags of bucket or object

func (*S3Client) Get

Get - get object with GET options.

func (*S3Client) GetAccess

func (c *S3Client) GetAccess(ctx context.Context) (string, string, *probe.Error)

GetAccess get access policy permissions.

func (*S3Client) GetAccessRules

func (c *S3Client) GetAccessRules(ctx context.Context) (map[string]string, *probe.Error)

GetAccessRules - get configured policies from the server

func (*S3Client) GetBucketCors

func (c *S3Client) GetBucketCors(ctx context.Context) (*cors.Config, *probe.Error)

GetBucketCors - Get bucket cors configuration.

func (*S3Client) GetBucketInfo

func (c *S3Client) GetBucketInfo(ctx context.Context) (BucketInfo, *probe.Error)

GetBucketInfo gets info about a bucket

func (*S3Client) GetEncryption

func (c *S3Client) GetEncryption(ctx context.Context) (algorithm, keyID string, err *probe.Error)

GetEncryption - gets bucket encryption info.

func (*S3Client) GetLifecycle

func (c *S3Client) GetLifecycle(ctx context.Context) (*lifecycle.Configuration, time.Time, *probe.Error)

GetLifecycle - Get current lifecycle configuration.

func (*S3Client) GetObjectLegalHold

func (c *S3Client) GetObjectLegalHold(ctx context.Context, versionID string) (minio.LegalHoldStatus, *probe.Error)

GetObjectLegalHold - Get object legal hold for a given object.

func (*S3Client) GetObjectLockConfig

func (c *S3Client) GetObjectLockConfig(ctx context.Context) (string, minio.RetentionMode, uint64, minio.ValidityUnit, *probe.Error)

GetObjectLockConfig - Get object lock configuration of bucket.

func (*S3Client) GetObjectRetention

func (c *S3Client) GetObjectRetention(ctx context.Context, versionID string) (minio.RetentionMode, time.Time, *probe.Error)

GetObjectRetention - Get object retention for a given object.

func (*S3Client) GetPart

func (c *S3Client) GetPart(ctx context.Context, part int) (io.ReadCloser, *probe.Error)

GetPart gets an object in a given number of parts

func (*S3Client) GetReplication

func (c *S3Client) GetReplication(ctx context.Context) (replication.Config, *probe.Error)

GetReplication - gets replication configuration for a given bucket.

func (*S3Client) GetReplicationMetrics

func (c *S3Client) GetReplicationMetrics(ctx context.Context) (replication.MetricsV2, *probe.Error)

GetReplicationMetrics - Get replication metrics for a given bucket.

func (*S3Client) GetTags

func (c *S3Client) GetTags(ctx context.Context, versionID string) (map[string]string, *probe.Error)

GetTags - Get tags of bucket or object.

func (*S3Client) GetURL

func (c *S3Client) GetURL() ClientURL

GetURL get url.

func (*S3Client) GetVersion

func (c *S3Client) GetVersion(ctx context.Context) (config minio.BucketVersioningConfiguration, err *probe.Error)

GetVersion - gets bucket version info.

func (*S3Client) List

func (c *S3Client) List(ctx context.Context, opts ListOptions) <-chan *ClientContent

List - list at delimited path, if not recursive.

func (*S3Client) ListBuckets

func (c *S3Client) ListBuckets(ctx context.Context) ([]*ClientContent, *probe.Error)

ListBuckets - list buckets

func (*S3Client) ListNotificationConfigs

func (c *S3Client) ListNotificationConfigs(ctx context.Context, arn string) ([]NotificationConfig, *probe.Error)

ListNotificationConfigs - List notification configs

func (*S3Client) MakeBucket

func (c *S3Client) MakeBucket(ctx context.Context, region string, ignoreExisting, withLock bool) *probe.Error

MakeBucket - make a new bucket.

func (*S3Client) Put

func (c *S3Client) Put(ctx context.Context, reader io.Reader, size int64, progress io.Reader, putOpts PutOptions) (int64, *probe.Error)

Put - upload an object with custom metadata.

func (*S3Client) PutObjectLegalHold

func (c *S3Client) PutObjectLegalHold(ctx context.Context, versionID string, lhold minio.LegalHoldStatus) *probe.Error

PutObjectLegalHold - Set object legal hold for a given object.

func (*S3Client) PutObjectRetention

func (c *S3Client) PutObjectRetention(ctx context.Context, versionID string, mode minio.RetentionMode, retainUntilDate time.Time, bypassGovernance bool) *probe.Error

PutObjectRetention - Set object retention for a given object.

func (*S3Client) PutPart

func (c *S3Client) PutPart(ctx context.Context, reader io.Reader, size int64, progress io.Reader, putOpts PutOptions) (int64, *probe.Error)

PutPart - upload an object with custom metadata. (Same as Put)

func (*S3Client) Remove

func (c *S3Client) Remove(ctx context.Context, isIncomplete, isRemoveBucket, isBypass, isForceDel bool, contentCh <-chan *ClientContent) <-chan RemoveResult

Remove - remove object or bucket(s).

func (*S3Client) RemoveBucket

func (c *S3Client) RemoveBucket(ctx context.Context, forceRemove bool) *probe.Error

RemoveBucket removes a bucket, forcibly if asked

func (*S3Client) RemoveNotificationConfig

func (c *S3Client) RemoveNotificationConfig(ctx context.Context, arn, event, prefix, suffix string) *probe.Error

RemoveNotificationConfig - Remove bucket notification

func (*S3Client) RemoveReplication

func (c *S3Client) RemoveReplication(ctx context.Context) *probe.Error

RemoveReplication - removes replication configuration for a given bucket.

func (*S3Client) ReplicationResyncStatus

func (c *S3Client) ReplicationResyncStatus(ctx context.Context, arn string) (rinfo replication.ResyncTargetsInfo, err *probe.Error)

ReplicationResyncStatus - gets status of replication resync for this target arn

func (*S3Client) ResetReplication

func (c *S3Client) ResetReplication(ctx context.Context, before time.Duration, tgtArn string) (rinfo replication.ResyncTargetsInfo, err *probe.Error)

ResetReplication - kicks off replication again on previously replicated objects if existing object replication is enabled in the replication config.Optional to provide a timestamp

func (*S3Client) Restore

func (c *S3Client) Restore(ctx context.Context, versionID string, days int) *probe.Error

Restore gets a copy of an archived object

func (*S3Client) Select

func (c *S3Client) Select(ctx context.Context, expression string, sse encrypt.ServerSide, selOpts SelectObjectOpts) (io.ReadCloser, *probe.Error)

Select - select object content wrapper.

func (*S3Client) SetAccess

func (c *S3Client) SetAccess(ctx context.Context, bucketPolicy string, isJSON bool) *probe.Error

SetAccess set access policy permissions.

func (*S3Client) SetBucketCors

func (c *S3Client) SetBucketCors(ctx context.Context, corsXML []byte) *probe.Error

SetBucketCors - Set bucket cors configuration.

func (*S3Client) SetEncryption

func (c *S3Client) SetEncryption(ctx context.Context, encType, kmsKeyID string) *probe.Error

SetEncryption - Set encryption configuration on a bucket

func (*S3Client) SetLifecycle

func (c *S3Client) SetLifecycle(ctx context.Context, config *lifecycle.Configuration) *probe.Error

SetLifecycle - Set lifecycle configuration on a bucket

func (*S3Client) SetObjectLockConfig

func (c *S3Client) SetObjectLockConfig(ctx context.Context, mode minio.RetentionMode, validity uint64, unit minio.ValidityUnit) *probe.Error

SetObjectLockConfig - Set object lock configurataion of bucket.

func (*S3Client) SetReplication

func (c *S3Client) SetReplication(ctx context.Context, cfg *replication.Config, opts replication.Options) *probe.Error

SetReplication sets replication configuration for a given bucket.

func (*S3Client) SetTags

func (c *S3Client) SetTags(ctx context.Context, versionID, tagString string) *probe.Error

SetTags - Set tags of bucket or object.

func (*S3Client) SetVersion

func (c *S3Client) SetVersion(ctx context.Context, status string, prefixes []string, excludeFolders bool) *probe.Error

SetVersion - Set version configuration on a bucket

func (*S3Client) ShareDownload

func (c *S3Client) ShareDownload(ctx context.Context, versionID string, expires time.Duration) (string, *probe.Error)

ShareDownload - get a usable presigned object url to share.

func (*S3Client) ShareUpload

func (c *S3Client) ShareUpload(ctx context.Context, isRecursive bool, expires time.Duration, contentType string) (string, map[string]string, *probe.Error)

ShareUpload - get data for presigned post http form upload.

func (*S3Client) Stat

func (c *S3Client) Stat(ctx context.Context, opts StatOptions) (*ClientContent, *probe.Error)

Stat - send a 'HEAD' on a bucket or object to fetch its metadata. It also returns a DIR type content if a prefix does exist in the server.

func (*S3Client) Watch

func (c *S3Client) Watch(ctx context.Context, options WatchOptions) (*WatchObject, *probe.Error)

Watch - Start watching on all bucket events for a given account ID.

type SameFile

type SameFile struct {
	Source, Destination string
}

SameFile - source and destination are same files.

func (SameFile) Error

func (e SameFile) Error() string

type SchemaVersion

type SchemaVersion struct {
	Version string `json:"version"`
}

SchemaVersion - version of the health report schema

type ScrapeConfig

type ScrapeConfig struct {
	JobName       string       `yaml:"job_name" json:"jobName"`
	BearerToken   string       `yaml:"bearer_token,omitempty" json:"bearerToken,omitempty"`
	MetricsPath   string       `yaml:"metrics_path,omitempty" json:"metricsPath"`
	Scheme        string       `yaml:"scheme,omitempty" json:"scheme"`
	StaticConfigs []StatConfig `yaml:"static_configs,omitempty" json:"staticConfigs"`
}

ScrapeConfig configures a scraping unit for Prometheus.

type SelectObjectOpts

type SelectObjectOpts struct {
	InputSerOpts    map[string]map[string]string
	OutputSerOpts   map[string]map[string]string
	CompressionType minio.SelectCompressionType
}

SelectObjectOpts - opts entered for select API

type SiteNetStats

type SiteNetStats struct {
	TX              uint64        `json:"tx"` // transfer rate in bytes
	TXTotalDuration time.Duration `json:"txTotalDuration"`
	RX              uint64        `json:"rx"` // received rate in bytes
	RXTotalDuration time.Duration `json:"rxTotalDuration"`
	TotalConn       uint64        `json:"totalConn"`
}

SiteNetStats - status for siteNet

type SiteReplicationTestNodeResult

type SiteReplicationTestNodeResult struct {
	Endpoint string       `json:"endpoint"`
	Perf     SiteNetStats `json:"perf"`
	Error    string       `json:"error,omitempty"`
}

SiteReplicationTestNodeResult - result of the network performance test for site-replication

type SiteReplicationTestResults

type SiteReplicationTestResults struct {
	Results []SiteReplicationTestNodeResult `json:"servers"`
}

SiteReplicationTestResults - result of the network performance test across all site-replication

type StatConfig

type StatConfig struct {
	Targets []string `yaml:",flow" json:"targets"`
}

StatConfig - container to hold the targets config.

func (StatConfig) JSON

func (t StatConfig) JSON() string

JSON jsonified stat config.

func (StatConfig) String

func (t StatConfig) String() string

String colorized stat config yaml.

type StatOptions

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

StatOptions holds options of the HEAD operation

type Status

type Status interface {
	Println(data ...interface{})
	AddCounts(int64)
	SetCounts(int64)
	GetCounts() int64
	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 NewProgressStatus

func NewProgressStatus(hook io.Reader) Status

NewProgressStatus returns a progress status object

func NewQuietStatus

func NewQuietStatus(hook io.Reader) Status

NewQuietStatus returns a quiet status object

type SubnetFileUploader

type SubnetFileUploader struct {
	FilePath          string        // file to upload
	ReqURL            string        // SUBNET upload URL
	Params            url.Values    // query params to be sent in the request
	Headers           SubnetHeaders // headers to be sent in the request
	AutoCompress      bool          // whether to compress (zst) the file before uploading
	DeleteAfterUpload bool          // whether to delete the file after successful upload
	// contains filtered or unexported fields
}

SubnetFileUploader - struct to upload files to SUBNET

func (*SubnetFileUploader) UploadFileToSubnet

func (i *SubnetFileUploader) UploadFileToSubnet() (string, error)

UploadFileToSubnet - uploads the file to SUBNET

type SubnetHeaders

type SubnetHeaders map[string]string

SubnetHeaders - type for SUBNET request headers

func SubnetAPIKeyAuthHeaders

func SubnetAPIKeyAuthHeaders(apiKey string) SubnetHeaders

SubnetAPIKeyAuthHeaders - returns the headers for SUBNET API key authentication

type SubnetLoginReq

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

SubnetLoginReq - JSON payload of the SUBNET login api

type SubnetMFAReq

type SubnetMFAReq struct {
	Username string `json:"username"`
	OTP      string `json:"otp"`
	Token    string `json:"token"`
}

SubnetMFAReq - JSON payload of the SUBNET mfa api

type SwInfoV1

type SwInfoV1 struct {
	Minio  MinioHealthInfoV1     `json:"minio,omitempty"`
	OsInfo []madmin.ServerOsInfo `json:"osinfos,omitempty"`
}

SwInfoV1 - software health Info

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
	MD5              bool
	DisableMultipart bool

	Error     *probe.Error `json:"-"`
	ErrorCond differType   `json:"-"`
	// contains filtered or unexported fields
}

URLs contains source and target urls

func (URLs) Equal

func (m URLs) Equal(n URLs) bool

Equal tests if both urls are equal

func (URLs) WithError

func (m URLs) WithError(err *probe.Error) URLs

WithError sets the error and returns object

type UnexpectedEOF

type UnexpectedEOF struct {
	TotalSize    int64
	TotalWritten int64
}

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

type UnexpectedShortWrite struct {
	InputSize int
	WriteSize int
}

UnexpectedShortWrite - write wrote less bytes than expected.

func (UnexpectedShortWrite) Error

func (e UnexpectedShortWrite) Error() string

type WatchObject

type WatchObject struct {
	// eventInfo will be put on this chan
	EventInfoChan chan []EventInfo
	// errors will be put on this chan
	ErrorChan chan *probe.Error
	// will stop the watcher goroutines
	DoneChan chan struct{}
}

WatchObject captures watch channels to read and listen on.

func (*WatchObject) Errors

func (w *WatchObject) Errors() chan *probe.Error

Errors returns the chan receiving errors

func (*WatchObject) Events

func (w *WatchObject) Events() chan []EventInfo

Events returns the chan receiving events

type WatchOptions

type WatchOptions struct {
	Prefix    string
	Suffix    string
	Events    []string
	Recursive bool
}

WatchOptions contains watch configuration options

type Watcher

type Watcher struct {

	// all error will be added to this chan
	ErrorChan chan *probe.Error
	// all events will be added to this chan
	EventInfoChan chan []EventInfo
	// contains filtered or unexported fields
}

Watcher can be used to have one or multiple clients watch for notifications

func NewWatcher

func NewWatcher(sessionStartTime time.Time) *Watcher

NewWatcher creates a new watcher

func (*Watcher) Errors

func (w *Watcher) Errors() chan *probe.Error

Errors returns a channel which will receive errors

func (*Watcher) Events

func (w *Watcher) Events() chan []EventInfo

Events returns a channel which will receive events

func (*Watcher) Join

func (w *Watcher) Join(ctx context.Context, client Client, recursive bool) *probe.Error

Join the watcher with client

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop all watchers

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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