server

package
v1.77.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is an error class S3 Gateway http server error.
	Error = errs.Class("gateway")
)

Functions

This section is empty.

Types

type AddrConfig

type AddrConfig struct {
	Address         string `help:"Address to serve gateway on" default:":20010"`
	AddressTLS      string `help:"Address to securely serve (TLS) gateway on" default:":20011"`
	ProxyAddressTLS string `help:"Secure (TLS) gateway address for PROXY protocol requests" default:":20012"`
}

AddrConfig honestly only exists to preserve legacy CLI parameter naming.

type ClientConfig

type ClientConfig struct {
	DialTimeout       time.Duration `help:"timeout for dials" default:"10s"`
	MaximumBufferSize memory.Size   `help:"maximum buffer size for DRPC streams" default:"304kB"`

	Upload uploadConfig
}

ClientConfig is a configuration struct for the uplink that controls how to talk to the rest of the network.

MaximumBufferSize has a default of 304 kB, as this seems to be around the maximum buffer size drpcstream.(*Stream).MsgSend allocates when it's used from libuplink from Gateway-MT (see https://pprof.host/0w/). Deployments struggling with memory consumption problems should decrease the default.

type Config

type Config struct {
	Server               AddrConfig
	CertDir              string        `help:"directory path to search for TLS certificates" default:"$CONFDIR/certs"`
	InsecureDisableTLS   bool          `help:"listen using insecure connections" releaseDefault:"false" devDefault:"true"`
	DomainName           string        `help:"comma-separated domain suffixes to serve on" releaseDefault:"" devDefault:"localhost"`
	OptionalDomainName   string        `help:"comma-separated optional domain suffixes to serve on, certificate errors are not fatal"`
	CorsOrigins          string        `` /* 165-byte string literal not displayed */
	EncodeInMemory       bool          `help:"tells libuplink to perform in-memory encoding on file upload" releaseDefault:"true" devDefault:"true"`
	ClientTrustedIPSList []string      `` /* 153-byte string literal not displayed */
	UseClientIPHeaders   bool          `` /* 160-byte string literal not displayed */
	InsecureLogAll       bool          `help:"insecurely log all errors, paths, and headers" default:"false"`
	ConcurrentAllowed    uint          `help:"number of allowed concurrent uploads or downloads per macaroon head" default:"500"` // see S3 CLI's max_concurrent_requests
	ShutdownDelay        time.Duration `help:"time to delay server shutdown while returning 503s on the health endpoint" devDefault:"1s" releaseDefault:"45s"`

	Auth                    authclient.Config
	S3Compatibility         miniogw.S3CompatibilityConfig
	Client                  ClientConfig
	SatelliteConnectionPool SatelliteConnectionPoolConfig
	ConnectionPool          ConnectionPoolConfig
	CertMagic               certMagic
	StartupCheck            startupCheck
}

Config determines how server listens for requests.

type ConnectionPoolConfig

type ConnectionPoolConfig struct {
	Capacity       int           `help:"RPC connection pool capacity (non-satellite connections)" default:"100"`
	KeyCapacity    int           `help:"RPC connection pool limit per key (non-satellite connections)" default:"5"`
	IdleExpiration time.Duration `help:"RPC connection pool idle expiration (non-satellite connections)" default:"2m0s"`
	MaxLifetime    time.Duration `help:"RPC connection pool max lifetime of a connection" default:"10m0s"`
}

ConnectionPoolConfig is a config struct for configuring RPC connection pool options.

type Peer

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

Peer represents an S3 compatible http server.

Note that Peer relies upon Minio global variables, which are protected by a Sync.Once() construct. Once Peer.Run() has been called, new instances of a Peer will not update any configuration used by Minio.

func New

func New(config Config, log *zap.Logger, trustedIPs trustedip.List, corsAllowedOrigins []string,
	authClient *authclient.AuthClient, concurrentAllowed uint) (*Peer, error)

New returns new instance of an S3 compatible http server.

func (*Peer) Address

func (s *Peer) Address() string

Address returns the web address the peer is listening on.

func (*Peer) AddressTLS

func (s *Peer) AddressTLS() string

AddressTLS returns the TLS web address the peer is listening on.

func (*Peer) Close

func (s *Peer) Close() error

Close shuts down the server and all underlying resources.

func (*Peer) Run

func (s *Peer) Run(ctx context.Context) (err error)

Run starts the S3 compatible http server.

type SatelliteConnectionPoolConfig

type SatelliteConnectionPoolConfig struct {
	Capacity       int           `help:"RPC connection pool capacity (satellite connections)" default:"200"`
	KeyCapacity    int           `help:"RPC connection pool limit per key (satellite connections)" default:"0"`
	IdleExpiration time.Duration `help:"RPC connection pool idle expiration (satellite connections)" default:"10m0s"`
	MaxLifetime    time.Duration `help:"RPC connection pool max lifetime of a connection" default:"10m0s"`
}

SatelliteConnectionPoolConfig is a config struct for configuring RPC connection pool of Satellite connections.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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