Documentation ¶
Overview ¶
Package domain defines data structures for moving data between services.
Package domain ...
Index ¶
- Constants
- type AccountStorer
- type ActivityStorer
- type AttachmentStorer
- type AuditStorer
- type BlockStorer
- type DocumentStorer
- type Indexer
- type LinkStorer
- type OrganizationStorer
- type PageStorer
- type PinStorer
- type RequestContext
- type SearchStorer
- type SettingStorer
- type SpaceStorer
- type Store
- type UserStorer
Constants ¶
const DocumizeContextKey key = "documize context key"
DocumizeContextKey prevents key name collisions.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountStorer ¶
type AccountStorer interface { Add(ctx RequestContext, account account.Account) (err error) GetUserAccount(ctx RequestContext, userID string) (account account.Account, err error) GetUserAccounts(ctx RequestContext, userID string) (t []account.Account, err error) GetAccountsByOrg(ctx RequestContext) (t []account.Account, err error) DeleteAccount(ctx RequestContext, ID string) (rows int64, err error) UpdateAccount(ctx RequestContext, account account.Account) (err error) HasOrgAccount(ctx RequestContext, orgID, userID string) bool CountOrgAccounts(ctx RequestContext) int }
AccountStorer defines required methods for account management
type ActivityStorer ¶
type ActivityStorer interface { RecordUserActivity(ctx RequestContext, activity activity.UserActivity) (err error) GetDocumentActivity(ctx RequestContext, id string) (a []activity.DocumentActivity, err error) }
ActivityStorer defines required methods for persisting document activity
type AttachmentStorer ¶
type AttachmentStorer interface { Add(ctx RequestContext, a attachment.Attachment) (err error) GetAttachment(ctx RequestContext, orgID, attachmentID string) (a attachment.Attachment, err error) GetAttachments(ctx RequestContext, docID string) (a []attachment.Attachment, err error) GetAttachmentsWithData(ctx RequestContext, docID string) (a []attachment.Attachment, err error) Delete(ctx RequestContext, id string) (rows int64, err error) }
AttachmentStorer defines required methods for persisting document attachments
type AuditStorer ¶
type AuditStorer interface {
Record(ctx RequestContext, t audit.EventType)
}
AuditStorer defines required methods for audit trails
type BlockStorer ¶
type BlockStorer interface { Add(ctx RequestContext, b block.Block) (err error) Get(ctx RequestContext, id string) (b block.Block, err error) GetBySpace(ctx RequestContext, spaceID string) (b []block.Block, err error) IncrementUsage(ctx RequestContext, id string) (err error) DecrementUsage(ctx RequestContext, id string) (err error) RemoveReference(ctx RequestContext, id string) (err error) Update(ctx RequestContext, b block.Block) (err error) Delete(ctx RequestContext, id string) (rows int64, err error) }
BlockStorer defines required methods for persisting reusable content blocks
type DocumentStorer ¶
type DocumentStorer interface { Add(ctx RequestContext, document doc.Document) (err error) Get(ctx RequestContext, id string) (document doc.Document, err error) GetAll() (ctx RequestContext, documents []doc.Document, err error) GetBySpace(ctx RequestContext, folderID string) (documents []doc.Document, err error) GetByTag(ctx RequestContext, tag string) (documents []doc.Document, err error) DocumentList(ctx RequestContext) (documents []doc.Document, err error) Templates(ctx RequestContext) (documents []doc.Document, err error) TemplatesBySpace(ctx RequestContext, spaceID string) (documents []doc.Document, err error) DocumentMeta(ctx RequestContext, id string) (meta doc.DocumentMeta, err error) PublicDocuments(ctx RequestContext, orgID string) (documents []doc.SitemapDocument, err error) Update(ctx RequestContext, document doc.Document) (err error) ChangeDocumentSpace(ctx RequestContext, document, space string) (err error) MoveDocumentSpace(ctx RequestContext, id, move string) (err error) Delete(ctx RequestContext, documentID string) (rows int64, err error) }
DocumentStorer defines required methods for document handling
type Indexer ¶
type Indexer interface { IndexDocument(ctx RequestContext, d doc.Document, a []attachment.Attachment) DeleteDocument(ctx RequestContext, ID string) IndexContent(ctx RequestContext, p page.Page) DeleteContent(ctx RequestContext, pageID string) }
Indexer defines required methods for managing search indexing process
type LinkStorer ¶
type LinkStorer interface { Add(ctx RequestContext, l link.Link) (err error) SearchCandidates(ctx RequestContext, keywords string) (docs []link.Candidate, pages []link.Candidate, attachments []link.Candidate, err error) GetDocumentOutboundLinks(ctx RequestContext, documentID string) (links []link.Link, err error) GetPageLinks(ctx RequestContext, documentID, pageID string) (links []link.Link, err error) MarkOrphanDocumentLink(ctx RequestContext, documentID string) (err error) MarkOrphanPageLink(ctx RequestContext, pageID string) (err error) MarkOrphanAttachmentLink(ctx RequestContext, attachmentID string) (err error) DeleteSourcePageLinks(ctx RequestContext, pageID string) (rows int64, err error) DeleteSourceDocumentLinks(ctx RequestContext, documentID string) (rows int64, err error) DeleteLink(ctx RequestContext, id string) (rows int64, err error) }
LinkStorer defines required methods for persisting content links
type OrganizationStorer ¶
type OrganizationStorer interface { AddOrganization(ctx RequestContext, org org.Organization) error GetOrganization(ctx RequestContext, id string) (org org.Organization, err error) GetOrganizationByDomain(subdomain string) (org org.Organization, err error) UpdateOrganization(ctx RequestContext, org org.Organization) (err error) DeleteOrganization(ctx RequestContext, orgID string) (rows int64, err error) RemoveOrganization(ctx RequestContext, orgID string) (err error) UpdateAuthConfig(ctx RequestContext, org org.Organization) (err error) CheckDomain(ctx RequestContext, domain string) string }
OrganizationStorer defines required methods for organization management
type PageStorer ¶
type PageStorer interface { Add(ctx RequestContext, model page.NewPage) (err error) Get(ctx RequestContext, pageID string) (p page.Page, err error) GetPages(ctx RequestContext, documentID string) (p []page.Page, err error) GetPagesWhereIn(ctx RequestContext, documentID, inPages string) (p []page.Page, err error) GetPagesWithoutContent(ctx RequestContext, documentID string) (pages []page.Page, err error) Update(ctx RequestContext, page page.Page, refID, userID string, skipRevision bool) (err error) UpdateMeta(ctx RequestContext, meta page.Meta, updateUserID bool) (err error) UpdateSequence(ctx RequestContext, documentID, pageID string, sequence float64) (err error) UpdateLevel(ctx RequestContext, documentID, pageID string, level int) (err error) Delete(ctx RequestContext, documentID, pageID string) (rows int64, err error) GetPageMeta(ctx RequestContext, pageID string) (meta page.Meta, err error) GetPageRevision(ctx RequestContext, revisionID string) (revision page.Revision, err error) GetPageRevisions(ctx RequestContext, pageID string) (revisions []page.Revision, err error) GetDocumentRevisions(ctx RequestContext, documentID string) (revisions []page.Revision, err error) GetDocumentPageMeta(ctx RequestContext, documentID string, externalSourceOnly bool) (meta []page.Meta, err error) DeletePageRevisions(ctx RequestContext, pageID string) (rows int64, err error) GetNextPageSequence(ctx RequestContext, documentID string) (maxSeq float64, err error) }
PageStorer defines required methods for persisting document pages
type PinStorer ¶
type PinStorer interface { Add(ctx RequestContext, pin pin.Pin) (err error) GetPin(ctx RequestContext, id string) (pin pin.Pin, err error) GetUserPins(ctx RequestContext, userID string) (pins []pin.Pin, err error) UpdatePin(ctx RequestContext, pin pin.Pin) (err error) UpdatePinSequence(ctx RequestContext, pinID string, sequence int) (err error) DeletePin(ctx RequestContext, id string) (rows int64, err error) DeletePinnedSpace(ctx RequestContext, spaceID string) (rows int64, err error) DeletePinnedDocument(ctx RequestContext, documentID string) (rows int64, err error) }
PinStorer defines required methods for pin management
type RequestContext ¶
type RequestContext struct { AllowAnonymousAccess bool Authenticated bool Administrator bool Guest bool Editor bool Global bool UserID string OrgID string OrgName string SSL bool AppURL string // e.g. https://{url}.documize.com Subdomain string ClientIP string Expires time.Time Fullname string Transaction *sqlx.Tx }
RequestContext provides per request scoped values required by HTTP handlers.
func GetRequestContext ¶
func GetRequestContext(r *http.Request) (ctx RequestContext)
GetRequestContext returns RequestContext from context.Context
func (*RequestContext) GetAppURL ¶
func (c *RequestContext) GetAppURL(endpoint string) string
GetAppURL returns full HTTP url for the app
type SearchStorer ¶
type SearchStorer interface { IndexDocument(ctx RequestContext, doc doc.Document, a []attachment.Attachment) (err error) DeleteDocument(ctx RequestContext, ID string) (err error) IndexContent(ctx RequestContext, p page.Page) (err error) DeleteContent(ctx RequestContext, pageID string) (err error) Documents(ctx RequestContext, q search.QueryOptions) (results []search.QueryResult, err error) }
SearchStorer defines required methods for persisting search queries
type SettingStorer ¶
type SettingStorer interface { Get(area, path string) string Set(area, value string) error GetUser(orgID, userID, area, path string) string SetUser(orgID, userID, area, json string) error }
SettingStorer defines required methods for persisting global and user level settings
type SpaceStorer ¶
type SpaceStorer interface { Add(ctx RequestContext, sp space.Space) (err error) Get(ctx RequestContext, id string) (sp space.Space, err error) PublicSpaces(ctx RequestContext, orgID string) (sp []space.Space, err error) GetAll(ctx RequestContext) (sp []space.Space, err error) Update(ctx RequestContext, sp space.Space) (err error) ChangeOwner(ctx RequestContext, currentOwner, newOwner string) (err error) Viewers(ctx RequestContext) (v []space.Viewer, err error) Delete(ctx RequestContext, id string) (rows int64, err error) AddRole(ctx RequestContext, r space.Role) (err error) GetRoles(ctx RequestContext, labelID string) (r []space.Role, err error) GetUserRoles(ctx RequestContext) (r []space.Role, err error) DeleteRole(ctx RequestContext, roleID string) (rows int64, err error) DeleteSpaceRoles(ctx RequestContext, spaceID string) (rows int64, err error) DeleteUserSpaceRoles(ctx RequestContext, spaceID, userID string) (rows int64, err error) MoveSpaceRoles(ctx RequestContext, previousLabel, newLabel string) (err error) }
SpaceStorer defines required methods for space management
type Store ¶
type Store struct { Account AccountStorer Activity ActivityStorer Attachment AttachmentStorer Audit AuditStorer Block BlockStorer Document DocumentStorer Link LinkStorer Organization OrganizationStorer Page PageStorer Pin PinStorer Search SearchStorer Setting SettingStorer Space SpaceStorer User UserStorer }
Store provides access to data store (database)
type UserStorer ¶
type UserStorer interface { Add(ctx RequestContext, u user.User) (err error) Get(ctx RequestContext, id string) (u user.User, err error) GetByDomain(ctx RequestContext, domain, email string) (u user.User, err error) GetByEmail(ctx RequestContext, email string) (u user.User, err error) GetByToken(ctx RequestContext, token string) (u user.User, err error) GetBySerial(ctx RequestContext, serial string) (u user.User, err error) GetActiveUsersForOrganization(ctx RequestContext) (u []user.User, err error) GetUsersForOrganization(ctx RequestContext) (u []user.User, err error) GetSpaceUsers(ctx RequestContext, folderID string) (u []user.User, err error) GetVisibleUsers(ctx RequestContext) (u []user.User, err error) UpdateUser(ctx RequestContext, u user.User) (err error) UpdateUserPassword(ctx RequestContext, userID, salt, password string) (err error) DeactiveUser(ctx RequestContext, userID string) (err error) ForgotUserPassword(ctx RequestContext, email, token string) (err error) CountActiveUsers() (c int) }
UserStorer defines required methods for user management
Directories ¶
Path | Synopsis |
---|---|
account
|
|
activity
|
|
audit
|
|
mysql
Package audit records user events.
|
Package audit records user events. |
store
Package store provides the implementation for a file system based storage provider.
|
Package store provides the implementation for a file system based storage provider. |
Package mail sends transactional emails.
|
Package mail sends transactional emails. |
Package setting manages both global and user level settings
|
Package setting manages both global and user level settings |
Package space handles API calls and persistence for spaces.
|
Package space handles API calls and persistence for spaces. |
mysql
Package mysql handles data persistence for spaces.
|
Package mysql handles data persistence for spaces. |
store
|
|