usecases

package
v0.0.0-...-0e8bb44 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCantRead    = myerrors.NewErrorBadFormatRequest("Не получилось считать содержимое файла из тела запроса")
	ErrWrongFormat = myerrors.NewErrorBadContentRequest("Формат файла должен быть png, jpeg")
)

Functions

func HashContent

func HashContent(content []byte) (string, error)

Types

type FileServiceGrpc

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

func NewFileServiceGrpc

func NewFileServiceGrpc(urlPrefixPath string, fileStorage IFileStorageGrpc) *FileServiceGrpc

func (*FileServiceGrpc) Check

func (f *FileServiceGrpc) Check(ctx context.Context, urls []string) ([]bool, error)

type FileServiceHTTP

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

func NewFileServiceHTTP

func NewFileServiceHTTP(fileStorage IFileStorageHTTP, urlPrefixPath string) (*FileServiceHTTP, error)

func (*FileServiceHTTP) SaveImage

func (f *FileServiceHTTP) SaveImage(reader io.Reader) (string, error)

type IFileStorageGrpc

type IFileStorageGrpc interface {
	Check(ctx context.Context, files []string) ([]bool, error)
}

type IFileStorageHTTP

type IFileStorageHTTP interface {
	SaveFile(content []byte, fileName string) error
}

Jump to

Keyboard shortcuts

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