Documentation
¶
Index ¶
- type Controller
- type Service
- func (s Service) CreateFile(ctx context.Context, req *pb.File) (*pb.CreateFileResponse, error)
- func (s Service) Delete(ctx context.Context, req *pb.DeleteRequest) (*pb.DeleteResponse, error)
- func (s Service) HealthCheck() bool
- func (s Service) Search(ctx context.Context, req *pb.SearchRequest) (*pb.SearchResponse, error)
- func (s Service) Update(ctx context.Context, req *pb.File) (*pb.UpdateResponse, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { CreateFile(ctx context.Context, req *pb.File) (*pb.CreateFileResponse, error) Search(ctx context.Context, req *pb.SearchRequest) (*pb.SearchResponse, error) Delete(ctx context.Context, req *pb.DeleteRequest) (*pb.DeleteResponse, error) Update(ctx context.Context, req *pb.File) (*pb.UpdateResponse, error) HealthCheck(ctx context.Context) (bool, error) }
Controller is an interface for the business logic of the search.Service which uses a Store.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a structure used for handling Search Service grpc requests.
func NewService ¶
func NewService(controller Controller, logger *logrus.Logger) Service
NewService creates a Service and returns it.
func (Service) CreateFile ¶
CreateFile is the request handler for creating a file.
func (Service) Delete ¶
func (s Service) Delete(ctx context.Context, req *pb.DeleteRequest) (*pb.DeleteResponse, error)
Delete is the request handler for deleting a file.
func (Service) HealthCheck ¶
HealthCheck checks the health of the service, returns true if healthy, or false otherwise.
func (Service) Search ¶
func (s Service) Search(ctx context.Context, req *pb.SearchRequest) (*pb.SearchResponse, error)
Search is the request handler for searching a file.
type Store ¶
type Store interface { Create(ctx context.Context, file *pb.File) (string, error) GetAll(ctx context.Context, filter interface{}) ([]string, error) Delete(ctx context.Context, id string) (string, error) Update(ctx context.Context, file *pb.File) (string, error) HealthCheck(ctx context.Context) (bool, error) }
Store is an interface for handling the storing of files.
Click to show internal directories.
Click to hide internal directories.