s3

package
v0.0.0-...-ca3ac9b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package s3 this package contains all s3 related structs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStorage

type BlobStorage struct {
	Endpoint  string
	Insecure  bool
	Bucket    string
	AccessKey string
	SecretKey string
	Tenant    string
	Password  string
	// contains filtered or unexported fields
}

BlobStorage service for storing blob files into a S3 compatible storage

func (*BlobStorage) AddRetention

func (s *BlobStorage) AddRetention(r *model.RetentionEntry) error

AddRetention adding a retention entry to the storage

func (*BlobStorage) CheckBlob

func (s *BlobStorage) CheckBlob(id string) (*model.CheckInfo, error)

CheckBlob checking a single blob from the storage system

func (*BlobStorage) Close

func (s *BlobStorage) Close() error

Close closing the storage

func (*BlobStorage) DeleteBlob

func (s *BlobStorage) DeleteBlob(id string) error

DeleteBlob removing a blob from the storage system

func (*BlobStorage) DeleteRetention

func (s *BlobStorage) DeleteRetention(id string) error

DeleteRetention deletes the retention entry from the storage

func (*BlobStorage) GetAllRetentions

func (s *BlobStorage) GetAllRetentions(callback func(r model.RetentionEntry) bool) error

GetAllRetentions for every retention entry for this tenant we call the callback function, you can stop the walk by returning a false in the callback

func (*BlobStorage) GetBlobDescription

func (s *BlobStorage) GetBlobDescription(id string) (*model.BlobDescription, error)

GetBlobDescription getting the description of the file

func (*BlobStorage) GetBlobs

func (s *BlobStorage) GetBlobs(callback func(id string) bool) error

GetBlobs getting a list of blob from the storage

func (*BlobStorage) GetLastError

func (s *BlobStorage) GetLastError() error

GetLastError returning the last error (niy)

func (*BlobStorage) GetRetention

func (s *BlobStorage) GetRetention(id string) (model.RetentionEntry, error)

GetRetention getting a single retention entry

func (*BlobStorage) GetTenant

func (s *BlobStorage) GetTenant() string

GetTenant return the id of the tenant

func (*BlobStorage) HasBlob

func (s *BlobStorage) HasBlob(id string) (bool, error)

HasBlob checking, if a blob is present

func (*BlobStorage) Init

func (s *BlobStorage) Init() error

Init initialise this service

func (*BlobStorage) ResetRetention

func (s *BlobStorage) ResetRetention(id string) error

ResetRetention resets the retention for a blob

func (*BlobStorage) RetrieveBlob

func (s *BlobStorage) RetrieveBlob(id string, w io.Writer) error

RetrieveBlob retrieving the binary data from the storage system

func (*BlobStorage) SearchBlobs

func (s *BlobStorage) SearchBlobs(_ string, _ func(id string) bool) error

SearchBlobs quering a single blob, niy

func (*BlobStorage) StoreBlob

func (s *BlobStorage) StoreBlob(b *model.BlobDescription, f io.Reader) (string, error)

StoreBlob storing a blob to the storage system

func (*BlobStorage) UpdateBlobDescription

func (s *BlobStorage) UpdateBlobDescription(_ string, b *model.BlobDescription) error

UpdateBlobDescription updating the blob description

type StoreEntry

type StoreEntry struct {
	Tenant string `yaml:"tenant" json:"tenant"`
}

StoreEntry entry in a list for tenant management

type TenantManager

type TenantManager struct {
	Endpoint  string
	Insecure  bool // true for self signed certificates
	Bucket    string
	AccessKey string
	SecretKey string
	Password  string
	// contains filtered or unexported fields
}

TenantManager the s3 based tenant manager

func (*TenantManager) AddSize

func (s *TenantManager) AddSize(_ string, _ int64)

AddSize adding the blob size to the tenant size

func (*TenantManager) AddTenant

func (s *TenantManager) AddTenant(tenant string) error

AddTenant add a new tenant to the manager

func (*TenantManager) Close

func (s *TenantManager) Close() error

Close closing the manager

func (*TenantManager) GetConfig

func (s *TenantManager) GetConfig(tenant string) (*interfaces.TenantConfig, error)

GetConfig reading the config object for the tenant

func (*TenantManager) GetSize

func (s *TenantManager) GetSize(_ string) int64

GetSize getting the overall storage size for a tenant, niy

func (*TenantManager) GetTenants

func (s *TenantManager) GetTenants(callback func(tenant string) bool) error

GetTenants walk thru all tenants

func (*TenantManager) HasTenant

func (s *TenantManager) HasTenant(tenant string) bool

HasTenant checking if a tenant is present

func (*TenantManager) Init

func (s *TenantManager) Init() error

Init initialize this tenant manager

func (*TenantManager) RemoveTenant

func (s *TenantManager) RemoveTenant(tenant string) (string, error)

RemoveTenant remove a tenant from the service, delete all related data

func (*TenantManager) SetConfig

func (s *TenantManager) SetConfig(tenant string, config interfaces.TenantConfig) error

SetConfig writing a new config object for the tenant

func (*TenantManager) SubSize

func (s *TenantManager) SubSize(_ string, _ int64)

SubSize subtract the blob size to the tenant size

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL