Documentation ¶
Index ¶
- func GetListLimit(ctx context.Context) int
- func GetLogWriter(ctx context.Context) io.Writer
- func GetMaxSegmentSize(ctx context.Context) (memory.Size, bool)
- func IsWithoutPlainSize(ctx context.Context) bool
- func Log(ctx context.Context, args ...interface{})
- func WithConcurrentSegmentUploadsConfig(ctx context.Context, config ConcurrentSegmentUploadsConfig) context.Context
- func WithConcurrentSegmentUploadsDefaultConfig(ctx context.Context) context.Context
- func WithListLimit(ctx context.Context, limit int) context.Context
- func WithLogWriter(ctx context.Context, w io.Writer) context.Context
- func WithLogWriterContext(ctx context.Context, kvs ...string) context.Context
- func WithMaxSegmentSize(ctx context.Context, segmentSize memory.Size) context.Context
- func WithoutPlainSize(ctx context.Context) context.Context
- type ConcurrentSegmentUploadsConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetListLimit ¶ added in v1.7.1
GetListLimit returns value for list limit if exists in context. Only for testing purposes.
func GetLogWriter ¶ added in v1.11.0
GetLogWriter returns upload log file from context if exists.
func GetMaxSegmentSize ¶
GetMaxSegmentSize returns max segment size from context if exists.
func IsWithoutPlainSize ¶ added in v1.4.6
IsWithoutPlainSize returns true if information about not sending segment plain size exists in context. Only for testing purposes.
func WithConcurrentSegmentUploadsConfig ¶ added in v1.11.0
func WithConcurrentSegmentUploadsConfig(ctx context.Context, config ConcurrentSegmentUploadsConfig) context.Context
WithConcurrentSegmentUploadsConfig creates a context that enables the new concurrent segment upload codepath for testing purposes using the given scheduler options.
The context needs to be used with uplink.OpenProject to have effect.
func WithConcurrentSegmentUploadsDefaultConfig ¶ added in v1.11.0
WithConcurrentSegmentUploadsDefaultConfig creates a context that enables the new concurrent segment upload codepath for testing purposes using the default configuration.
The context needs to be used with uplink.OpenProject to have effect.
func WithListLimit ¶ added in v1.7.1
WithListLimit creates context with information about list limit that will be used with request. Only for testing purposes.
func WithLogWriter ¶ added in v1.11.0
WithLogWriter creates context with information about upload log file.
func WithLogWriterContext ¶ added in v1.11.0
WithLogWriterContext appends the key/val pair to the context that is logged with each Log call.
func WithMaxSegmentSize ¶
WithMaxSegmentSize creates context with max segment size for testing purposes.
Created context needs to be used with uplink.OpenProject to manipulate default segment size.
Types ¶
type ConcurrentSegmentUploadsConfig ¶ added in v1.11.0
type ConcurrentSegmentUploadsConfig struct { // SchedulerOptions are the options for the scheduler used to place limits // on the amount of concurrent piece limits per-upload, across all // segments. SchedulerOptions scheduler.Options // LongTailMargin represents the maximum number of piece uploads beyond the // optimal threshold that will be uploaded for a given segment. Once an // upload has reached the optimal threshold, the remaining piece uploads // are cancelled. LongTailMargin int }
ConcurrentSegmentUploadsConfig is the configuration for concurrent segment uploads using the new upload codepath.
func DefaultConcurrentSegmentUploadsConfig ¶ added in v1.11.0
func DefaultConcurrentSegmentUploadsConfig() ConcurrentSegmentUploadsConfig
DefaultConcurrentSegmentUploadsConfig returns the default ConcurrentSegmentUploadsConfig.
func GetConcurrentSegmentUploadsConfig ¶ added in v1.11.0
func GetConcurrentSegmentUploadsConfig(ctx context.Context) *ConcurrentSegmentUploadsConfig
GetConcurrentSegmentUploadsConfig returns the scheduler options to use with the new concurrent segment upload codepath, or nil if no scheduler options have been set.