text

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 text data not found")
)

Functions

This section is empty.

Types

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) DeleteText

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

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

func (Service) GetAllTexts

func (s Service) GetAllTexts(ctx context.Context, uid string) ([]Text, error)

GetAllTexts returns all the user's stored texts.

func (Service) GetTextByID

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

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

func (Service) StoreText

func (s Service) StoreText(ctx context.Context, text Text) (string, error)

StoreText stores the original text via the associated data microservice.

type Text

type Text struct {
	UID  string `json:"-"`
	ID   string `json:"id"`
	Name string `json:"name"`
	Data string `json:"data"`
	Note string `json:"note"`
}

Jump to

Keyboard shortcuts

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