rootsystem/objectStorage/objectStorager.go

45 lines
900 B
Go
Raw Permalink Normal View History

2020-03-06 16:39:33 +00:00
package objectStorage
import (
"time"
"git.sequentialread.com/forest/rootsystem/configuration"
)
2020-03-06 16:39:33 +00:00
type ObjectStoragerMeta struct {
Client ObjectStorager
Initializing bool
Description string
Err error
2020-03-06 16:39:33 +00:00
}
type ObjectStorageFileInfo struct {
Name string
LastModified time.Time
IsDirectory bool
2020-03-06 16:39:33 +00:00
}
type ObjectStorageFile struct {
Name string
LastModified time.Time
Content []byte
2020-03-06 16:39:33 +00:00
}
type ObjectStorageKey struct {
Name string
PathPrefix string
Read bool
Write bool
Delete bool
List bool
}
2020-03-06 16:39:33 +00:00
type ObjectStorager interface {
CreateIfNotExists() error
CreateAccessKeyIfNotExists(key ObjectStorageKey) ([]configuration.Credential, error)
List(key string) ([]ObjectStorageFileInfo, error)
Get(key string) (file ObjectStorageFile, notFound bool, err error)
Put(key string, value []byte) error
Delete(key string) error
2020-03-06 16:39:33 +00:00
}