{"modulePath":"github.com/dgmann/document-manager","version":"v1.12.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Constants\n\n```go\nconst (\n\tMatchTypeNone  = \"\"\n\tMatchTypeRegex = \"regex\"\n\tMatchTypeExact = \"exact\"\n\tMatchTypeAll   = \"all\"\n\tMatchTypeAny   = \"any\"\n)\n```\n\n```go\nconst (\n\tEventTypeCreated EventType = \"CREATE\"\n\tEventTypeUpdated           = \"UPDATE\"\n\tEventTypeDeleted           = \"DELETE\"\n)\n```\n\n```go\nconst RecordTopic = \"records\"\n```\n\n## Types\n\n```go\ntype Address struct {\n\tStreet  *string `json:\"street\"`\n\tZipCode *string `json:\"zipCode\"`\n\tCity    *string `json:\"city\"`\n}\n```\n\n```go\ntype Category struct {\n\tId    string      `bson:\"_id,omitempty\" json:\"id\"`\n\tName  string      `bson:\"name,omitempty\" json:\"name\"`\n\tMatch MatchConfig `bson:\"match,omitempty\" json:\"match\"`\n}\n```\n\n```go\nfunc NewCategory(id, name string, matchConfig MatchConfig) *Category\n```\n\n```go\ntype CreateRecord struct {\n\tDate       time.Time `form:\"date\" time_format:\"2006-01-02T15:04:05Z07:00\"`\n\tReceivedAt time.Time `form:\"receivedAt\" time_format:\"2006-01-02T15:04:05Z07:00\"`\n\tSender     string    `form:\"sender\"`\n\tComment    *string   `form:\"comment\"`\n\tPatientId  *string   `form:\"patientId\"`\n\tTags       []string  `form:\"tags\"`\n\tStatus     Status    `form:\"status\"`\n\tCategory   *string   `form:\"category\"`\n\tPages      []Page\n}\n```\n\n```go\ntype Event[T any] struct {\n\tType      EventType `json:\"type\"`\n\tTopic     Topic     `json:\"topic\"`\n\tTimestamp time.Time `json:\"timestamp\"`\n\tId        string    `json:\"id\"`\n\tData      T         `json:\"data\"`\n}\n```\n\n```go\nfunc NewEvent[T any](topic Topic, eventType EventType, id string, data T) Event[T]\n```\n\n```go\ntype EventType string\n```\n\n```go\ntype MatchConfig struct {\n\tType       MatchType `bson:\"type,omitempty\" json:\"type\"`\n\tExpression string    `bson:\"expression,omitempty\" json:\"expression\"`\n}\n```\n\n```go\ntype MatchType string\n```\n\n```go\ntype NewRecord struct {\n\tFile       io.Reader\n\tReceivedAt time.Time\n\tSender     string\n\tDate       *time.Time\n\tPatientId  *string\n\tStatus     *Status\n\tComment    *string\n\tCategory   *string\n}\n```\n\n```go\ntype Page struct {\n\tId        string    `bson:\"id\" json:\"id\"`\n\tUrl       string    `json:\"url\"`\n\tContent   *string   `bson:\"content,omitempty\" json:\"content\"`\n\tFormat    string    `bson:\"format\" json:\"format\"`\n\tUpdatedAt time.Time `bson:\"updatedAt\" json:\"updatedAt\"`\n}\n```\n\n```go\nfunc (p *Page) Clone() *Page\n```\n\n```go\ntype PageUpdate struct {\n\tId      string  `json:\"id\"`\n\tRotate  float64 `json:\"rotate,omitempty\"`\n\tContent *string `json:\"content,omitempty\"`\n}\n```\n\n```go\ntype Patient struct {\n\tId        string     `json:\"id\"`\n\tFirstName string     `json:\"firstName\"`\n\tLastName  string     `json:\"lastName\"`\n\tBirthDate *time.Time `json:\"birthDate\"`\n\tAddress   Address    `json:\"address\"`\n}\n```\n\n```go\ntype Record struct {\n\tId          string     `bson:\"_id,omitempty\" json:\"id\"`\n\tDate        *time.Time `bson:\"date,omitempty\" json:\"date\"`\n\tReceivedAt  time.Time  `bson:\"receivedAt,omitempty\" json:\"receivedAt\"`\n\tPatientId   *string    `bson:\"patientId,omitempty\" json:\"patientId\"`\n\tComment     *string    `bson:\"comment,omitempty\" json:\"comment\"`\n\tSender      string     `bson:\"sender,omitempty\" json:\"sender\" form:\"user\" binding:\"required\"`\n\tCategory    *string    `bson:\"category,omitempty\" json:\"category\"`\n\tTags        *[]string  `bson:\"tags,omitempty\" json:\"tags\"`\n\tPages       []Page     `bson:\"pages,omitempty\" json:\"pages\"`\n\tStatus      *Status    `bson:\"status,omitempty\" json:\"status\"`\n\tUpdatedAt   time.Time  `bson:\"updatedAt\" json:\"updatedAt\"`\n\tArchivedPDF string     `json:\"archivedPDF\"`\n}\n```\n\n```go\nfunc (r *Record) Clone() Record\n```\n\n```go\nfunc (r *Record) MarshalJSON() ([]byte, error)\n```\n\n```go\ntype Status string\n```\n\n```go\nconst (\n\tStatusNone      Status = \"\"\n\tStatusInbox     Status = \"inbox\"\n\tStatusEscalated Status = \"escalated\"\n\tStatusReview    Status = \"review\"\n\tStatusOther     Status = \"other\"\n\tStatusDone      Status = \"done\"\n)\n```\n\n```go\nfunc (s *Status) IsNone() bool\n```\n\n```go\nfunc (s *Status) IsValid() bool\n```\n\n```go\nfunc (s *Status) Status() Status\n```\n\n```go\nfunc (s *Status) String() string\n```\n\n```go\ntype Topic string\n```\n\n","path":"github.com/dgmann/document-manager/pkg/api","name":"api","synopsis":"","isRedistributable":true}
