Documentation ¶
Index ¶
- type DataContext
- type DocumentRepository
- func (dr DocumentRepository) Add(document domain.Document, parentID string, spaceID string) (string, error)
- func (dr DocumentRepository) Delete(id string) error
- func (dr DocumentRepository) Get(documentID string) (domain.Document, error)
- func (dr DocumentRepository) List(ctx context.Context, spaceID string) ([]application.DocumentListItem, error)
- func (dr DocumentRepository) Update(id string, p domain.Document) error
- type HealthRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataContext ¶
type DataContext struct { DocumentRepository DocumentRepository HealthRepository HealthRepository }
DataContext represents a struct that holds concrete repositories
func NewDataContext ¶
func NewDataContext() (DataContext, error)
NewDataContext returns a new mongoDB backed DataContext
type DocumentRepository ¶
type DocumentRepository struct {
// contains filtered or unexported fields
}
DocumentRepository holds the arangodb client and database name for methods to use
func (DocumentRepository) Add ¶
func (dr DocumentRepository) Add(document domain.Document, parentID string, spaceID string) (string, error)
AddItem adds a new document or a new folder to the underlying database. It returns the document inserted on success or error
func (DocumentRepository) Delete ¶
func (dr DocumentRepository) Delete(id string) error
Delete selects a single document from the database with the given unique identifier Returns an error if database fails to provide service
func (DocumentRepository) Get ¶
func (dr DocumentRepository) Get(documentID string) (domain.Document, error)
Get selects a single document from the database with the given unique identifier Returns an error if database fails to provide service
func (DocumentRepository) List ¶
func (dr DocumentRepository) List(ctx context.Context, spaceID string) ([]application.DocumentListItem, error)
List loads all the document records from tha database and returns it Returns an error if database fails to provide service
type HealthRepository ¶
type HealthRepository struct {
// contains filtered or unexported fields
}
HealthRepository represent a structure that will communicate to MongoDB to accomplish health related transactions
func (HealthRepository) Ready ¶
func (hr HealthRepository) Ready() bool
Ready checks the arangodb connection