Documentation
¶
Index ¶
- Constants
- func GetStorageProtocol(obj any) core.StorageProtocol
- type CacheConfig
- type Config
- type CtxRangeKeyType
- type DbConfig
- type DbLocker
- type Lock
- type S5Protocol
- func (s *S5Protocol) Config() config.ProtocolConfig
- func (s *S5Protocol) EncodeFileName(bytes []byte) string
- func (s *S5Protocol) HashFromIdentifier(identifier string) ([]byte, error)
- func (s *S5Protocol) Name() string
- func (s *S5Protocol) Node() *s5node.Node
- func (s *S5Protocol) Start(ctx core.Context) error
- func (s *S5Protocol) Stop(ctx core.Context) error
- func (s *S5Protocol) StorageProtocol() core.StorageProtocol
- func (s *S5Protocol) TusHandler() *TusHandler
- func (s *S5Protocol) ValidIdentifier(identifier string) bool
- type S5ProviderStore
- type TusHandler
- func (t *TusHandler) CreateUpload(ctx context.Context, hash []byte, uploadID string, uploaderID uint, ...) (*models.TusUpload, error)
- func (t *TusHandler) DeleteUpload(ctx context.Context, uploadID string) error
- func (t *TusHandler) GetUploadReader(ctx context.Context, hash []byte, start int64) (io.ReadCloser, error)
- func (t *TusHandler) GetUploadSize(ctx context.Context, hash []byte) (int64, error)
- func (t *TusHandler) Init() error
- func (t *TusHandler) S3Client() *s3.Client
- func (t *TusHandler) ScheduleUpload(ctx context.Context, uploadID string) error
- func (t *TusHandler) SetStorageProtocol(storageProtocol core.StorageProtocol)
- func (t *TusHandler) Tus() *handler.Handler
- func (t *TusHandler) TusStore() handler.DataStore
- func (t *TusHandler) UploadCompleted(ctx context.Context, uploadID string) error
- func (t *TusHandler) UploadExists(ctx context.Context, id string) (bool, models.TusUpload)
- func (t *TusHandler) UploadHashExists(ctx context.Context, hash []byte) (bool, models.TusUpload)
- func (t *TusHandler) UploadProgress(ctx context.Context, uploadID string) error
- func (t *TusHandler) Uploads(ctx context.Context, uploaderID uint) ([]models.TusUpload, error)
Constants ¶
View Source
const ETCD_DB_PREFIX = "s5-db"
Variables ¶
This section is empty.
Functions ¶
func GetStorageProtocol ¶
func GetStorageProtocol(obj any) core.StorageProtocol
Types ¶
type CacheConfig ¶
type CacheConfig struct { Type string `mapstructure:"type"` LRUCacheSize int `mapstructure:"lru_cache_size"` }
func (CacheConfig) Defaults ¶
func (c CacheConfig) Defaults() map[string]any
func (CacheConfig) Validate ¶
func (c CacheConfig) Validate() error
type Config ¶
type Config struct { *s5config.NodeConfig `mapstructure:",squash"` Db DbConfig `mapstructure:"db"` TUSLockerMode string `mapstructure:"tus_locker_mode"` }
type DbConfig ¶
type DbConfig struct { Type string `mapstructure:"type"` DbPath string `mapstructure:"db_path,omitempty"` Cache CacheConfig `mapstructure:"cache"` }
type DbLocker ¶
type S5Protocol ¶
type S5Protocol struct {
// contains filtered or unexported fields
}
func NewS5Protocol ¶
func NewS5Protocol() (*S5Protocol, []core.ContextBuilderOption, error)
func (*S5Protocol) Config ¶
func (s *S5Protocol) Config() config.ProtocolConfig
func (*S5Protocol) EncodeFileName ¶
func (s *S5Protocol) EncodeFileName(bytes []byte) string
func (*S5Protocol) HashFromIdentifier ¶
func (s *S5Protocol) HashFromIdentifier(identifier string) ([]byte, error)
func (*S5Protocol) Name ¶
func (s *S5Protocol) Name() string
func (*S5Protocol) Node ¶
func (s *S5Protocol) Node() *s5node.Node
func (*S5Protocol) StorageProtocol ¶
func (s *S5Protocol) StorageProtocol() core.StorageProtocol
func (*S5Protocol) TusHandler ¶
func (s *S5Protocol) TusHandler() *TusHandler
func (*S5Protocol) ValidIdentifier ¶
func (s *S5Protocol) ValidIdentifier(identifier string) bool
type S5ProviderStore ¶
type S5ProviderStore struct {
// contains filtered or unexported fields
}
func NewS5ProviderStore ¶
func NewS5ProviderStore(ctx core.Context, tus *TusHandler) *S5ProviderStore
func (S5ProviderStore) CanProvide ¶
func (s S5ProviderStore) CanProvide(hash *encoding.Multihash, kind []types.StorageLocationType) bool
func (S5ProviderStore) Provide ¶
func (s S5ProviderStore) Provide(hash *encoding.Multihash, kind []types.StorageLocationType) (s5storage.StorageLocation, error)
type TusHandler ¶
type TusHandler struct {
// contains filtered or unexported fields
}
func NewTusHandler ¶
func NewTusHandler() (*TusHandler, []core.ContextBuilderOption)
func (*TusHandler) CreateUpload ¶
func (*TusHandler) DeleteUpload ¶
func (t *TusHandler) DeleteUpload(ctx context.Context, uploadID string) error
func (*TusHandler) GetUploadReader ¶
func (t *TusHandler) GetUploadReader(ctx context.Context, hash []byte, start int64) (io.ReadCloser, error)
func (*TusHandler) GetUploadSize ¶
func (*TusHandler) Init ¶
func (t *TusHandler) Init() error
func (*TusHandler) S3Client ¶
func (t *TusHandler) S3Client() *s3.Client
func (*TusHandler) ScheduleUpload ¶
func (t *TusHandler) ScheduleUpload(ctx context.Context, uploadID string) error
func (*TusHandler) SetStorageProtocol ¶
func (t *TusHandler) SetStorageProtocol(storageProtocol core.StorageProtocol)
func (*TusHandler) Tus ¶
func (t *TusHandler) Tus() *handler.Handler
func (*TusHandler) TusStore ¶
func (t *TusHandler) TusStore() handler.DataStore
func (*TusHandler) UploadCompleted ¶
func (t *TusHandler) UploadCompleted(ctx context.Context, uploadID string) error
func (*TusHandler) UploadExists ¶
func (*TusHandler) UploadHashExists ¶
func (*TusHandler) UploadProgress ¶
func (t *TusHandler) UploadProgress(ctx context.Context, uploadID string) error
Click to show internal directories.
Click to hide internal directories.