controller

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigPath added in v0.2.0

func DefaultConfigPath() (string, error)

Types

type AddHeadersMiddleware

type AddHeadersMiddleware struct {
	Headers map[string]string
}

func (*AddHeadersMiddleware) ID

func (m *AddHeadersMiddleware) ID() string

type AddParamsMiddleware

type AddParamsMiddleware struct {
	Params map[string]string
}

func (*AddParamsMiddleware) ID

func (m *AddParamsMiddleware) ID() string

type BucketCleanupConfig

type BucketCleanupConfig struct {
	Bucket           string
	Concurrency      int
	Force            bool
	DryRun           bool
	Multiparts       bool
	ObjectVersion    bool
	BypassGovernance bool
}

type Config

type Config struct {
	Profiles map[string]Profile `toml:"profiles"`
}

func LoadConfig

func LoadConfig(configPath string) (Config, error)

type Controller

type Controller struct {
	OutWriter io.Writer
	ErrWriter io.Writer
	// contains filtered or unexported fields
}

func New

func (*Controller) BucketCORSDelete

func (c *Controller) BucketCORSDelete(bucket string) error

func (*Controller) BucketCORSGet

func (c *Controller) BucketCORSGet(bucket string) error

func (*Controller) BucketCORSPut

func (c *Controller) BucketCORSPut(corsPath, bucket string) error

func (*Controller) BucketCleanup

func (c *Controller) BucketCleanup(cfg BucketCleanupConfig) error

func (*Controller) BucketCreate

func (c *Controller) BucketCreate(bucket string, objectLock bool) error

func (*Controller) BucketDelete

func (c *Controller) BucketDelete(bucket string, flagForce bool) error

func (*Controller) BucketHead

func (c *Controller) BucketHead(bucket string) error

func (*Controller) BucketLifecycleDelete

func (c *Controller) BucketLifecycleDelete(bucket string) error

func (*Controller) BucketLifecycleGet

func (c *Controller) BucketLifecycleGet(bucket string) error

func (*Controller) BucketLifecyclePut

func (c *Controller) BucketLifecyclePut(lifecyclePath, bucket string) error

func (*Controller) BucketList

func (c *Controller) BucketList(prefix string) error

TODO: prefix doesn't seem to work

func (*Controller) BucketMultipartUploadAbort

func (c *Controller) BucketMultipartUploadAbort(bucket, key, uploadID string) error

func (*Controller) BucketMultipartUploadAbortAll

func (c *Controller) BucketMultipartUploadAbortAll(bucket string, dryRun bool, concurrency int) error

func (*Controller) BucketMultipartUploadCreate

func (c *Controller) BucketMultipartUploadCreate(bucket, key string) error

func (*Controller) BucketMultipartUploadsList

func (c *Controller) BucketMultipartUploadsList(bucket, prefix, originalPrefix string, recursive, asJson bool) error

func (*Controller) BucketObjectLockGet

func (c *Controller) BucketObjectLockGet(bucket string) error

func (*Controller) BucketObjectLockPut

func (c *Controller) BucketObjectLockPut(lockConfigPath, bucket string) error

func (*Controller) BucketPartsList

func (c *Controller) BucketPartsList(bucket, key, uploadID string, asJson bool) error

func (*Controller) BucketPolicyDelete

func (c *Controller) BucketPolicyDelete(bucket string) error

func (*Controller) BucketPolicyGet

func (c *Controller) BucketPolicyGet(bucket string) error

func (*Controller) BucketPolicyPut

func (c *Controller) BucketPolicyPut(policyPath, bucket string) error

func (*Controller) BucketSize

func (c *Controller) BucketSize(bucket, prefix string) error

func (*Controller) BucketTagging

func (c *Controller) BucketTagging(bucket string) error

func (*Controller) BucketVersioningGet

func (c *Controller) BucketVersioningGet(bucket string) error

func (*Controller) BucketVersioningPut

