dao

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

Entry is database access oject for entries

func NewEntry

func NewEntry(db *service.DB) *Entry

NewEntry return a Entry intance

func (*Entry) Create

func (o *Entry) Create(userID string, entry *schema.Entry) (entrySum *schema.EntrySum, err error)

Create ...

func (*Entry) Find

func (o *Entry) Find(EntryID util.OID, IsDeleted bool) (entry *schema.Entry, err error)

Find ...

func (*Entry) FindByTeam

func (o *Entry) FindByTeam(TeamID util.OID, userID string, IsDeleted bool) (
	entries []*schema.EntrySum, err error)

FindByTeam ...

func (*Entry) Update

func (o *Entry) Update(userID string, EntryID util.OID, changes map[string]interface{}) (
	entrySum *schema.EntrySum, err error)

Update ...

func (*Entry) UpdateDeleted

func (o *Entry) UpdateDeleted(userID string, EntryID util.OID, isDeleted bool) (
	entrySum *schema.EntrySum, err error)

UpdateDeleted ...

type File

type File struct {
	// contains filtered or unexported fields
}

File is database access oject for files

func NewFile

func NewFile(db *service.DB) *File

NewFile return a File intance

func (*File) Create

func (o *File) Create(userID, name, key string, data []byte) (fileResult *schema.FileResult, err error)

Create ...

func (*File) Delete

func (o *File) Delete(FileID util.OID) error

Delete ...

func (*File) FindFile

func (o *File) FindFile(FileID util.OID, key string) (file *schema.File, fileBlob schema.FileBlob, err error)

FindFile ...

func (*File) FindFiles

func (o *File) FindFiles(key string, ids ...string) (files []*schema.FileResult, err error)

FindFiles ...

type Secret

type Secret struct {
	// contains filtered or unexported fields
}

Secret is database access oject for secrets

func NewSecret

func NewSecret(db *service.DB) *Secret

NewSecret return a Secret intance

func (*Secret) Create

func (o *Secret) Create(EntryID util.OID, userID, key string, secret *schema.Secret) (
	secretResult *schema.SecretResult, err error)

Create ...

func (*Secret) Delete

func (o *Secret) Delete(EntryID, SecretID util.OID, userID string) error

Delete ...

func (*Secret) FindSecrets

func (o *Secret) FindSecrets(key string, ids ...string) (secrets []*schema.SecretResult, err error)

FindSecrets ...

func (*Secret) Update

func (o *Secret) Update(EntryID, SecretID util.OID, userID, key string, changes map[string]interface{}) (
	secretResult *schema.SecretResult, err error)

Update ...

type Share

type Share struct {
	// contains filtered or unexported fields
}

Share is database access oject for share

func NewShare

func NewShare(db *service.DB) *Share

NewShare return a Share intance

func (*Share) Create

func (o *Share) Create(EntryID util.OID, key, pass string, expire time.Duration, share *schema.Share) (
	shareResult *schema.ShareResult, err error)

Create ...

func (*Share) Delete

func (o *Share) Delete(ShareID util.OID, userID string) error

Delete ...

func (*Share) Find

func (o *Share) Find(ShareID util.OID) (share *schema.Share, err error)

Find ...

func (*Share) FindByEntryID

func (o *Share) FindByEntryID(EntryID util.OID) (shares []*schema.ShareResult, err error)

FindByEntryID ...

func (*Share) FindByTeamID

func (o *Share) FindByTeamID(TeamID util.OID) (shares []*schema.ShareResult, err error)

FindByTeamID ...

func (*Share) FindByUserID

func (o *Share) FindByUserID(userID string) (shares []*schema.ShareResult, err error)

FindByUserID ...

type Team

type Team struct {
	// contains filtered or unexported fields
}

Team is database access oject for teams

func NewTeam

func NewTeam(db *service.DB) *Team

NewTeam return a Team intance

func (*Team) CheckToken

func (o *Team) CheckToken(TeamID util.OID, userID, pass string) (team *schema.Team, err error)

CheckToken ...

func (*Team) CheckUser

func (o *Team) CheckUser(TeamID util.OID, userID string) error

CheckUser check user' read right

func (*Team) Create

func (o *Team) Create(userID, pass string, team *schema.Team) (teamResult *schema.TeamResult, err error)

Create ...

func (*Team) Find

func (o *Team) Find(TeamID util.OID, IsDeleted bool) (team *schema.Team, err error)

Find ...

func (*Team) FindByMemberID

func (o *Team) FindByMemberID(memberID string) (teams []*schema.TeamResult, err error)

FindByMemberID ...

func (*Team) FindByUserID

func (o *Team) FindByUserID(userID string, IsDeleted bool) (teams []*schema.TeamResult, err error)

FindByUserID ...

func (*Team) Update

func (o *Team) Update(TeamID util.OID, team *schema.Team) (teamResult *schema.TeamResult, err error)

Update ...

func (*Team) UpdateMembers

func (o *Team) UpdateMembers(userID string, TeamID util.OID, pull, push []string) (
	teamResult *schema.TeamResult, err error)

UpdateMembers ...

type User

type User struct {
	// contains filtered or unexported fields
}

User is database access oject for users

func NewUser

func NewUser(db *service.DB) *User

NewUser return a User intance

func (*User) CheckID

func (o *User) CheckID(id string) error

CheckID ...

func (*User) CheckLogin

func (o *User) CheckLogin(id, pass string) (user *schema.User, err error)

CheckLogin ...

func (*User) Create

func (o *User) Create(userID, pass string) (user *schema.User, err error)

Create ...

func (*User) Find

func (o *User) Find(id string) (user *schema.User, err error)

Find ...

func (*User) Update

func (o *User) Update(user *schema.User) error

Update ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL