migrations

package
v5.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: AGPL-3.0, Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIGRATION_STATE_UNSCHEDULED = "unscheduled"
	MIGRATION_STATE_IN_PROGRESS = "in_progress"
	MIGRATION_STATE_COMPLETED   = "completed"

	JOB_DATA_KEY_MIGRATION           = "migration_key"
	JOB_DATA_KEY_MIGRATION_LAST_DONE = "last_done"
)
View Source
const (
	MIGRATION_JOB_WEDGED_TIMEOUT_MILLISECONDS = 3600000 // 1 hour
)
View Source
const (
	TIME_BETWEEN_BATCHES = 100
)

Variables

This section is empty.

Functions

func GetMigrationState

func GetMigrationState(migration string, store store.Store) (string, *model.Job, *model.AppError)

func MakeMigrationsList

func MakeMigrationsList() []string

func StopTestStore

func StopTestStore()

func UseTestStore

func UseTestStore(container *storetest.RunningContainer, settings *model.SqlSettings)

UseTestStore sets the container and corresponding settings to use for tests. Once the tests are complete (e.g. at the end of your TestMain implementation), you should call StopTestStore.

Types

type AdvancedPermissionsPhase2Progress

type AdvancedPermissionsPhase2Progress struct {
	CurrentTable  string `json:"current_table"`
	LastTeamId    string `json:"last_team_id"`
	LastChannelId string `json:"last_channel_id"`
	LastUserId    string `json:"last_user"`
}

func AdvancedPermissionsPhase2ProgressFromJson

func AdvancedPermissionsPhase2ProgressFromJson(data io.Reader) *AdvancedPermissionsPhase2Progress

func (*AdvancedPermissionsPhase2Progress) IsValid

func (*AdvancedPermissionsPhase2Progress) ToJson

type FakeClusterInterface

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

func (*FakeClusterInterface) ConfigChanged

func (me *FakeClusterInterface) ConfigChanged(previousConfig *model.Config, newConfig *model.Config, sendToOtherServer bool) *model.AppError

func (*FakeClusterInterface) GetClusterId

func (me *FakeClusterInterface) GetClusterId() string

func (*FakeClusterInterface) GetClusterInfos

func (me *FakeClusterInterface) GetClusterInfos() []*model.ClusterInfo

func (*FakeClusterInterface) GetClusterStats

func (me *FakeClusterInterface) GetClusterStats() ([]*model.ClusterStats, *model.AppError)

func (*FakeClusterInterface) GetLogs

func (me *FakeClusterInterface) GetLogs(page, perPage int) ([]string, *model.AppError)

func (*FakeClusterInterface) GetMyClusterInfo

func (me *FakeClusterInterface) GetMyClusterInfo() *model.ClusterInfo

func (*FakeClusterInterface) GetPluginStatuses

func (me *FakeClusterInterface) GetPluginStatuses() (model.PluginStatuses, *model.AppError)

func (*FakeClusterInterface) IsLeader

func (me *FakeClusterInterface) IsLeader() bool

func (*FakeClusterInterface) NotifyMsg

func (me *FakeClusterInterface) NotifyMsg(buf []byte)

func (*FakeClusterInterface) RegisterClusterMessageHandler

func (me *FakeClusterInterface) RegisterClusterMessageHandler(event string, crm einterfaces.ClusterMessageHandler)

func (*FakeClusterInterface) SendClusterMessage

func (me *FakeClusterInterface) SendClusterMessage(cluster *model.ClusterMessage)

func (*FakeClusterInterface) StartInterNodeCommunication

func (me *FakeClusterInterface) StartInterNodeCommunication()

func (*FakeClusterInterface) StopInterNodeCommunication

func (me *FakeClusterInterface) StopInterNodeCommunication()

type MigrationsJobInterfaceImpl

type MigrationsJobInterfaceImpl struct {
	App *app.App
}

func (*MigrationsJobInterfaceImpl) MakeScheduler

func (m *MigrationsJobInterfaceImpl) MakeScheduler() model.Scheduler

func (*MigrationsJobInterfaceImpl) MakeWorker

func (m *MigrationsJobInterfaceImpl) MakeWorker() model.Worker

type Scheduler

type Scheduler struct {
	App *app.App
	// contains filtered or unexported fields
}

func (*Scheduler) Enabled

func (scheduler *Scheduler) Enabled(cfg *model.Config) bool

func (*Scheduler) JobType

func (scheduler *Scheduler) JobType() string

func (*Scheduler) Name

func (scheduler *Scheduler) Name() string

func (*Scheduler) NextScheduleTime

func (scheduler *Scheduler) NextScheduleTime(cfg *model.Config, now time.Time, pendingJobs bool, lastSuccessfulJob *model.Job) *time.Time

func (*Scheduler) ScheduleJob

func (scheduler *Scheduler) ScheduleJob(cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError)

type TestHelper

type TestHelper struct {
	App          *app.App
	BasicTeam    *model.Team
	BasicUser    *model.User
	BasicUser2   *model.User
	BasicChannel *model.Channel
	BasicPost    *model.Post

	SystemAdminUser *model.User
	// contains filtered or unexported fields
}

func Setup

func Setup() *TestHelper

func SetupEnterprise

func SetupEnterprise() *TestHelper

func (*TestHelper) AddUserToChannel

func (me *TestHelper) AddUserToChannel(user *model.User, channel *model.Channel) *model.ChannelMember

func (*TestHelper) CreateChannel

func (me *TestHelper) CreateChannel(team *model.Team) *model.Channel

func (*TestHelper) CreateDmChannel

func (me *TestHelper) CreateDmChannel(user *model.User) *model.Channel

func (*TestHelper) CreatePost

func (me *TestHelper) CreatePost(channel *model.Channel) *model.Post

func (*TestHelper) CreateTeam

func (me *TestHelper) CreateTeam() *model.Team

func (*TestHelper) CreateUser

func (me *TestHelper) CreateUser() *model.User

func (*TestHelper) DeleteAllJobsByTypeAndMigrationKey

func (me *TestHelper) DeleteAllJobsByTypeAndMigrationKey(jobType string, migrationKey string)

func (*TestHelper) InitBasic

func (me *TestHelper) InitBasic() *TestHelper

func (*TestHelper) InitSystemAdmin

func (me *TestHelper) InitSystemAdmin() *TestHelper

func (*TestHelper) InstallPlugin

func (me *TestHelper) InstallPlugin(manifest *model.Manifest, hooks plugin.Hooks)

func (*TestHelper) LinkUserToTeam

func (me *TestHelper) LinkUserToTeam(user *model.User, team *model.Team)

func (*TestHelper) MakeEmail

func (me *TestHelper) MakeEmail() string

func (*TestHelper) ResetRoleMigration

func (me *TestHelper) ResetRoleMigration()

func (*TestHelper) TearDown

func (me *TestHelper) TearDown()

type Worker

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

func (*Worker) DoJob

func (worker *Worker) DoJob(job *model.Job)

func (*Worker) JobChannel

func (worker *Worker) JobChannel() chan<- model.Job

func (*Worker) Run

func (worker *Worker) Run()

func (*Worker) Stop

func (worker *Worker) Stop()

Jump to

Keyboard shortcuts

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