Documentation ¶
Overview ¶
Package services contains main business logic
Index ¶
- Constants
- type ObjectService
- func (svc *ObjectService) Exists(ctx context.Context, ns data.Namespace, id data.ObjectID) (bool, error)
- func (svc *ObjectService) ReadFull(ctx context.Context, ns data.Namespace, id data.ObjectID, writer io.Writer) error
- func (svc *ObjectService) SetCompleted(ctx context.Context, ns data.Namespace, id data.ObjectID) error
- func (svc *ObjectService) StoreStream(ctx context.Context, ns data.Namespace, id data.ObjectID, size int64, ...) error
- type RefService
- func (svc *RefService) Exists(ctx context.Context, ns data.Namespace, name data.RefName) (bool, error)
- func (svc *RefService) GetRef(ctx context.Context, ns data.Namespace, name data.RefName) (*data.Ref, error)
- func (svc *RefService) StoreRef(ctx context.Context, ns data.Namespace, name data.RefName, commit data.Commit, ...) error
Constants ¶
View Source
const ErrorDataValidationRef = apperrors.ErrorDataValidation + ":Ref"
ErrorDataValidationRef is error for validation of data.Ref
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectService ¶
type ObjectService struct {
// contains filtered or unexported fields
}
ObjectService is service for interaction with data.Object
func NewObjectService ¶
func NewObjectService(l logger.Logger, db db.ObjectRepository, fs objstore.ObjectStore) *ObjectService
NewObjectService creates new instance of ObjectService
func (*ObjectService) Exists ¶
func (svc *ObjectService) Exists(ctx context.Context, ns data.Namespace, id data.ObjectID) (bool, error)
Exists checks if data.Object exist on storage
func (*ObjectService) ReadFull ¶
func (svc *ObjectService) ReadFull(ctx context.Context, ns data.Namespace, id data.ObjectID, writer io.Writer) error
ReadFull read data.Object
func (*ObjectService) SetCompleted ¶
func (svc *ObjectService) SetCompleted(ctx context.Context, ns data.Namespace, id data.ObjectID) error
SetCompleted change data.Object status to data.Uploaded
type RefService ¶
type RefService struct {
// contains filtered or unexported fields
}
RefService is service for interaction with data.Ref
func NewRefService ¶
func NewRefService(l logger.Logger, db db.RefRepository) *RefService
NewRefService creates new instance of ObjectService
func (*RefService) Exists ¶
func (svc *RefService) Exists(ctx context.Context, ns data.Namespace, name data.RefName) (bool, error)
Exists checks if data.Ref exist on storage
Click to show internal directories.
Click to hide internal directories.