api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvAPIRequestsMax              = "MINIO_API_REQUESTS_MAX"
	EnvAPIRequestsDeadline         = "MINIO_API_REQUESTS_DEADLINE"
	EnvAPIClusterDeadline          = "MINIO_API_CLUSTER_DEADLINE"
	EnvAPICorsAllowOrigin          = "MINIO_API_CORS_ALLOW_ORIGIN"
	EnvAPIRemoteTransportDeadline  = "MINIO_API_REMOTE_TRANSPORT_DEADLINE"
	EnvAPIListQuorum               = "MINIO_API_LIST_QUORUM"
	EnvAPIExtendListCacheLife      = "MINIO_API_EXTEND_LIST_CACHE_LIFE"
	EnvAPISecureCiphers            = "MINIO_API_SECURE_CIPHERS"
	EnvAPIReplicationWorkers       = "MINIO_API_REPLICATION_WORKERS"
	EnvAPIReplicationFailedWorkers = "MINIO_API_REPLICATION_FAILED_WORKERS"
)

API sub-system constants

View Source
const (
	EnvAPIReadyDeadline = "MINIO_API_READY_DEADLINE"
)

Deprecated key and ENVs

Variables

View Source
var (
	DefaultKVS = config.KVS{
		config.KV{
			Key:   apiRequestsMax,
			Value: "0",
		},
		config.KV{
			Key:   apiRequestsDeadline,
			Value: "10s",
		},
		config.KV{
			Key:   apiClusterDeadline,
			Value: "10s",
		},
		config.KV{
			Key:   apiCorsAllowOrigin,
			Value: "*",
		},
		config.KV{
			Key:   apiRemoteTransportDeadline,
			Value: "2h",
		},
		config.KV{
			Key:   apiListQuorum,
			Value: "optimal",
		},
		config.KV{
			Key:   apiExtendListCacheLife,
			Value: "0s",
		},
		config.KV{
			Key:   apiReplicationWorkers,
			Value: "250",
		},
		config.KV{
			Key:   apiReplicationFailedWorkers,
			Value: "8",
		},
	}
)

DefaultKVS - default storage class config

View Source
var (
	Help = config.HelpKVS{
		config.HelpKV{
			Key:         apiRequestsMax,
			Description: `set the maximum number of concurrent requests, e.g. "1600"`,
			Optional:    true,
			Type:        "number",
		},
		config.HelpKV{
			Key:         apiRequestsDeadline,
			Description: `set the deadline for API requests waiting to be processed e.g. "1m"`,
			Optional:    true,
			Type:        "duration",
		},
		config.HelpKV{
			Key:         apiCorsAllowOrigin,
			Description: `set comma separated list of origins allowed for CORS requests e.g. "https://example1.com,https://example2.com"`,
			Optional:    true,
			Type:        "csv",
		},
		config.HelpKV{
			Key:         apiRemoteTransportDeadline,
			Description: `set the deadline for API requests on remote transports while proxying between federated instances e.g. "2h"`,
			Optional:    true,
			Type:        "duration",
		},
		config.HelpKV{
			Key:         apiReplicationWorkers,
			Description: `set the number of replication workers, defaults to 100`,
			Optional:    true,
			Type:        "number",
		},
		config.HelpKV{
			Key:         apiReplicationFailedWorkers,
			Description: `set the number of replication workers for recently failed replicas, defaults to 4`,
			Optional:    true,
			Type:        "number",
		},
	}
)

Help template for storageclass feature.

Functions

This section is empty.

Types

type Config

type Config struct {
	RequestsMax              int           `json:"requests_max"`
	RequestsDeadline         time.Duration `json:"requests_deadline"`
	ClusterDeadline          time.Duration `json:"cluster_deadline"`
	CorsAllowOrigin          []string      `json:"cors_allow_origin"`
	RemoteTransportDeadline  time.Duration `json:"remote_transport_deadline"`
	ListQuorum               string        `json:"list_quorum"`
	ExtendListLife           time.Duration `json:"extend_list_cache_life"`
	ReplicationWorkers       int           `json:"replication_workers"`
	ReplicationFailedWorkers int           `json:"replication_failed_workers"`
}

Config storage class configuration

func LookupConfig

func LookupConfig(kvs config.KVS) (cfg Config, err error)

LookupConfig - lookup api config and override with valid environment settings if any.

func (Config) GetListQuorum

func (sCfg Config) GetListQuorum() int

GetListQuorum interprets list quorum values and returns appropriate acceptable quorum expected for list operations

func (*Config) UnmarshalJSON

func (sCfg *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON - Validate SS and RRS parity when unmarshalling JSON.

Jump to

Keyboard shortcuts

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