Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBucketSyncFunc ¶
func AddBucketSyncFunc(typeName string, newClientFunc BucketSyncFunc) (err error)
AddBucketSyncFunc to register new type of bucket client
func AllSupportedBucketTypes ¶
func AllSupportedBucketTypes() (types []string)
AllSupportedBucketTypes to get all the registered buckets types.
func RemoveBucketSyncFunc ¶
RemoveBucketSyncFunc to unregister bucketSyncFuncsChan from local maps
Types ¶
type BucketConfig ¶
type BucketConfig struct { Type string `json:"type" yaml:"type"` Name string `json:"name" yaml:"name"` Key string `json:"key" yaml:"key"` Secret string `json:"secret" yaml:"secret"` EndPoint string `json:"endpoint" yaml:"endpoint"` SubDir string `json:"subdir" yaml:"subdir"` Region string `json:"region" yaml:"region"` }
type BucketSync ¶
type BucketSync interface { Info(context.Context) (interface{}, error) Exists(context.Context, string) bool Put(cxt context.Context, filePath, key string) error }
BucketSync is a client for obsync bucket client interface.
type BucketSyncFunc ¶
type BucketSyncFunc func(config BucketConfig) (BucketSync, error)
to store the client callback functions and instance variables
func GetBucketSyncFunc ¶
func GetBucketSyncFunc(typeName string) (BucketSyncFunc, error)
GetBucketSyncFunc provide a callback function for creating new buckets function
type BucketSyncFuncs ¶
type BucketSyncFuncs map[string]BucketSyncFunc
to store the client callback functions and instance variables
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner supported synchronous local files to specified bucket
func NewRunner ¶
func NewRunner(config RunnerConfig) (*Runner, error)
NewRunner to instance a new runner with specified configuration notice: 1. the bucket type must be registered
- the local directory must readable
- the threads must be greater than zero
type RunnerConfig ¶
type RunnerConfig struct { LocalPath string `yaml:"path" json:"path"` Description string `yaml:"description" json:"description"` Overrides bool `yaml:"overrides" json:"overrides"` Exclude []string `yaml:"exclude" json:"exclude"` Timeout time.Duration `yaml:"timeout" json:"timeout"` Threads uint `yaml:"threads" json:"threads"` BucketConfigs []BucketConfig `yaml:"buckets" json:"buckets"` }
RunnerConfig represents a configuration for running