Documentation ¶
Overview ¶
Package http DocumentManager API.
The purpose of this application is to provide an api to store uploaded PDFs as images and serve them to various frontends ¶
Terms Of Service:
there are no TOS at this moment, use at your own risk we take no responsibility
Schemes: http Host: localhost BasePath: /api Version: 0.0.1 Consumes: - application/json - multipart/form-data Produces: - application/json
swagger:meta
Index ¶
- Variables
- func EtagFromHeader(header http.Header) (time.Time, error)
- func SetURLForRecord(record *api.Record, url url.URL) interface{}
- func SetURLForRecordList(records []api.Record, url url.URL) interface{}
- func URLParamFromContext(ctx context.Context, key string) string
- type ArchiveController
- type BinaryResponse
- type CategoryController
- func (controller *CategoryController) All(w http.ResponseWriter, req *http.Request)
- func (controller *CategoryController) Create(w http.ResponseWriter, req *http.Request)
- func (controller *CategoryController) Find(w http.ResponseWriter, req *http.Request)
- func (controller *CategoryController) Router() http.Handler
- func (controller *CategoryController) Update(w http.ResponseWriter, req *http.Request)
- type Client
- type ControllerOption
- func WithArchiveController(archiveService storage.ResourceLocator) ControllerOption
- func WithCategoryController(service datastore.CategoryService) ControllerOption
- func WithCounterController(counter datastore.Counter) ControllerOption
- func WithExportController(recordService datastore.RecordService, pdfCreator pdf.Creator) ControllerOption
- func WithHealthController(healthService *status.HealthService) ControllerOption
- func WithNotificationController(eventService event.Subscriber) ControllerOption
- func WithPatientController(recordService datastore.RecordService, imageService storage.ImageService, ...) ControllerOption
- func WithRecordController(recordService datastore.RecordService, imageService storage.ImageService, ...) ControllerOption
- func WithStatisticController(statisticsService *status.StatisticsService) ControllerOption
- func WithTagController(tagService datastore.TagService) ControllerOption
- type DataResponse
- type ETag
- type ErrorResponse
- type ExporterController
- type HealthController
- type PatientController
- func (controller *PatientController) Categories(w http.ResponseWriter, req *http.Request)
- func (controller *PatientController) Records(w http.ResponseWriter, req *http.Request)
- func (controller *PatientController) Router() http.Handler
- func (controller *PatientController) Tags(w http.ResponseWriter, req *http.Request)
- type RecordController
- func (controller *RecordController) All(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) Append(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) Create(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) Delete(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) Duplicate(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) One(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) Page(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) Reset(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) Router() http.Handler
- func (controller *RecordController) Update(w http.ResponseWriter, req *http.Request)
- func (controller *RecordController) UpdatePages(w http.ResponseWriter, req *http.Request)
- type Response
- type Server
- type StatisticsController
- type TagController
- type WebsocketController
- type WebsocketService
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoEtagHeader = errors.New("no If-Match header found")
View Source
var (
PathPrefix = "/api"
)
Functions ¶
Types ¶
type ArchiveController ¶
type ArchiveController struct {
// contains filtered or unexported fields
}
func (*ArchiveController) One ¶
func (a *ArchiveController) One(w http.ResponseWriter, req *http.Request)
type BinaryResponse ¶
BinaryResponse extends Response with a binary data payload.
func NewBinaryResponseWithStatus ¶
func NewBinaryResponseWithStatus(writer http.ResponseWriter, data []byte, code int) *BinaryResponse
func (*BinaryResponse) SetContentTypeFromExtension ¶
func (r *BinaryResponse) SetContentTypeFromExtension(ex string) *BinaryResponse
func (*BinaryResponse) Write ¶
func (r *BinaryResponse) Write()
type CategoryController ¶
type CategoryController struct {
// contains filtered or unexported fields
}
func (*CategoryController) All ¶
func (controller *CategoryController) All(w http.ResponseWriter, req *http.Request)
func (*CategoryController) Create ¶
func (controller *CategoryController) Create(w http.ResponseWriter, req *http.Request)
func (*CategoryController) Find ¶
func (controller *CategoryController) Find(w http.ResponseWriter, req *http.Request)
func (*CategoryController) Router ¶
func (controller *CategoryController) Router() http.Handler
func (*CategoryController) Update ¶
func (controller *CategoryController) Update(w http.ResponseWriter, req *http.Request)
type ControllerOption ¶
type ControllerOption = func(rootMux *chi.Mux)
func WithArchiveController ¶
func WithArchiveController(archiveService storage.ResourceLocator) ControllerOption
func WithCategoryController ¶
func WithCategoryController(service datastore.CategoryService) ControllerOption
func WithCounterController ¶
func WithCounterController(counter datastore.Counter) ControllerOption
func WithExportController ¶
func WithExportController(recordService datastore.RecordService, pdfCreator pdf.Creator) ControllerOption
func WithHealthController ¶
func WithHealthController(healthService *status.HealthService) ControllerOption
func WithNotificationController ¶
func WithNotificationController(eventService event.Subscriber) ControllerOption
func WithPatientController ¶
func WithPatientController(recordService datastore.RecordService, imageService storage.ImageService, categoryService datastore.CategoryService, tagService datastore.TagService) ControllerOption
func WithRecordController ¶
func WithRecordController(recordService datastore.RecordService, imageService storage.ImageService, archiveService storage.ArchiveService, pdfProcessor pdf.Processor) ControllerOption
func WithStatisticController ¶
func WithStatisticController(statisticsService *status.StatisticsService) ControllerOption
func WithTagController ¶
func WithTagController(tagService datastore.TagService) ControllerOption
type DataResponse ¶
type DataResponse struct { Response Data interface{} }
DataResponse extends Response a generic payload.
func NewResponse ¶
func NewResponse(writer http.ResponseWriter, data interface{}) *DataResponse
func NewResponseWithStatus ¶
func NewResponseWithStatus(writer http.ResponseWriter, data interface{}, code int) *DataResponse
func (*DataResponse) SetEtag ¶
func (r *DataResponse) SetEtag(etag ETag) *DataResponse
func (*DataResponse) WriteJSON ¶
func (r *DataResponse) WriteJSON()
type ErrorResponse ¶
ErrorResponse indicates an error and provides the error message.
func NewErrorResponse ¶
func NewErrorResponse(writer http.ResponseWriter, err error, code int) *ErrorResponse
func (*ErrorResponse) WriteJSON ¶
func (r *ErrorResponse) WriteJSON()
type ExporterController ¶
type ExporterController struct {
// contains filtered or unexported fields
}
func (*ExporterController) Export ¶
func (t *ExporterController) Export(w http.ResponseWriter, req *http.Request)
type HealthController ¶
type HealthController struct {
// contains filtered or unexported fields
}
func (*HealthController) Status ¶
func (h *HealthController) Status(w http.ResponseWriter, req *http.Request)
type PatientController ¶
type PatientController struct {
// contains filtered or unexported fields
}
func (*PatientController) Categories ¶
func (controller *PatientController) Categories(w http.ResponseWriter, req *http.Request)
func (*PatientController) Records ¶
func (controller *PatientController) Records(w http.ResponseWriter, req *http.Request)
func (*PatientController) Router ¶
func (controller *PatientController) Router() http.Handler
func (*PatientController) Tags ¶
func (controller *PatientController) Tags(w http.ResponseWriter, req *http.Request)
type RecordController ¶
type RecordController struct {
// contains filtered or unexported fields
}
func (*RecordController) All ¶
func (controller *RecordController) All(w http.ResponseWriter, req *http.Request)
func (*RecordController) Append ¶
func (controller *RecordController) Append(w http.ResponseWriter, req *http.Request)
func (*RecordController) Create ¶
func (controller *RecordController) Create(w http.ResponseWriter, req *http.Request)
func (*RecordController) Delete ¶
func (controller *RecordController) Delete(w http.ResponseWriter, req *http.Request)
func (*RecordController) Duplicate ¶
func (controller *RecordController) Duplicate(w http.ResponseWriter, req *http.Request)
func (*RecordController) One ¶
func (controller *RecordController) One(w http.ResponseWriter, req *http.Request)
func (*RecordController) Page ¶
func (controller *RecordController) Page(w http.ResponseWriter, req *http.Request)
func (*RecordController) Reset ¶
func (controller *RecordController) Reset(w http.ResponseWriter, req *http.Request)
func (*RecordController) Router ¶
func (controller *RecordController) Router() http.Handler
func (*RecordController) Update ¶
func (controller *RecordController) Update(w http.ResponseWriter, req *http.Request)
Update updates a Records It supports an If-Modified header containing the Etag received from a previous request
func (*RecordController) UpdatePages ¶
func (controller *RecordController) UpdatePages(w http.ResponseWriter, req *http.Request)
type Response ¶
type Response struct { StatusCode int // contains filtered or unexported fields }
Response serves as the base and most generic form of response
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(serviceName string, options ...ControllerOption) *Server
type StatisticsController ¶
type StatisticsController struct {
// contains filtered or unexported fields
}
func (*StatisticsController) Statistics ¶
func (h *StatisticsController) Statistics(w http.ResponseWriter, req *http.Request)
type TagController ¶
type TagController struct {
// contains filtered or unexported fields
}
func (*TagController) All ¶
func (t *TagController) All(w http.ResponseWriter, req *http.Request)
type WebsocketController ¶
type WebsocketController struct {
Subscriber event.Subscriber
}
type WebsocketService ¶
type WebsocketService struct {
// contains filtered or unexported fields
}
func NewWebSocketService ¶
func NewWebSocketService() *WebsocketService
func (*WebsocketService) AddClient ¶
func (ws *WebsocketService) AddClient(client *Client)
func (*WebsocketService) GetClient ¶
func (ws *WebsocketService) GetClient(session *melody.Session) *Client
func (*WebsocketService) RemoveClient ¶
func (ws *WebsocketService) RemoveClient(session *melody.Session)
Click to show internal directories.
Click to hide internal directories.