Documentation ¶
Index ¶
- Constants
- func Register(ctx map[string]interface{}, r chi.Router)
- type Bootstrapper
- type CreateDocumentRequest
- type DocumentRequest
- type Service
- func (s Service) Commit(ctx context.Context, docID []byte) (documents.Model, jobs.JobID, error)
- func (s Service) CreateDocument(ctx context.Context, req documents.UpdatePayload) (documents.Model, error)
- func (s Service) GetDocument(ctx context.Context, docID []byte, status documents.Status) (documents.Model, error)
- func (s Service) GetDocumentVersion(ctx context.Context, docID, versionID []byte) (documents.Model, error)
- func (s Service) UpdateDocument(ctx context.Context, req documents.UpdatePayload) (documents.Model, error)
- type UpdateDocumentRequest
Constants ¶
const BootstrappedService = "V2 Service"
BootstrappedService key maps to the Service implementation in Bootstrap context.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bootstrapper ¶
type Bootstrapper struct{}
Bootstrapper implements bootstrap.Bootstrapper.
func (Bootstrapper) Bootstrap ¶
func (b Bootstrapper) Bootstrap(ctx map[string]interface{}) error
Bootstrap adds transaction.Repository into context.
type CreateDocumentRequest ¶
type CreateDocumentRequest struct { DocumentRequest DocumentID byteutils.OptionalHex `json:"document_id" swaggertype:"primitive,string"` // if provided, creates the next version of the document. }
CreateDocumentRequest defines the payload for creating documents.
type DocumentRequest ¶
type DocumentRequest = coreapi.CreateDocumentRequest
DocumentRequest is an alias to coreapi Document request. Aliased here to fix the swagger generation issues.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the entry point for all the V2 APIs.
func (Service) CreateDocument ¶
func (s Service) CreateDocument(ctx context.Context, req documents.UpdatePayload) (documents.Model, error)
CreateDocument creates a pending document from the given payload. if the document_id is provided, next version of the document is created.
func (Service) GetDocument ¶
func (s Service) GetDocument(ctx context.Context, docID []byte, status documents.Status) (documents.Model, error)
GetDocument returns the document associated with docID and status.
func (Service) GetDocumentVersion ¶
func (s Service) GetDocumentVersion(ctx context.Context, docID, versionID []byte) (documents.Model, error)
GetDocumentVersion returns the specific version of the document.
func (Service) UpdateDocument ¶
func (s Service) UpdateDocument(ctx context.Context, req documents.UpdatePayload) (documents.Model, error)
UpdateDocument updates a pending document with the given payload
type UpdateDocumentRequest ¶
type UpdateDocumentRequest struct {
DocumentRequest
}
UpdateDocumentRequest defines the payload to patch an existing document.