Documentation ¶
Index ¶
Constants ¶
const FileServiceCollectionName = "files"
FileServiceCollectionName is the name of files collection.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BSON ¶
type BSON struct { ID primitive.ObjectID `bson:"_id,omitempty"` FileID string `bson:"fileID,omitempty"` UserID string `bson:"userID,omitempty"` Role ppb.Role `bson:"role"` Creator string `bson:"creator"` }
BSON is the structure that represents a permission as it's stored.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a struct to handle the migration for File-Service.
func NewFileMigration ¶
NewFileMigration returns a File migration.
func (*File) RunSetFloat ¶
RunSetFloat runs the setting of the float field to false for all files documents where it doesn't exist.
func (*File) RunUpdateNameParentOwnerIndex ¶
RunUpdateNameParentOwnerIndex drops the old name_1_parent_1_ownerID_1 unique index, and creates the new not-unique index.
type FileBSON ¶
type FileBSON struct { ID primitive.ObjectID `bson:"_id,omitempty"` Description string `bson:"description"` Size int64 `bson:"size"` Parent *primitive.ObjectID `bson:"parent,omitempty"` Float bool `bson:"float"` Type string `bson:"type,omitempty"` Name string `bson:"name,omitempty"` OwnerID string `bson:"ownerID,omitempty"` Bucket string `bson:"bucket,omitempty"` Key string `bson:"key,omitempty"` CreatedAt primitive.DateTime `bson:"createdAt,omitempty"` UpdatedAt primitive.DateTime `bson:"updatedAt,omitempty"` }
FileBSON is a struct of the file document that is stored in MongoDB.
type Permission ¶
type Permission struct {
// contains filtered or unexported fields
}
Permission is a struct to handle the migration for Permission-Service.
func NewPermissionMigration ¶
func NewPermissionMigration(permissionConnectionString string, fileServiceURL string) *Permission
NewPermissionMigration returns a Permission migration.
func (*Permission) Run ¶
func (p *Permission) Run(errc chan error)
Run runs the Permission-Service migration.
func (*Permission) RunReadRoleUpdate ¶
func (p *Permission) RunReadRoleUpdate() error
RunReadRoleUpdate runs the update read role migration.
func (*Permission) RunSetCreator ¶
func (p *Permission) RunSetCreator() error
RunSetCreator runs the setting of the creator field to the owner of the file.
func (*Permission) RunWriteRoleUpdate ¶
func (p *Permission) RunWriteRoleUpdate() error
RunWriteRoleUpdate runs the update write role migration.
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
Search is a struct to handle the migration for Search-Service.
func NewSearchMigration ¶
NewSearchMigration returns a Search migration.