Documentation ¶
Index ¶
- Constants
- type CategoryService
- func (c *CategoryService) Add(ctx context.Context, category *api.Category) error
- func (c *CategoryService) All(ctx context.Context) ([]api.Category, error)
- func (c *CategoryService) Find(ctx context.Context, id string) (*api.Category, error)
- func (c *CategoryService) FindByPatient(ctx context.Context, id string) ([]api.Category, error)
- func (c *CategoryService) Update(ctx context.Context, category *api.Category) error
- type Client
- func (c *Client) Categories() *mongo.Collection
- func (c *Client) Check(ctx context.Context) (string, error)
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) CreateIndexes(ctx context.Context) error
- func (c *Client) Database() *mongo.Database
- func (c *Client) Disconnect(ctx context.Context) error
- func (c *Client) Records() *mongo.Collection
- type Collection
- func (c *Collection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func (c *Collection) Distinct(ctx context.Context, fieldName string, filter interface{}, ...) ([]interface{}, error)
- func (c *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (datastore.Cursor, error)
- func (c *Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) datastore.Decodable
- func (c *Collection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, ...) datastore.Decodable
- func (c *Collection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
- type Counter
- type RecordService
- func (r *RecordService) All(ctx context.Context) ([]api.Record, error)
- func (r *RecordService) Create(ctx context.Context, data api.CreateRecord, images []storage.Image, ...) (created *api.Record, resErr error)
- func (r *RecordService) Delete(ctx context.Context, id string) error
- func (r *RecordService) Find(ctx context.Context, id string) (*api.Record, error)
- func (r *RecordService) Query(ctx context.Context, recordQuery datastore.RecordQuery, ...) ([]api.Record, error)
- func (r *RecordService) Update(ctx context.Context, id string, record api.Record, ...) (*api.Record, error)
- func (r *RecordService) UpdatePages(ctx context.Context, id string, updates []api.PageUpdate) (*api.Record, error)
- type RecordServiceConfig
- type TagService
Constants ¶
View Source
const ( CollectionCategories = "categories" CollectionRecords = "records" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func NewCategoryService ¶
func NewCategoryService(categories categoryCollection, records distinctFinder) *CategoryService
func (*CategoryService) FindByPatient ¶
type Client ¶
func NewClient ¶
func NewClient(config datastore.DatabaseConfig) *Client
func (*Client) Categories ¶
func (c *Client) Categories() *mongo.Collection
func (*Client) Records ¶
func (c *Client) Records() *mongo.Collection
type Collection ¶
type Collection struct {
*mongo.Collection
}
func NewCollection ¶
func NewCollection(collection *mongo.Collection) *Collection
func (*Collection) DeleteOne ¶
func (c *Collection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func (*Collection) Distinct ¶
func (c *Collection) Distinct(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)
func (*Collection) Find ¶
func (c *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (datastore.Cursor, error)
func (*Collection) FindOne ¶
func (c *Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) datastore.Decodable
func (*Collection) FindOneAndUpdate ¶
func (c *Collection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) datastore.Decodable
func (*Collection) InsertOne ¶
func (c *Collection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
type RecordService ¶
type RecordService struct {
RecordServiceConfig
}
func NewRecordService ¶
func NewRecordService(config RecordServiceConfig) *RecordService
func (*RecordService) Query ¶
func (r *RecordService) Query(ctx context.Context, recordQuery datastore.RecordQuery, queryOptions ...*datastore.QueryOptions) ([]api.Record, error)
func (*RecordService) UpdatePages ¶
func (r *RecordService) UpdatePages(ctx context.Context, id string, updates []api.PageUpdate) (*api.Record, error)
UpdatePages updates the pages of a document without modifying the pages themselves. Useful for deleting multiple pages
type RecordServiceConfig ¶
type RecordServiceConfig struct { Records recordCollection Events event.Sender[*api.Record] Images storage.ResourceWriter Pdfs storage.ResourceWriter }
type TagService ¶
type TagService struct {
// contains filtered or unexported fields
}
func NewTagService ¶
func NewTagService(records distinctFinder) *TagService
Source Files ¶
Click to show internal directories.
Click to hide internal directories.