v2

package
v0.0.6-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BootstrappedService = "V2 Service"

BootstrappedService key maps to the Service implementation in Bootstrap context.

Variables

This section is empty.

Functions

func Register

func Register(ctx map[string]interface{}, r chi.Router)

Register registers the core apis to the router.

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

func (s Service) Commit(ctx context.Context, docID []byte) (documents.Model, jobs.JobID, error)

Commit creates a document out of a pending document.

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.

Jump to

Keyboard shortcuts

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