Documentation ¶
Index ¶
Constants ¶
View Source
const CollectionName = "patients"
Variables ¶
View Source
var ErrNotFound = errors.New("patient not found")
Functions ¶
func RecordHash ¶
func RecordHash(r v1alpha.PatientRecord) string
RecordHash returns a hash that represents the record and may be used for change detection.
Types ¶
type Database ¶
type Database interface { CreatePatient(ctx context.Context, record *v1alpha.PatientRecord) error Search(ctx context.Context, opts *SearchOptions) ([]v1alpha.PatientRecord, error) UpdatePatient(ctx context.Context, record *v1alpha.PatientRecord) error DeletePatient(ctx context.Context, id string) error ByCustomerAndAnimalID(ctx context.Context, source string, cid string, aid string) (*v1alpha.PatientRecord, error) Stats() *dbutils.Stats }
type SearchOptions ¶
type SearchOptions struct {
dbutils.SimpleQueryBuilder
}
func (*SearchOptions) ByAnimalNumber ¶
func (opts *SearchOptions) ByAnimalNumber(id string) *SearchOptions
func (*SearchOptions) ByCustomer ¶
func (opts *SearchOptions) ByCustomer(source string, id string) *SearchOptions
Click to show internal directories.
Click to hide internal directories.