forked from kyma-project/kyma
/
interfaces.go
28 lines (23 loc) · 883 Bytes
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package storage
import (
"io"
"github.com/minio/minio-go"
)
//go:generate mockery -name=Cache -output=automock -outpkg=automock -case=underscore
type Cache interface {
Delete(key string) error
Get(key string) ([]byte, error)
Set(key string, entry []byte) error
Reset() error
}
//go:generate mockery -name=Minio -output=automock -outpkg=automock -case=underscore
type Minio interface {
GetObject(bucketName, objectName string, opts minio.GetObjectOptions) (*minio.Object, error)
ListenBucketNotification(bucketName, prefix, suffix string, events []string, doneCh <-chan struct{}) <-chan minio.NotificationInfo
}
//go:generate mockery -name=client -inpkg -case=underscore
type client interface {
Object(bucketName, objectName string) (io.Reader, error)
NotificationChannel(bucketName string, stop <-chan struct{}) <-chan notification
IsNotExistsError(err error) bool
}