Documentation ¶
Overview ¶
Package cccp provides a concurrent copy function with progress bars.
Index ¶
- Constants
- func Run(ctx context.Context) error
- func SetFromFileToFile(src, dst, name string) error
- func SetFromHTTPRequestToFile(src *http.Request, dst, name string) error
- func SetFromSourceToDestination(src source.Source, dst destination.Destination, name string) error
- func SetFromSourceToFile(src source.Source, dst, name string) error
- func SetFromURLToFile(src, dst, name string) error
- func SetOptions(opts ...Option)
- type Option
Constants ¶
const Version = "0.5.1"
Version is package version.
Variables ¶
This section is empty.
Functions ¶
func SetFromFileToFile ¶
SetFromFileToFile set the source file path and destination file path of the copy target. name is the name displayed in the progress bar. If name is empty, "src -> dst" is set.
func SetFromHTTPRequestToFile ¶ added in v0.5.0
SetFromHTTPRequestToFile set the source http.Request and destination file path of the copy target. name is the name displayed in the progress bar. If name is empty, src URL base is set.
func SetFromSourceToDestination ¶ added in v0.5.0
func SetFromSourceToDestination(src source.Source, dst destination.Destination, name string) error
SetFromSourceToDestination set the source and destination of the copy target. name is the name displayed in the progress bar.
func SetFromSourceToFile ¶ added in v0.5.0
SetFromSourceToFile set the source and destination file path of the copy target. name is the name displayed in the progress bar. If name is empty, src URL base is set.
func SetFromURLToFile ¶
SetFromURLToFile set the source URL and destination file path of the copy target. name is the name displayed in the progress bar. If name is empty, src URL base is set.
Types ¶
type Option ¶
type Option func(*manager)
Option is a setting to change the behavior of manager.
func WithConcurrent ¶
WithConcurrent set the number of concurrent execution.
func WithConcurrentNumCPU ¶
func WithConcurrentNumCPU() Option
WithConcurrentNumCPU set the number of concurrent execution to the number of CPU cores.
func WithDisableProgressbars ¶
func WithDisableProgressbars() Option
WithDisableProgressbars set not to display the progress bars.
func WithEnableSequentialProgressbars ¶
func WithEnableSequentialProgressbars() Option
WithEnableSequentialProgressbars progress bars are displayed sequentially.