Documentation ¶
Index ¶
- func GenerateShortID() (string, error)
- func MakeIndexes() error
- func OpenDBSession(url string) (err error)
- type Account
- type AccountEmail
- type AccountPassword
- type Document
- type Member
- func GetMember(id bson.ObjectId) (*Member, error)
- func GetMemberProjectAccount(pID bson.ObjectId, aID bson.ObjectId) (*Member, error)
- func ListMembersAccount(accID bson.ObjectId, skip, limit int) ([]Member, error)
- func ListMembersOrganizationAccount(orgID, accID bson.ObjectId, skip, limit int) ([]Member, error)
- func ListMembersProject(projectID bson.ObjectId, skip, limit int) ([]Member, error)
- type Organization
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateShortID ¶
func MakeIndexes ¶
func MakeIndexes() error
func OpenDBSession ¶
Types ¶
type Account ¶
type Account struct { ID bson.ObjectId `bson:"_id"` Emails []AccountEmail `bson:"emails"` Password AccountPassword `bson:"password"` OrganizationIDs []bson.ObjectId `bson:"organization_ids"` CreatedAt time.Time `bson:"created_at"` ModifiedAt time.Time `bson:"modified_at"` }
func GetAccountEmail ¶
func (*Account) NOrganizations ¶
func (*Account) Organizations ¶
func (a *Account) Organizations() ([]Organization, error)
func (*Account) PrimaryEmail ¶
func (a *Account) PrimaryEmail() AccountEmail
type AccountEmail ¶
type AccountEmail struct { Address string `bson:"address"` AddressNorm string `bson:"address_norm"` Primary bool `bson:"primary"` Verified bool `bson:"verified"` VerifiedAt time.Time `bson:"verified_at"` Token string `bson:"token"` }
func NewAccountEmail ¶
func NewAccountEmail(addr string) (AccountEmail, error)
type AccountPassword ¶
type Document ¶
type Document struct { ID bson.ObjectId `bson:"_id"` ProjectID bson.ObjectId `bson:"project_id"` ShortID string `bson:"short_id,omitempty"` Title string `bson:"title"` Content string `bson:"content"` Tags []string `bson:"tags"` Published bool `bson:"publishd"` PublishedAt time.Time `bson:"pushlished_at"` Deleted bool `bson:"deleted"` DeletedAt time.Time `bson:"deleted_at"` AccessToken string `bson:"access_token"` CreatedAt time.Time `bson:"created_at"` ModifiedAt time.Time `bson:"modified_at"` }
func GetDocumentShortID ¶
func ListDocumentsProject ¶
type Member ¶
type Member struct { ID bson.ObjectId `bson:"_id"` ProjectID bson.ObjectId `bson:"project_id"` OrganizationID bson.ObjectId `bson:"organization_id"` AccountID bson.ObjectId `bson:"account_id"` InviterID bson.ObjectId `bson:"inviter_id"` InvitedAt time.Time `bson:"invited_at"` ModifiedAt time.Time `bson:"modified_at"` CreatedAt time.Time `bson:"created_at"` }
func GetMemberProjectAccount ¶
func ListMembersAccount ¶
func ListMembersProject ¶
func (*Member) Organization ¶
func (m *Member) Organization() (*Organization, error)
type Organization ¶
type Organization struct { ID bson.ObjectId `bson:"_id"` Name string `bson:"name"` OwnerID bson.ObjectId `bson:"owner_id"` CreatorID bson.ObjectId `bson:"creator_id"` CreatedAt time.Time `bson:"created_at"` ModifiedAt time.Time `bson:"modified_at"` }
func GetOrganization ¶
func GetOrganization(id bson.ObjectId) (*Organization, error)
func ListOraganizationsOwner ¶
func ListOraganizationsOwner(ownerID bson.ObjectId, skip, limit int) ([]Organization, error)
func (*Organization) Put ¶
func (o *Organization) Put() error
type Project ¶
type Project struct { ID bson.ObjectId `bson:"_id"` Name string `bson:"name"` OwnerID bson.ObjectId `bson:"owner_id"` OrganizationID bson.ObjectId `bson:"organization_id"` MemberIDs []bson.ObjectId `bson:"member_ids"` CreatedAt time.Time `bson:"created_at"` ModifiedAt time.Time `bson:"modified_at"` }
func (*Project) Organization ¶
func (p *Project) Organization() (*Organization, error)
Click to show internal directories.
Click to hide internal directories.