Documentation ¶
Index ¶
- func DeletePGPFiles(filter bson.M) (err error)
- func DeleteUsers(filter bson.D) (err error)
- func GetPGPFiles(files []PGPFile, filter interface{}) (err error)
- func GetUsers(users []User, filter interface{}) (err error)
- func InsertPGPFiles(files []PGPFile) (err error)
- func InsertUsers(users []User) (err error)
- func UpdatePGPFiles(update bson.M, filter bson.M) (err error)
- func UpdateUsers(update bson.M, filter bson.M) (err error)
- type PGPFile
- type User
- type UserProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeletePGPFiles ¶
DeletePGPFiles will delete all PGPFiles that get through filter
func DeleteUsers ¶
DeleteUsers will delete all Users that get through filter
func GetPGPFiles ¶
GetPGPFiles will get Many PGPfiles from mongo.Collection
func InsertPGPFiles ¶
InsertPGPFiles is to insert multi-files. input parameter(files) need init all properties
func UpdatePGPFiles ¶
UpdatePGPFiles will update all PGPFiles that get through filter
Types ¶
type PGPFile ¶
type PGPFile struct { // Name is used to figure out src & dst. // namely, "repeat name" is forbidden Name string `bson:"name"` Author string `bson:"author"` Size int `bson:"size"` // Create_time represents when file sent to server CreateTime time.Time `bson:"createtime"` LastModifyTime time.Time `bson:"lastmodifytime"` // Path means the place where this "File" stored // and this path is a relative path. // absolute path = path prefix + path (relative path) Path string `bson:"path"` PubKey string `bson:"pubkey"` }
PGPFile is file document type
type User ¶
type User struct { Profile UserProfile `bson:"profile"` Files []PGPFile `bson:"files"` Session string `bson:"session"` PubKey string `bson:"pubkey"` }
User as a document
type UserProfile ¶
type UserProfile struct { // Name is one of properties to identify users Name string `bson:"name"` // Password need stored after processing Password string `bson:"password"` // LastLoginTime is required in resp of login LastLoginTime time.Time `bson:"lastlogintime"` }
UserProfile is a type used in User
Click to show internal directories.
Click to hide internal directories.