Documentation ¶
Index ¶
- Variables
- func Close(b *Broker)
- func Delete(b *Broker, bucket string, before time.Time)
- func DeleteExchange(b *Broker, exchangeId string) error
- func FindStringInSlice(slice []string, val string) (int, bool)
- func GetExchange(b *Broker, exchangeId string) ([]byte, error)
- func ListExchanges(b *Broker) map[string]string
- func NoExchangeConnected(b *Broker) bool
- func OnUpdate(b *Broker) chan Update
- func Pull(b *Broker, bucket string, localFiles []string, folder string) int
- func Push(b *Broker, bucket string, localFiles []string) []string
- func SetExchange(b *Broker, exchangeId string, config []byte) error
- type Broker
- type Exchange
- type FTPConfig
- type FTPExchange
- func (exchange *FTPExchange) Connect(_ chan Update) error
- func (exchange *FTPExchange) Delete(bucket string, info os.FileInfo) error
- func (exchange *FTPExchange) Disconnect()
- func (exchange *FTPExchange) Get(bucket string, info os.FileInfo, dest io.Writer) error
- func (exchange *FTPExchange) List(bucket string) ([]os.FileInfo, error)
- func (exchange *FTPExchange) Put(bucket string, info os.FileInfo, source io.Reader) error
- func (exchange *FTPExchange) Status() Status
- func (exchange *FTPExchange) String() string
- type FileInfo
- type S3Config
- type S3Exchange
- func (exchange *S3Exchange) Connect(onUpdate chan Update) error
- func (exchange *S3Exchange) Delete(bucket string, info os.FileInfo) error
- func (exchange *S3Exchange) Disconnect()
- func (exchange *S3Exchange) Get(bucket string, info os.FileInfo, dest io.Writer) error
- func (exchange *S3Exchange) ID() string
- func (exchange *S3Exchange) List(bucket string) ([]os.FileInfo, error)
- func (exchange *S3Exchange) Name() string
- func (exchange *S3Exchange) Put(bucket string, info os.FileInfo, source io.Reader) error
- func (exchange *S3Exchange) Status() Status
- func (exchange *S3Exchange) String() string
- type Status
- type USBConfig
- type USBExchange
- func (exchange *USBExchange) Connect(_ chan Update) error
- func (exchange *USBExchange) Delete(bucket string, info os.FileInfo) error
- func (exchange *USBExchange) Disconnect()
- func (exchange *USBExchange) Get(bucket string, info os.FileInfo, writer io.Writer) error
- func (exchange *USBExchange) ID() string
- func (exchange *USBExchange) List(bucket string) ([]os.FileInfo, error)
- func (exchange *USBExchange) Name() string
- func (exchange *USBExchange) Put(bucket string, info os.FileInfo, reader io.Reader) error
- func (exchange *USBExchange) Status() Status
- func (exchange *USBExchange) String() string
- type Update
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoUSBMounts = errors.New("no suitable USB devices")
Functions ¶
func DeleteExchange ¶
func ListExchanges ¶
func NoExchangeConnected ¶
Types ¶
type Exchange ¶
type Exchange interface { /** Connect to the broker using local as exchangesFolder where download/upload files are */ Connect(onUpdate chan Update) error Disconnect() Status() Status /** List lists all the entries at the provided bucket */ List(bucket string) ([]os.FileInfo, error) /** Push the file to the bucket */ Put(bucket string, info os.FileInfo, reader io.Reader) error /** Get a file content from the bucket */ Get(bucket string, info os.FileInfo, writer io.Writer) error /** Purge all files older than the specified timestamp*/ Delete(bucket string, info os.FileInfo) error String() string }
type FTPExchange ¶
type FTPExchange struct {
// contains filtered or unexported fields
}
func (*FTPExchange) Connect ¶
func (exchange *FTPExchange) Connect(_ chan Update) error
func (*FTPExchange) Delete ¶
func (exchange *FTPExchange) Delete(bucket string, info os.FileInfo) error
func (*FTPExchange) Disconnect ¶
func (exchange *FTPExchange) Disconnect()
func (*FTPExchange) Status ¶
func (exchange *FTPExchange) Status() Status
func (*FTPExchange) String ¶
func (exchange *FTPExchange) String() string
type S3Config ¶
type S3Config struct { Name string `json:"name" yaml:"name"` Endpoint string `json:"endpoint" yaml:"endpoint"` Bucket string `json:"bucket" yaml:"bucket"` AccessKey string `json:"accessKey" yaml:"accessKey"` Secret string `json:"secret" yaml:"secret"` UseSSL bool `json:"useSSL" yaml:"useSSL"` Location string `json:"location" yaml:"location"` }
type S3Exchange ¶
type S3Exchange struct {
// contains filtered or unexported fields
}
func (*S3Exchange) Connect ¶
func (exchange *S3Exchange) Connect(onUpdate chan Update) error
func (*S3Exchange) Delete ¶
func (exchange *S3Exchange) Delete(bucket string, info os.FileInfo) error
func (*S3Exchange) Disconnect ¶
func (exchange *S3Exchange) Disconnect()
func (*S3Exchange) ID ¶
func (exchange *S3Exchange) ID() string
func RemoveS3Secret(configs ...S3Config) { for i := range configs { configs[i].Secret = "" } }
func (*S3Exchange) Name ¶
func (exchange *S3Exchange) Name() string
func (*S3Exchange) Status ¶
func (exchange *S3Exchange) Status() Status
func (*S3Exchange) String ¶
func (exchange *S3Exchange) String() string
type USBExchange ¶
type USBExchange struct {
// contains filtered or unexported fields
}
func (*USBExchange) Connect ¶
func (exchange *USBExchange) Connect(_ chan Update) error
func (*USBExchange) Delete ¶
func (exchange *USBExchange) Delete(bucket string, info os.FileInfo) error
func (*USBExchange) Disconnect ¶
func (exchange *USBExchange) Disconnect()
func (*USBExchange) ID ¶
func (exchange *USBExchange) ID() string
func (*USBExchange) Name ¶
func (exchange *USBExchange) Name() string
func (*USBExchange) Status ¶
func (exchange *USBExchange) Status() Status
func (*USBExchange) String ¶
func (exchange *USBExchange) String() string
Click to show internal directories.
Click to hide internal directories.