Documentation ¶
Index ¶
- Constants
- func UpsertUser(identity users.Identity, email string) (*storage.APIKey, error)
- type Envelope
- type Objects
- type ObjectsACL
- func (a *ObjectsACL) Close() error
- func (a *ObjectsACL) DeleteBLOB(hash string) error
- func (a *ObjectsACL) GetBLOBEnvelope(hash string) (*Envelope, error)
- func (a *ObjectsACL) GetBLOBs() ([]string, error)
- func (a *ObjectsACL) OpenBLOB(hash string) (ReadSeekCloser, error)
- func (a *ObjectsACL) WriteBLOB(data io.Reader) (*Envelope, error)
- type ReadSeekCloser
Constants ¶
View Source
const (
// CollectionBLOBs represents BLOBs collection
CollectionBLOBs = "blobs"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Envelope ¶
type Envelope struct { // SizeBytes is the BLOB size in bytes SizeBytes int64 `json:"size_bytes"` // SHA512 is the half SHA512 hash of the BLOB SHA512 string `json:"sha512"` // Modified specifies the time this file was last modified Modified time.Time `json:"modified"` }
Envelope specifies the metadata about BLOB - it's SHA512 hash and size
type Objects ¶
type Objects interface { io.Closer // WriteBLOB writes BLOB to storage, on success // returns the envelope with hash of the blob WriteBLOB(data io.Reader) (*Envelope, error) // OpenBLOB opens the BLOB by hash and returns reader object OpenBLOB(hash string) (ReadSeekCloser, error) // DeleteBLOB deletes the blob by hash DeleteBLOB(hash string) error // GetBLOBs returns blobs list present in the store GetBLOBs() ([]string, error) // GetBLOBEnvelope returns BLOB envelope GetBLOBEnvelope(hash string) (*Envelope, error) }
Objects is a large BLOB Object storage implemented by some backends
func WithPermissions ¶
func WithPermissions(objects Objects, users users.Users, username string, checker teleservices.AccessChecker) Objects
WithPermissions returns new ACL checking service
type ObjectsACL ¶
type ObjectsACL struct {
// contains filtered or unexported fields
}
ObjectsACL is permission aware service that wraps regular service and applies checks before every operation
func (*ObjectsACL) Close ¶
func (a *ObjectsACL) Close() error
func (*ObjectsACL) DeleteBLOB ¶
func (a *ObjectsACL) DeleteBLOB(hash string) error
DeleteBLOB deletes the blob by hash
func (*ObjectsACL) GetBLOBEnvelope ¶
func (a *ObjectsACL) GetBLOBEnvelope(hash string) (*Envelope, error)
GetBLOBEnvelope returns blob envelope
func (*ObjectsACL) GetBLOBs ¶
func (a *ObjectsACL) GetBLOBs() ([]string, error)
GetBLOBs returns blobs list present in the store
func (*ObjectsACL) OpenBLOB ¶
func (a *ObjectsACL) OpenBLOB(hash string) (ReadSeekCloser, error)
OpenBLOB opens the BLOB by hash and returns reader object
Click to show internal directories.
Click to hide internal directories.