migration

package
v0.0.0-...-37edf61 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
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

func NewFileMigration(fileConnectionString string) *File

NewFileMigration returns a File migration.

func (*File) Run

func (f *File) Run(errc chan error)

Run runs the File-Service migration.

func (*File) RunSetFloat

func (f *File) RunSetFloat() error

RunSetFloat runs the setting of the float field to false for all files documents where it doesn't exist.

func (*File) RunUpdateNameParentOwnerIndex

func (f *File) RunUpdateNameParentOwnerIndex() error

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 struct {
	// contains filtered or unexported fields
}

Search is a struct to handle the migration for Search-Service.

func NewSearchMigration

func NewSearchMigration(fileConnectionString string, searchServiceURL string) *Search

NewSearchMigration returns a Search migration.

func (*Search) Run

func (s *Search) Run(errc chan error)

Run runs the Search-Service migration.

Jump to

Keyboard shortcuts

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