services

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package services contains main business logic

Index

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

func (*ObjectService) StoreStream

func (svc *ObjectService) StoreStream(ctx context.Context, ns data.Namespace, id data.ObjectID, size int64, reader io.Reader) error

StoreStream save data.Object

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

func (*RefService) GetRef

func (svc *RefService) GetRef(ctx context.Context, ns data.Namespace, name data.RefName) (*data.Ref, error)

GetRef returns data.Ref from database

func (*RefService) StoreRef

func (svc *RefService) StoreRef(ctx context.Context, ns data.Namespace, name data.RefName, commit data.Commit, force bool) error

StoreRef persists data.Ref to database

Jump to

Keyboard shortcuts

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