service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("entity not found")

Functions

This section is empty.

Types

type AccessService

type AccessService interface {
	ListContainers(ctx context.Context) ([]string, error)

	ListPublishedVersions(ctx context.Context, container string) ([]string, error)

	ListObjects(ctx context.Context, container, versionID string) ([]string, error)
	GetObjectURL(ctx context.Context, container, versionID, key string) (string, error)
}

func NewAccessService

func NewAccessService(mdRepo metadata.Repository, blobRepo blob.Repository) AccessService

type ManageService

type ManageService interface {
	AccessService

	CreateContainer(ctx context.Context, name string) error
	DeleteContainer(ctx context.Context, name string) error

	CreateVersion(ctx context.Context, container string) (id string, err error)
	ListAllVersions(ctx context.Context, container string) ([]string, error)
	PublishVersion(ctx context.Context, container, id string) error
	DeleteVersion(ctx context.Context, container, id string) error

	AddObject(ctx context.Context, container, versionID, key string, casKey string) error
	DeleteObject(ctx context.Context, container, versionID, key string) error

	EnsureBLOBPresenceOrGetUploadURL(ctx context.Context, checksum string, size int64) (string, error)
}

func NewManageService

func NewManageService(mdRepo metadata.Repository, blobRepo blob.Repository) ManageService

type Mock

type Mock struct {
	mock.Mock
}

func NewMock

func NewMock() *Mock

func (*Mock) AddObject

func (m *Mock) AddObject(_ context.Context, container, versionID, key, casKey string) error

func (*Mock) CreateContainer

func (m *Mock) CreateContainer(_ context.Context, name string) error

func (*Mock) CreateVersion

func (m *Mock) CreateVersion(_ context.Context, container string) (id string, err error)

func (*Mock) DeleteContainer

func (m *Mock) DeleteContainer(_ context.Context, name string) error

func (*Mock) DeleteObject

func (m *Mock) DeleteObject(_ context.Context, container, versionID, key string) error

func (*Mock) DeleteVersion

func (m *Mock) DeleteVersion(_ context.Context, container, id string) error

func (*Mock) EnsureBLOBPresenceOrGetUploadURL

func (m *Mock) EnsureBLOBPresenceOrGetUploadURL(ctx context.Context, checksum string, size int64) (string, error)

func (*Mock) GetObjectURL

func (m *Mock) GetObjectURL(ctx context.Context, container, versionID, key string) (string, error)

func (*Mock) ListAllVersions

func (m *Mock) ListAllVersions(_ context.Context, container string) ([]string, error)

func (*Mock) ListContainers

func (m *Mock) ListContainers(context.Context) ([]string, error)

func (*Mock) ListObjects

func (m *Mock) ListObjects(_ context.Context, container, versionID string) ([]string, error)

func (*Mock) ListPublishedVersions

func (m *Mock) ListPublishedVersions(_ context.Context, container string) ([]string, error)

func (*Mock) PublishVersion

func (m *Mock) PublishVersion(_ context.Context, container, id string) error

Jump to

Keyboard shortcuts

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