service

package
v0.0.0-...-1e80c8a Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileContentService

type FileContentService interface {
	Upload(context.Context, uuid.UUID, []byte) error
	Download(context.Context, uuid.UUID) ([]byte, *model.DBFile, error)
}

FileContentService is a service to upload file content

type FileContentSvc

type FileContentSvc struct {
	// contains filtered or unexported fields
}

FileContentSvc ...

func NewFileContentSvc

func NewFileContentSvc(ctx context.Context, store *store.Store) *FileContentSvc

NewFileContentSvc creates a new file content service

func (*FileContentSvc) Download

func (svc *FileContentSvc) Download(ctx context.Context, fileID uuid.UUID) ([]byte, *model.DBFile, error)

Download file content from the cloud

func (*FileContentSvc) Upload

func (svc *FileContentSvc) Upload(ctx context.Context, fileID uuid.UUID, fileBody []byte) error

Upload file content to the cloud

type FileMetaService

type FileMetaService interface {
	GetFileMeta(context.Context, uuid.UUID) (*model.File, error)
	CreateFileMeta(context.Context, *model.File) (*model.File, error)
	UpdateFileMeta(context.Context, *model.File) (*model.File, error)
	DeleteFileMeta(context.Context, uuid.UUID) error
}

FileMetaService is a service for files

type FileMetaSvc

type FileMetaSvc struct {
	// contains filtered or unexported fields
}

FileMetaSvc ...

func NewFileMetaSvc

func NewFileMetaSvc(ctx context.Context, store *store.Store) *FileMetaSvc

NewFileMetaSvc creates a new file web service

func (FileMetaSvc) CreateFileMeta

func (svc FileMetaSvc) CreateFileMeta(ctx context.Context, reqFile *model.File) (*model.File, error)

CreateFileMeta ...

func (*FileMetaSvc) DeleteFileMeta

func (svc *FileMetaSvc) DeleteFileMeta(ctx context.Context, fileID uuid.UUID) error

DeleteFileMeta ...

func (*FileMetaSvc) GetFileMeta

func (svc *FileMetaSvc) GetFileMeta(ctx context.Context, fileID uuid.UUID) (*model.File, error)

GetFileMeta ...

func (*FileMetaSvc) UpdateFileMeta

func (svc *FileMetaSvc) UpdateFileMeta(ctx context.Context, reqFile *model.File) (*model.File, error)

UpdateFileMeta ...

type Manager

type Manager struct {
	User        UserService
	FileMeta    FileMetaService
	FileContent FileContentService
}

Manager is just a collection of all services we have in the project

func NewManager

func NewManager(ctx context.Context, store *store.Store) (*Manager, error)

NewManager creates new service manager

type UserService

type UserService interface {
	GetUser(context.Context, uuid.UUID) (*model.User, error)
	CreateUser(context.Context, *model.User) (*model.User, error)
	UpdateUser(context.Context, *model.User) (*model.User, error)
	DeleteUser(context.Context, uuid.UUID) error
}

UserService is a service for users

type UserWebService

type UserWebService struct {
	// contains filtered or unexported fields
}

UserWebService ...

func NewUserWebService

func NewUserWebService(ctx context.Context, store *store.Store) *UserWebService

NewUserWebService creates a new user web service

func (UserWebService) CreateUser

func (svc UserWebService) CreateUser(ctx context.Context, reqUser *model.User) (*model.User, error)

CreateUser ...

func (*UserWebService) DeleteUser

func (svc *UserWebService) DeleteUser(ctx context.Context, userID uuid.UUID) error

DeleteUser ...

func (*UserWebService) GetUser

func (svc *UserWebService) GetUser(ctx context.Context, userID uuid.UUID) (*model.User, error)

GetUser ...

func (*UserWebService) UpdateUser

func (svc *UserWebService) UpdateUser(ctx context.Context, reqUser *model.User) (*model.User, error)

UpdateUser ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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