Documentation
¶
Index ¶
- Constants
- Variables
- func AnyError(callback func(error), functions ...func() error)
- func Bool(bool bool) *bool
- func BuildPath(resourcePath string, values interface{}) (string, error)
- func BuildPathSpecTest(t *testing.T, mutex *sync.Mutex, tt PathSpecTest, sourceFs ReadWriteFs, ...)
- func ChangeDir(fs ReadWriteFs, relativePath string, fullPath string, mutex *sync.Mutex) (func(), bool, error)
- func CheckRequired(iStruct interface{}) error
- func CloneHTTPClientWithExactMaxConnsPerHost(client *http.Client, maxConnsPerHost int) (*http.Client, bool)
- func CloneHTTPClientWithMaxConnsPerHost(client *http.Client, maxConnsPerHost int) (*http.Client, bool)
- func CloseBody(res *http.Response)
- func CopyAt(dst io.WriterAt, writeOff int64, src io.Reader) (written int64, err error)
- func CreateError(i interface{}, name string) error
- func DecimalOverrideValues(v any, overrides ...DecimalOverride) (url.Values, error)
- func DefaultRetryableHttp(logger Logger, client ...*http.Client) *retryablehttp.Client
- func DefaultString(a, b string) string
- func ExpandTilde(path string) string
- func GetConnectionStatsFromClient(client *http.Client) (map[string]int, bool)
- func Int64(i int64) *int64
- func IsDecimalText(text string) bool
- func IsHTML(res *http.Response) bool
- func IsJSON(res *http.Response) bool
- func IsNonOkStatus(res *http.Response) bool
- func IsOkStatus(res *http.Response) bool
- func IsStatus(status int) func(res *http.Response) error
- func IsXML(res *http.Response) bool
- func JSONEmptyValue(v reflect.Type) string
- func MarshalDecimalOverrides(v any, overrides ...DecimalOverride) ([]byte, error)
- func NewReader(ctx context.Context, r io.ReadCloser) io.ReadCloser
- func NewReaderAt(ctx context.Context, r io.ReaderAt) io.ReaderAt
- func NonJSONError(res *http.Response) error
- func NonOkError(res *http.Response) error
- func NonOkErrorCustom(callbacks ...func(error) error) func(res *http.Response) error
- func NormalizeAPIPath(parts ...string) string
- func NormalizeForComparison(path string) string
- func NotStatus(status int) func(res *http.Response) error
- func PathEscape(path string) (string, error)
- func Ptr[T any](t T) *T
- func ResponseErrors(res *http.Response, errorFunc ...func(res *http.Response) error) error
- func S3ErrorIsRequestHasExpired(err error) bool
- func S3ErrorIsRequestTimeout(err error) booldeprecated
- func S3XMLError(res *http.Response) error
- func String(string string) *string
- func Time(t time.Time) *time.Time
- func UnWrapBool(b *bool) bool
- func UnderscoreDestinationPath(root string, id int64, relativePath string) string
- func UploadRetryableHttp(base *retryablehttp.Client, canReplay func() bool) *retryablehttp.Client
- func UploadRetryableHttpWithObserver(base *retryablehttp.Client, canReplay func() bool, ...) *retryablehttp.Client
- func UrlJoinNoEscape(paths ...string) string
- func UrlLastSegment(path string) (rest string, lastSegment string)
- type AdaptiveConcurrencyConfig
- type AdaptiveConcurrencyDefaults
- type AdaptiveConcurrencyManager
- func NewAdaptiveConcurrencyManager(maxConcurrency int) *AdaptiveConcurrencyManager
- func NewAdaptiveConcurrencyManagerWithConfig(config AdaptiveConcurrencyConfig) *AdaptiveConcurrencyManager
- func NewAdaptiveConcurrencyManagerWithDefaults(defaults AdaptiveConcurrencyDefaults) *AdaptiveConcurrencyManager
- func NewAdaptiveConcurrencyManagerWithInitial(maxConcurrency int, initialTarget int) *AdaptiveConcurrencyManager
- func (a *AdaptiveConcurrencyManager) Done()
- func (a *AdaptiveConcurrencyManager) DoneNeutral()
- func (a *AdaptiveConcurrencyManager) DoneWithSample(sample AdaptiveConcurrencySample)
- func (a *AdaptiveConcurrencyManager) Max() int
- func (a *AdaptiveConcurrencyManager) NewSubWorker() ConcurrencyManager
- func (a *AdaptiveConcurrencyManager) RunningCount() int
- func (a *AdaptiveConcurrencyManager) Snapshot() AdaptiveConcurrencySnapshot
- func (a *AdaptiveConcurrencyManager) Target() int
- func (a *AdaptiveConcurrencyManager) Wait()
- func (a *AdaptiveConcurrencyManager) WaitAllDone()
- func (a *AdaptiveConcurrencyManager) WaitForADone() bool
- func (a *AdaptiveConcurrencyManager) WaitForADoneWithContext(ctx context.Context) bool
- func (a *AdaptiveConcurrencyManager) WaitWithContext(ctx context.Context) bool
- type AdaptiveConcurrencyManagerWithSample
- type AdaptiveConcurrencySample
- type AdaptiveConcurrencySnapshot
- type AdaptiveConcurrencySubWorker
- func (s *AdaptiveConcurrencySubWorker) Done()
- func (s *AdaptiveConcurrencySubWorker) DoneNeutral()
- func (s *AdaptiveConcurrencySubWorker) DoneWithSample(sample AdaptiveConcurrencySample)
- func (s *AdaptiveConcurrencySubWorker) RunningCount() int
- func (s *AdaptiveConcurrencySubWorker) Wait()
- func (s *AdaptiveConcurrencySubWorker) WaitAllDone()
- func (s *AdaptiveConcurrencySubWorker) WaitForADone() bool
- func (s *AdaptiveConcurrencySubWorker) WaitForADoneWithContext(ctx context.Context) bool
- func (s *AdaptiveConcurrencySubWorker) WaitWithContext(ctx context.Context) bool
- type AtomicValue
- type Cmd
- type ConcurrencyManager
- type ConcurrencyManagerWithSubWorker
- type Conn
- type ConstrainedWorkGroup
- func (cw *ConstrainedWorkGroup) Done()
- func (cw *ConstrainedWorkGroup) Max() int
- func (cw *ConstrainedWorkGroup) NewSubWorker() ConcurrencyManager
- func (cw *ConstrainedWorkGroup) RemainingCapacity() int
- func (cw *ConstrainedWorkGroup) RunningCount() int
- func (cw *ConstrainedWorkGroup) Wait()
- func (cw *ConstrainedWorkGroup) WaitAllDone()
- func (cw *ConstrainedWorkGroup) WaitForADone() bool
- func (cw *ConstrainedWorkGroup) WaitForADoneWithContext(ctx context.Context) bool
- func (cw *ConstrainedWorkGroup) WaitWithContext(ctx context.Context) bool
- type DecimalOverride
- type DirEntry
- type ErrorWithOriginalResponse
- type ExeCmd
- type ExportValues
- type FSWithContext
- type FileWithContext
- type IsDir
- type IterChan
- type KeyedMutex
- type LeveledLogger
- type LocalFileSystem
- func (w LocalFileSystem) Chdir(dir string) error
- func (w LocalFileSystem) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (w LocalFileSystem) Create(path string) (io.WriteCloser, error)
- func (w LocalFileSystem) Getwd() (string, error)
- func (w LocalFileSystem) MkdirAll(path string, mode fs.FileMode) error
- func (w LocalFileSystem) MkdirTemp(dir, pattern string) (string, error)
- func (w LocalFileSystem) Open(path string) (fs.File, error)
- func (w LocalFileSystem) PathJoin(paths ...string) string
- func (w LocalFileSystem) PathSeparator() string
- func (w LocalFileSystem) RelPath(parent, child string) (string, error)
- func (w LocalFileSystem) Remove(path string) error
- func (w LocalFileSystem) RemoveAll(path string) error
- func (w LocalFileSystem) SplitPath(path string) (string, string)
- func (w LocalFileSystem) TempDir() string
- type Logger
- type Map
- type Meter
- type MeterItem
- type NullLogger
- type Params
- type Path
- func (p Path) ConvertEmptyToRoot() Path
- func (p Path) EndingSlash() bool
- func (p Path) Join(str ...string) Path
- func (p Path) NormalizePathSystemForAPI() Path
- func (p Path) PathSeparator() string
- func (p Path) Pop() string
- func (p Path) PruneEndingSlash() Path
- func (p Path) PruneStartingSlash() Path
- func (p Path) String() string
- func (p Path) SwitchPathSeparator(separator string) Path
- type PathSpecArgs
- type PathSpecEntry
- type PathSpecTest
- type ProgressWriter
- type Queue
- type ReadWriteFs
- type ReaderAtCloser
- type Resource
- type ResourceOut
- type ResponseError
- type S3Error
- type S3ErrorClassification
- type Signal
- type StatefulDirectory
- type SubWorker
- func (sw *SubWorker) Done()
- func (sw *SubWorker) RunningCount() int
- func (sw *SubWorker) Wait()
- func (sw *SubWorker) WaitAllDone()
- func (sw *SubWorker) WaitForADone() bool
- func (sw *SubWorker) WaitForADoneWithContext(ctx context.Context) bool
- func (sw *SubWorker) WaitWithContext(ctx context.Context) bool
- type Transport
- type UnmarshalJSON
- type UploadRetryAttempt
- type Values
- type Walk
- type WithContextReader
- type WithContextReaderAt
- type WritableFs
- type WriterAndAt
Constants ¶
const ( // AdaptiveConcurrencyDefaultInitialTarget is the default starting target used by NewAdaptiveConcurrencyManager. AdaptiveConcurrencyDefaultInitialTarget = 8 // AdaptiveConcurrencyDefaultMinTarget is the default minimum target for config-based managers. AdaptiveConcurrencyDefaultMinTarget = 2 // AdaptiveConcurrencyDefaultGrowEvery is the default success count between growth steps. AdaptiveConcurrencyDefaultGrowEvery = 8 // AdaptiveConcurrencyDefaultGrowStep is the default normal growth step. AdaptiveConcurrencyDefaultGrowStep = 1 // AdaptiveConcurrencyDefaultFailureShrinkPercent is the default shrink percentage after failure. AdaptiveConcurrencyDefaultFailureShrinkPercent = 50 // AdaptiveConcurrencyDefaultBackPressureShrinkPercent is the default shrink percentage after backpressure. AdaptiveConcurrencyDefaultBackPressureShrinkPercent = 50 // AdaptiveConcurrencyDefaultBackPressurePause is the default pause after backpressure. AdaptiveConcurrencyDefaultBackPressurePause = time.Second )
const (
BasePart = int64(1024 * 1024 * 5)
)
const MinMeterResolution time.Duration = time.Millisecond * 100
MinMeterResolution MinResolution is the minimum time resolution to measure bit rate.
const (
URLPathSeparator = "/"
)
Variables ¶
var DefaultClient *http.Client
var ErrInvalidMeterParameter = errors.New("meter invalid parameter")
ErrInvalidMeterParameter is the error thrown when a parameter is invalid.
var PartSizes = partSizes()
PartSizes return 10k parts that add up to 4.9 TB
Functions ¶
func BuildPathSpecTest ¶
func BuildPathSpecTest(t *testing.T, mutex *sync.Mutex, tt PathSpecTest, sourceFs ReadWriteFs, destinationFs ReadWriteFs, cmdBuilder func(PathSpecArgs) Cmd)
func CheckRequired ¶
func CheckRequired(iStruct interface{}) error
func CloneHTTPClientWithExactMaxConnsPerHost ¶ added in v3.3.126
func CloneHTTPClientWithMaxConnsPerHost ¶ added in v3.3.125
func CreateError ¶
func DecimalOverrideValues ¶ added in v3.3.272
func DecimalOverrideValues(v any, overrides ...DecimalOverride) (url.Values, error)
DecimalOverrideValues encodes v like query.Values, sending each decimal text as the single value for its key.
func DefaultRetryableHttp ¶
func DefaultRetryableHttp(logger Logger, client ...*http.Client) *retryablehttp.Client
func DefaultString ¶
func ExpandTilde ¶
func IsDecimalText ¶ added in v3.3.272
IsDecimalText reports whether text is a finite base-10 number, such as "1.5", "-0.25", ".5", "01.50" or "2e-3". It rejects empty text, spaces, NaN, infinities, hexadecimal, fractions and underscores. It checks syntax only: it sets no range or precision limit, and the API decides which values it accepts.
func IsNonOkStatus ¶
func IsOkStatus ¶
func JSONEmptyValue ¶
func MarshalDecimalOverrides ¶ added in v3.3.272
func MarshalDecimalOverrides(v any, overrides ...DecimalOverride) ([]byte, error)
MarshalDecimalOverrides encodes v, a request struct type without its own MarshalJSON method, as JSON, sending each decimal text as a JSON string. Without decimal text the result is exactly json.Marshal(v).
func NewReader ¶
func NewReader(ctx context.Context, r io.ReadCloser) io.ReadCloser
NewReader gets a context-aware io.Reader.
func NewReaderAt ¶
NewReader gets a context-aware io.Reader.
func NonJSONError ¶
func NonOkError ¶
func NonOkErrorCustom ¶
func NormalizeAPIPath ¶ added in v3.3.180
NormalizeAPIPath applies the Files.com Normalize algorithm to the joined parts: null bytes are removed, backslashes become slashes, and empty, "." and ".." components are dropped without collapsing their neighbors.
func NormalizeForComparison ¶
func PathEscape ¶
func ResponseErrors ¶
func S3ErrorIsRequestHasExpired ¶ added in v3.0.4
func S3ErrorIsRequestTimeout
deprecated
added in
v3.0.4
func S3XMLError ¶
func UnWrapBool ¶
func UnderscoreDestinationPath ¶ added in v3.3.180
func UploadRetryableHttp ¶ added in v3.3.106
func UploadRetryableHttp(base *retryablehttp.Client, canReplay func() bool) *retryablehttp.Client
func UploadRetryableHttpWithObserver ¶ added in v3.3.125
func UploadRetryableHttpWithObserver(base *retryablehttp.Client, canReplay func() bool, observer func(UploadRetryAttempt)) *retryablehttp.Client
func UrlJoinNoEscape ¶
func UrlLastSegment ¶
Types ¶
type AdaptiveConcurrencyConfig ¶ added in v3.3.125
type AdaptiveConcurrencyConfig struct {
MaxConcurrency int
InitialTarget int
MinTarget int
GrowthCeiling int
GrowthCeilingProbeBytes int64
GrowthCeilingProbeSuccesses int
GrowthCeilingProbeRate float64
ThroughputFloor int
GrowEvery int
GrowStep int
SqrtGrowth bool
FailureShrinkPercent int
BackPressureShrinkPercent int
BackPressurePause time.Duration
ThroughputWindow int
ThroughputMinGainPercent int
ThroughputShrinkPercent int
ThroughputHoldWindows int
ThroughputProbeMinWindows int
ThroughputProbeFloor int
ThroughputProbeFloorRate float64
ThroughputProbePlateauTarget int
ThroughputProbeMinGainPerTargetPercent float64
ThroughputProbeLossTolerancePercent int
LatencyFloor int
LatencyShrinkPercent int
LatencyQueueHigh float64
LatencyGrowthQueueHigh float64
}
func DefaultAdaptiveConcurrencyConfig ¶ added in v3.3.171
func DefaultAdaptiveConcurrencyConfig(maxConcurrency int) AdaptiveConcurrencyConfig
DefaultAdaptiveConcurrencyConfig returns the default manager config with the supplied maximum concurrency. Callers can override individual fields before passing it to NewAdaptiveConcurrencyManagerWithConfig.
type AdaptiveConcurrencyDefaults ¶ added in v3.3.171
AdaptiveConcurrencyDefaults contains the primary concurrency settings callers usually need when initializing an adaptive manager.
func DefaultAdaptiveConcurrencyDefaults ¶ added in v3.3.171
func DefaultAdaptiveConcurrencyDefaults(maxConcurrency int) AdaptiveConcurrencyDefaults
DefaultAdaptiveConcurrencyDefaults returns the SDK's default adaptive concurrency settings with the supplied maximum concurrency.
func (AdaptiveConcurrencyDefaults) Config ¶ added in v3.3.171
func (d AdaptiveConcurrencyDefaults) Config() AdaptiveConcurrencyConfig
Config returns a full manager config for these defaults.
type AdaptiveConcurrencyManager ¶ added in v3.3.125
type AdaptiveConcurrencyManager struct {
// contains filtered or unexported fields
}
func NewAdaptiveConcurrencyManager ¶ added in v3.3.125
func NewAdaptiveConcurrencyManager(maxConcurrency int) *AdaptiveConcurrencyManager
func NewAdaptiveConcurrencyManagerWithConfig ¶ added in v3.3.125
func NewAdaptiveConcurrencyManagerWithConfig(config AdaptiveConcurrencyConfig) *AdaptiveConcurrencyManager
func NewAdaptiveConcurrencyManagerWithDefaults ¶ added in v3.3.171
func NewAdaptiveConcurrencyManagerWithDefaults(defaults AdaptiveConcurrencyDefaults) *AdaptiveConcurrencyManager
func NewAdaptiveConcurrencyManagerWithInitial ¶ added in v3.3.125
func NewAdaptiveConcurrencyManagerWithInitial(maxConcurrency int, initialTarget int) *AdaptiveConcurrencyManager
func (*AdaptiveConcurrencyManager) Done ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) Done()
func (*AdaptiveConcurrencyManager) DoneNeutral ¶ added in v3.3.141
func (a *AdaptiveConcurrencyManager) DoneNeutral()
func (*AdaptiveConcurrencyManager) DoneWithSample ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) DoneWithSample(sample AdaptiveConcurrencySample)
func (*AdaptiveConcurrencyManager) Max ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) Max() int
func (*AdaptiveConcurrencyManager) NewSubWorker ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) NewSubWorker() ConcurrencyManager
func (*AdaptiveConcurrencyManager) RunningCount ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) RunningCount() int
func (*AdaptiveConcurrencyManager) Snapshot ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) Snapshot() AdaptiveConcurrencySnapshot
func (*AdaptiveConcurrencyManager) Target ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) Target() int
func (*AdaptiveConcurrencyManager) Wait ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) Wait()
func (*AdaptiveConcurrencyManager) WaitAllDone ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) WaitAllDone()
func (*AdaptiveConcurrencyManager) WaitForADone ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) WaitForADone() bool
func (*AdaptiveConcurrencyManager) WaitForADoneWithContext ¶ added in v3.3.141
func (a *AdaptiveConcurrencyManager) WaitForADoneWithContext(ctx context.Context) bool
func (*AdaptiveConcurrencyManager) WaitWithContext ¶ added in v3.3.125
func (a *AdaptiveConcurrencyManager) WaitWithContext(ctx context.Context) bool
type AdaptiveConcurrencyManagerWithSample ¶ added in v3.3.125
type AdaptiveConcurrencyManagerWithSample interface {
ConcurrencyManager
DoneWithSample(AdaptiveConcurrencySample)
}
type AdaptiveConcurrencySample ¶ added in v3.3.125
type AdaptiveConcurrencySnapshot ¶ added in v3.3.125
type AdaptiveConcurrencySnapshot struct {
Target int
Max int
GrowthCeiling int
GrowthCeilingUnlocked bool
GrowthCeilingProbeSuccessThreshold int
Running int
PeakTarget int
PeakRunning int
SuccessTotal int
FailureTotal int
GrowTotal int
ShrinkTotal int
BackPressureTotal int
RetryAfterTotal int
ThroughputBackoffTotal int
ThroughputProbeMissTotal int
ThroughputProbeEfficiencyMissTotal int
LatencyBackoffTotal int
LatencyGrowthSuppressionTotal int
BytesTotal int64
AverageDuration time.Duration
LastThroughputBytesPerSecond float64
BestThroughputBytesPerSecond float64
LastThroughputProbeGainPercent float64
LastThroughputProbeTargetDelta int
LastThroughputProbeGainPerTargetPercent float64
LastQueueEstimate float64
MinDurationPerByte float64
LastDurationPerByte float64
}
type AdaptiveConcurrencySubWorker ¶ added in v3.3.125
type AdaptiveConcurrencySubWorker struct {
// contains filtered or unexported fields
}
func (*AdaptiveConcurrencySubWorker) Done ¶ added in v3.3.125
func (s *AdaptiveConcurrencySubWorker) Done()
func (*AdaptiveConcurrencySubWorker) DoneNeutral ¶ added in v3.3.141
func (s *AdaptiveConcurrencySubWorker) DoneNeutral()
func (*AdaptiveConcurrencySubWorker) DoneWithSample ¶ added in v3.3.125
func (s *AdaptiveConcurrencySubWorker) DoneWithSample(sample AdaptiveConcurrencySample)
func (*AdaptiveConcurrencySubWorker) RunningCount ¶ added in v3.3.125
func (s *AdaptiveConcurrencySubWorker) RunningCount() int
func (*AdaptiveConcurrencySubWorker) Wait ¶ added in v3.3.125
func (s *AdaptiveConcurrencySubWorker) Wait()
func (*AdaptiveConcurrencySubWorker) WaitAllDone ¶ added in v3.3.125
func (s *AdaptiveConcurrencySubWorker) WaitAllDone()
func (*AdaptiveConcurrencySubWorker) WaitForADone ¶ added in v3.3.125
func (s *AdaptiveConcurrencySubWorker) WaitForADone() bool
func (*AdaptiveConcurrencySubWorker) WaitForADoneWithContext ¶ added in v3.3.141
func (s *AdaptiveConcurrencySubWorker) WaitForADoneWithContext(ctx context.Context) bool
func (*AdaptiveConcurrencySubWorker) WaitWithContext ¶ added in v3.3.125
func (s *AdaptiveConcurrencySubWorker) WaitWithContext(ctx context.Context) bool
type AtomicValue ¶ added in v3.2.13
type AtomicValue[T comparable] struct { sync.RWMutex // contains filtered or unexported fields }
func (*AtomicValue[T]) CompareAndUpdate ¶ added in v3.2.13
func (av *AtomicValue[T]) CompareAndUpdate(cmpValue T, updateFunc func() T)
func (*AtomicValue[T]) Load ¶ added in v3.2.13
func (av *AtomicValue[T]) Load() T
func (*AtomicValue[T]) Store ¶ added in v3.2.13
func (av *AtomicValue[T]) Store(val T)
type ConcurrencyManager ¶
type ConcurrencyManager interface {
// Wait until a slot is available for the new goroutine.
Wait()
// Done Mark a goroutine as finished
Done()
// WaitAllDone Wait for all goroutines are done
WaitAllDone()
// RunningCount Returns the number of goroutines which are running
RunningCount() int
// WaitWithContext Acquires a semaphore to allow a new goroutine to run or returns false if the context is done
WaitWithContext(ctx context.Context) bool
// WaitForADone Blocks until at least one goroutine has completed.
WaitForADone() bool
// WaitForADoneWithContext blocks until at least one goroutine has completed or returns false if the context is done.
WaitForADoneWithContext(ctx context.Context) bool
}
type ConcurrencyManagerWithSubWorker ¶
type ConcurrencyManagerWithSubWorker interface {
ConcurrencyManager
NewSubWorker() ConcurrencyManager
}
type ConstrainedWorkGroup ¶
type ConstrainedWorkGroup struct {
// contains filtered or unexported fields
}
func NewConstrainedWorkGroup ¶
func NewConstrainedWorkGroup(maxConcurrency int) *ConstrainedWorkGroup
func (*ConstrainedWorkGroup) Done ¶
func (cw *ConstrainedWorkGroup) Done()
func (*ConstrainedWorkGroup) Max ¶
func (cw *ConstrainedWorkGroup) Max() int
func (*ConstrainedWorkGroup) NewSubWorker ¶
func (cw *ConstrainedWorkGroup) NewSubWorker() ConcurrencyManager
func (*ConstrainedWorkGroup) RemainingCapacity ¶
func (cw *ConstrainedWorkGroup) RemainingCapacity() int
func (*ConstrainedWorkGroup) RunningCount ¶
func (cw *ConstrainedWorkGroup) RunningCount() int
func (*ConstrainedWorkGroup) Wait ¶
func (cw *ConstrainedWorkGroup) Wait()
func (*ConstrainedWorkGroup) WaitAllDone ¶
func (cw *ConstrainedWorkGroup) WaitAllDone()
func (*ConstrainedWorkGroup) WaitForADone ¶
func (cw *ConstrainedWorkGroup) WaitForADone() bool
func (*ConstrainedWorkGroup) WaitForADoneWithContext ¶ added in v3.3.141
func (cw *ConstrainedWorkGroup) WaitForADoneWithContext(ctx context.Context) bool
func (*ConstrainedWorkGroup) WaitWithContext ¶
func (cw *ConstrainedWorkGroup) WaitWithContext(ctx context.Context) bool
type DecimalOverride ¶ added in v3.3.272
type DecimalOverride struct {
Key string // JSON and query key shared by both fields
Field string // Go name of the float64 field; the text field is Field + "Decimal"
Float *float64
Decimal **string
}
DecimalOverride pairs a float64 request field, released before the API accepted exact decimals for it, with the *string field that sends exact decimal text under the same key instead. Generated request types keep the float64 field for existing callers and use these helpers to encode and decode either.
func (*DecimalOverride) UnmarshalJSON ¶ added in v3.3.272
func (o *DecimalOverride) UnmarshalJSON(data []byte) error
UnmarshalJSON makes o the decoding target for its key. Generated request types decode each override in the same encoding/json pass as their other fields, so key matching and repeated keys behave as in plain decoding, and the last occurrence of the key decides the route. A JSON string sets the decimal text and clears the float64; null clears the text and, as in plain decoding, leaves the float64 alone; any other value clears the text and decodes into the float64 as plain decoding would.
type DirEntry ¶
func DirEntryWalkFile ¶
type ErrorWithOriginalResponse ¶
type ErrorWithOriginalResponse struct {
// contains filtered or unexported fields
}
func (ErrorWithOriginalResponse) OriginalResponse ¶
func (u ErrorWithOriginalResponse) OriginalResponse() interface{}
func (ErrorWithOriginalResponse) ProcessError ¶
func (u ErrorWithOriginalResponse) ProcessError(data []byte, err error, t interface{}) error
type ExportValues ¶
type IterChan ¶
type KeyedMutex ¶
type KeyedMutex struct {
// contains filtered or unexported fields
}
func NewKeyedMutex ¶
func NewKeyedMutex() KeyedMutex
func (KeyedMutex) Lock ¶
func (s KeyedMutex) Lock(key interface{})
func (KeyedMutex) Unlock ¶
func (s KeyedMutex) Unlock(key interface{})
type LeveledLogger ¶ added in v3.2.136
type LeveledLogger interface {
Error(string, ...any)
Warn(string, ...any)
Info(string, ...any)
Debug(string, ...any)
Trace(string, ...any)
}
func NewLeveledLogger ¶ added in v3.2.136
func NewLeveledLogger(logger Logger) LeveledLogger
type LocalFileSystem ¶
type LocalFileSystem struct{}
func (LocalFileSystem) Chdir ¶
func (w LocalFileSystem) Chdir(dir string) error
func (LocalFileSystem) Create ¶
func (w LocalFileSystem) Create(path string) (io.WriteCloser, error)
func (LocalFileSystem) Getwd ¶
func (w LocalFileSystem) Getwd() (string, error)
func (LocalFileSystem) MkdirAll ¶
func (w LocalFileSystem) MkdirAll(path string, mode fs.FileMode) error
func (LocalFileSystem) MkdirTemp ¶
func (w LocalFileSystem) MkdirTemp(dir, pattern string) (string, error)
func (LocalFileSystem) PathJoin ¶
func (w LocalFileSystem) PathJoin(paths ...string) string
func (LocalFileSystem) PathSeparator ¶
func (w LocalFileSystem) PathSeparator() string
func (LocalFileSystem) RelPath ¶
func (w LocalFileSystem) RelPath(parent, child string) (string, error)
func (LocalFileSystem) Remove ¶
func (w LocalFileSystem) Remove(path string) error
func (LocalFileSystem) RemoveAll ¶
func (w LocalFileSystem) RemoveAll(path string) error
func (LocalFileSystem) TempDir ¶
func (w LocalFileSystem) TempDir() string
type Meter ¶
type Meter struct {
// contains filtered or unexported fields
}
Meter measures the latest data transfer amount.
func NewMeter ¶
NewMeter creates a meter with specified resolution and sample duration. sample must be an integral multiple of Resolution
type MeterItem ¶
type MeterItem struct {
// contains filtered or unexported fields
}
MeterItem is an element of linked list for the meter.
type NullLogger ¶
type NullLogger struct{}
func (NullLogger) Printf ¶
func (n NullLogger) Printf(_ string, _ ...any)
type Path ¶
func NewUrlPath ¶
func (Path) ConvertEmptyToRoot ¶
func (Path) EndingSlash ¶
func (Path) NormalizePathSystemForAPI ¶
func (Path) PathSeparator ¶
func (Path) PruneEndingSlash ¶
func (Path) PruneStartingSlash ¶
func (Path) SwitchPathSeparator ¶
type PathSpecArgs ¶
type PathSpecEntry ¶
type PathSpecTest ¶
type PathSpecTest struct {
Name string
Args PathSpecArgs
Dest []PathSpecEntry
Src []PathSpecEntry
}
type ProgressWriter ¶
type ProgressWriter struct {
WriterAndAt
ProgressWatcher func(int64)
}
func (ProgressWriter) Close ¶
func (w ProgressWriter) Close() error
type ReadWriteFs ¶
type ReadWriteFs interface {
WritableFs
fs.FS
}
type ReaderAtCloser ¶
type ReaderAtCloser interface {
io.ReaderAt
io.ReadCloser
}
type Resource ¶
type Resource struct {
Path string
Params interface{}
Method string
Entity UnmarshalJSON
}
func (Resource) Out ¶
func (r Resource) Out() (ResourceOut, error)
type ResourceOut ¶
type ResponseError ¶
type ResponseError struct {
StatusCode int
Response *http.Response
// contains filtered or unexported fields
}
func (ResponseError) Error ¶
func (r ResponseError) Error() string
type S3Error ¶
type S3ErrorClassification ¶ added in v3.3.106
func ClassifyS3Error ¶ added in v3.3.106
func ClassifyS3Error(err error) (S3ErrorClassification, bool)
func ClassifyS3ErrorCode ¶ added in v3.3.106
func ClassifyS3ErrorCode(code string) S3ErrorClassification
type StatefulDirectory ¶
type SubWorker ¶
type SubWorker struct {
// contains filtered or unexported fields
}
func (*SubWorker) RunningCount ¶
func (*SubWorker) WaitAllDone ¶
func (sw *SubWorker) WaitAllDone()
func (*SubWorker) WaitForADone ¶
WaitForADone Blocks until at least one goroutine has completed.
func (*SubWorker) WaitForADoneWithContext ¶ added in v3.3.141
type Transport ¶
func DefaultPooledTransport ¶ added in v3.0.3
func DefaultPooledTransport() *Transport
func (*Transport) CloseIdleConnections ¶ added in v3.3.136
func (t *Transport) CloseIdleConnections()
func (*Transport) DialContext ¶
func (*Transport) GetConnectionStats ¶
type UnmarshalJSON ¶
type UploadRetryAttempt ¶ added in v3.3.125
type Walk ¶
type Walk[T any] struct { fs.FS Queue[string] IterChan[T] ConcurrencyManager ConcurrencyManagerWithSubWorker // Root is the directory to walk. An empty Root walks the contents of the // filesystem root without emitting the root itself; "." or a named Root also // emits the root directory when ListDirectories is set. Root string WalkFile func(d fs.DirEntry, path string, err error) (T, error) ListDirectories bool }
type WithContextReader ¶
type WithContextReaderAt ¶
type WritableFs ¶
type WritableFs interface {
MkdirAll(string, fs.FileMode) error
MkdirTemp(dir, pattern string) (string, error)
TempDir() string
Create(string) (io.WriteCloser, error)
RemoveAll(string) error
Remove(string) error
PathSeparator() string
PathJoin(...string) string
RelPath(parent, child string) (string, error)
SplitPath(path string) (string, string)
Chtimes(name string, atime time.Time, mtime time.Time) error
}
Source Files
¶
- adaptiveconcurrency.go
- anyerror.go
- atomicvalue.go
- concurrencymanager.go
- connection-stats.go
- constrainedwaitgroup.go
- copyat.go
- decimal.go
- default-string.go
- errorwithoriginalresponse.go
- expandtilde.go
- http-client.go
- isdir.go
- iterchan.go
- keyedmutex.go
- localfilesystem.go
- logger.go
- map.go
- meter.go
- normalizeforcomparison.go
- params.go
- partsize.go
- path.go
- pathspec.go
- pointers.go
- progresswriter.go
- query.go
- queue.go
- readerctx.go
- required.go
- responseerrors.go
- s3-error.go
- signal.go
- string.go
- underscorepath.go
- urljoinnoexcape.go
- walk.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package privatefile creates and maintains local files and directories that only the current user can read.
|
Package privatefile creates and maintains local files and directories that only the current user can read. |