Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeGetFileEndpoint ¶
func MakeGetFileEndpoint(f FileService) endpoint.Endpoint
MakeGetFileEndpoint returns an endpoint via the passed service. Primarily useful in a server.
Types ¶
type FileService ¶
type FileService interface { InitClient() (err error) SaveFile(file FileItem) (err error) GetFile(filePath string) (item FileItem, err error) DeleteFile(filePath string) (err error) }
FileService defines an interface for backend file services
func NewService ¶
func NewService(logger logging.Logger, config S3Config) FileService
NewService returns a new instance of the fileservice
type GetFilePathRequest ¶
type GetFilePathRequest struct {
Path string
}
GetFilePathRequest is used to retrieve a file by a given path
type GetFilePathResponse ¶
type GetFilePathResponse struct { MimeType string `json:"mimeType,omitempty"` Payload []byte `json:"payload,omitempty"` Err error `json:"err,omitempty"` }
GetFilePathResponse returns a file payload
func (GetFilePathResponse) Failed ¶
func (r GetFilePathResponse) Failed() error
Failed implements endpoint.Failer.
type ServiceMiddleware ¶
type ServiceMiddleware func(FileService) FileService
ServiceMiddleware describes a service (as opposed to endpoint) middleware. it is used to intercept the method execution and perform actions before/after the serivce method execution
func ServiceLoggingMiddleware ¶
func ServiceLoggingMiddleware(logger logging.Logger) ServiceMiddleware
ServiceLoggingMiddleware takes a logger as a dependency and returns a ServiceLoggingMiddleware.
Click to show internal directories.
Click to hide internal directories.