binary

package
v0.0.0-...-9192568 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid  = errors.New("passed text data is invalid")
	ErrNotFound = errors.New("requested binary data not found")
)

Functions

This section is empty.

Types

type Binary

type Binary struct {
	UID  string `json:"-"`
	ID   string `json:"id"`
	Name string `json:"name"`
	Data []byte `json:"data"`
	Note string `json:"note"`
}

type Service

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

func NewService

func NewService(dataService data.Service) Service

NewService returns an instance of the Service with pre-defined data microservice.

func (Service) DeleteBinary

func (s Service) DeleteBinary(ctx context.Context, uid, id string) error

DeleteBinary removes the stored data with the unique ID. The method removes the data of the specified user only.

func (Service) GetAllBinaries

func (s Service) GetAllBinaries(ctx context.Context, uid string) ([]Binary, error)

GetAllBinaries returns all the user's stored binaries.

func (Service) GetBinaryByID

func (s Service) GetBinaryByID(ctx context.Context, uid, id string) (Binary, error)

GetBinaryByID returns the stored data by the unique ID. The method returns the data of the specified user only.

func (Service) StoreBinary

func (s Service) StoreBinary(ctx context.Context, uid string, binary Binary) (string, error)

StoreBinary stores the original binary via the associated data microservice.

Jump to

Keyboard shortcuts

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