mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
fs: make Flagger and FlaggerNP interfaces public so we can test flags elsewhere
This commit is contained in:
21
fs/types.go
21
fs/types.go
@@ -5,6 +5,7 @@ package fs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
@@ -312,6 +313,26 @@ type ListRCallback func(entries DirEntries) error
|
||||
// ListRFn is defines the call used to recursively list a directory
|
||||
type ListRFn func(ctx context.Context, dir string, callback ListRCallback) error
|
||||
|
||||
// Flagger describes the interface rclone config types flags must satisfy
|
||||
type Flagger interface {
|
||||
// These are from pflag.Value which we don't want to pull in here
|
||||
String() string
|
||||
Set(string) error
|
||||
Type() string
|
||||
json.Unmarshaler
|
||||
}
|
||||
|
||||
// FlaggerNP describes the interface rclone config types flags must
|
||||
// satisfy as non-pointers
|
||||
//
|
||||
// These are from pflag.Value and need to be tested against
|
||||
// non-pointer value due the the way the backend flags are inserted
|
||||
// into the flags.
|
||||
type FlaggerNP interface {
|
||||
String() string
|
||||
Type() string
|
||||
}
|
||||
|
||||
// NewUsageValue makes a valid value
|
||||
func NewUsageValue(value int64) *int64 {
|
||||
p := new(int64)
|
||||
|
||||
Reference in New Issue
Block a user