func (c *Controller) BucketVersioningPut(versioningConfigPath, bucket string) error

func (*Controller) ObjectACLGet

func (c *Controller) ObjectACLGet(bucket, key, version string) error

func (*Controller) ObjectCopy

func (c *Controller) ObjectCopy(cfg ObjectCopyConfig) error

func (*Controller) ObjectDelete

func (c *Controller) ObjectDelete(prefix string, cfg ObjectDeleteConfig) error

TODO: - allow deleting all versions of a specific object or of a specific prefix?

func (*Controller) ObjectGet

func (c *Controller) ObjectGet(dest, prefix, originalPrefix string, cfg ObjectGetConfig) error

func (*Controller) ObjectHead

func (c *Controller) ObjectHead(bucket, key string, cfg ObjectHeadConfig) error

func (*Controller) ObjectList

func (c *Controller) ObjectList(bucket, prefix, originalPrefix string, recursive, asJson bool) error

func (*Controller) ObjectPresignGet

func (c *Controller) ObjectPresignGet(objectKey string, cfg ObjectGetConfig, expiration time.Duration) error

func (*Controller) ObjectPresignPut

func (c *Controller) ObjectPresignPut(expiration time.Duration, key string, cfg ObjectPutConfig) error

func (*Controller) ObjectPut

func (c *Controller) ObjectPut(filePath, dest string, cfg ObjectPutConfig) error

func (*Controller) ObjectPutRand

func (c *Controller) ObjectPutRand(dest string, size, count uint64, cfg ObjectPutConfig) error

func (*Controller) ObjectVersions

func (c *Controller) ObjectVersions(bucket, prefix, originalPrefix string, recursive, asJson bool) error

type ControllerConfig

type ControllerConfig struct {
	OutWriter io.Writer
	ErrWriter io.Writer
	Profile   Profile
	Verbosity uint8
	Headers   map[string]string
	Params    map[string]string
	DryRun    bool
	BuildInfo util.BuildInfo
}

type ObjectCopyConfig

type ObjectCopyConfig struct {
	SrcBucket string
	SrcKey    string
	DstBucket string
	DstKey    string
	SSEC      util.SSEC
}

type ObjectDeleteConfig

type ObjectDeleteConfig struct {
	Bucket           string
	Force            bool
	Concurrency      int
	DryRun           bool
	BypassGovernance bool
	VersionID        string
}

type ObjectGetConfig

type ObjectGetConfig struct {
	Bucket            string
	SSEC              util.SSEC
	VersionID         string
	IfMatch           string
	IfModifiedSince   time.Time
	IfNoneMatch       string
	IfUnmodifiedSince time.Time
	Range             string
	PartNumber        int32
	Concurrency       int
	PartSize          int64
	DryRun            bool
}

type ObjectHeadConfig

type ObjectHeadConfig struct {
	SSEC util.SSEC
}

type ObjectPutConfig

type ObjectPutConfig struct {
	Bucket            string
	SSEC              util.SSEC
	Concurrency       int
	LeavePartsOnError bool
	MaxUploadParts    int32
	PartSize          int64
	ACL               string
	DryRun            bool
	Expires           time.Time
}

type Profile

type Profile struct {
	Endpoint  string `toml:"endpoint"`
	Region    string `toml:"region"`
	AccessKey string `toml:"access_key"`
	SecretKey string `toml:"secret_key"`
	PathStyle bool   `toml:"path_style"`
	Insecure  bool   `toml:"insecure"`
	ReadOnly  bool   `toml:"read_only"`
	SNI       string `toml:"sni"`
	Network   string `toml:"network"`
	Bandwidth string `toml:"bandwidth"`
}

type TransportWrapper

type TransportWrapper struct {
	Base     http.RoundTripper
	ReadOnly bool
	Limiter  *rate.Limiter
}

func (*TransportWrapper) RoundTrip

func (t *TransportWrapper) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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