Documentation ¶
Index ¶
- Constants
- Variables
- func CommandPrettyPrintln(a ...interface{}) (int, error)
- func CommandPrintErrorln(a ...interface{}) (int, error)
- func CommandPrintln(a ...interface{}) (int, error)
- func InitDBCommandContextCobra(command *cobra.Command) (*app.App, error)
- func InitDBCommandContextCobraReadWrite(command *cobra.Command) (*app.App, error)
- func Run(args []string) error
- func Setup(t testing.TB) *testHelper
- func SetupWithStoreMock(t testing.TB) *testHelper
- type Command
Constants ¶
View Source
const CustomDefaultsEnvVar = "MM_CUSTOM_DEFAULTS_PATH"
Variables ¶
View Source
var ActianceExportCmd = &cobra.Command{
Use: "actiance",
Short: "Export data from Mattermost in Actiance format",
Long: "Export data from Mattermost in Actiance format",
Example: "export actiance --exportFrom=12345",
RunE: buildExportCmdF("actiance"),
}
View Source
var BulkExportCmd = &cobra.Command{ Use: "bulk [file]", Short: "Export bulk data.", Long: "Export data to a file compatible with the Mattermost Bulk Import format.", Example: "export bulk bulk_data.json", RunE: bulkExportCmdF, Args: cobra.ExactArgs(1), }
View Source
var BulkImportCmd = &cobra.Command{
Use: "bulk [file]",
Short: "Import bulk data.",
Long: "Import data from a Mattermost Bulk Import File.",
Example: " import bulk bulk_data.json",
RunE: bulkImportCmdF,
}
View Source
var CsvExportCmd = &cobra.Command{
Use: "csv",
Short: "Export data from Mattermost in CSV format",
Long: "Export data from Mattermost in CSV format",
Example: "export csv --exportFrom=12345",
RunE: buildExportCmdF("csv"),
}
View Source
var DbCmd = &cobra.Command{
Use: "db",
Short: "Commands related to the database",
}
View Source
var ExportCmd = &cobra.Command{
Use: "export",
Short: "Export data from Mattermost",
Long: "Export data from Mattermost in a format suitable for import into a third-party application or another Mattermost instance",
}
View Source
var GlobalRelayZipExportCmd = &cobra.Command{
Use: "global-relay-zip",
Short: "Export data from Mattermost into a zip file containing emails to send to Global Relay for debug and testing purposes only.",
Long: "Export data from Mattermost into a zip file containing emails to send to Global Relay for debug and testing purposes only. This does not archive any information in Global Relay.",
Example: "export global-relay-zip --exportFrom=12345",
RunE: buildExportCmdF("globalrelay-zip"),
}
View Source
var ImportCmd = &cobra.Command{
Use: "import",
Short: "Import data.",
}
View Source
var InitDbCmd = &cobra.Command{ Use: "init", Short: "Initialize the database", Long: `Initialize the database for a given DSN, executing the migrations and loading the custom defaults if any. This command should be run using a database configuration DSN.`, Example: ` # you can use the config flag to pass the DSN $ mattermost db init --config postgres://localhost/mattermost # or you can use the MM_CONFIG environment variable $ MM_CONFIG=postgres://localhost/mattermost mattermost db init # and you can set a custom defaults file to be loaded into the database $ MM_CUSTOM_DEFAULTS_PATH=custom.json MM_CONFIG=postgres://localhost/mattermost mattermost db init`, Args: cobra.NoArgs, RunE: initDbCmdF, }
View Source
var JobserverCmd = &cobra.Command{
Use: "jobserver",
Short: "Start the Mattermost job server",
RunE: jobserverCmdF,
}
View Source
var ResetCmd = &cobra.Command{
Use: "reset",
Short: "Reset the database to initial state",
Long: "Completely erases the database causing the loss of all data. This will reset Mattermost to its initial state.",
RunE: resetCmdF,
}
View Source
var RootCmd = &cobra.Command{
Use: "mattermost",
Short: "Open source, self-hosted Slack-alternative",
Long: `Mattermost offers workplace messaging across web, PC and phones with archiving, search and integration with your existing systems. Documentation available at https://docs.mattermost.com`,
}
View Source
var RunServerForWebClientTestsCmd = &cobra.Command{
Use: "web_client_tests_server",
Short: "Run the server configured for running the web client tests against it",
RunE: serverForWebClientTestsCmdF,
}
View Source
var RunWebClientTestsCmd = &cobra.Command{
Use: "web_client_tests",
Short: "Run the web client tests",
RunE: webClientTestsCmdF,
}
View Source
var ScheduleExportCmd = &cobra.Command{
Use: "schedule",
Short: "Schedule an export data job in Mattermost",
Long: "Schedule an export data job in Mattermost (this will run asynchronously via a background worker)",
Example: "export schedule --format=actiance --exportFrom=12345 --timeoutSeconds=12345",
RunE: scheduleExportCmdF,
}
View Source
var SlackImportCmd = &cobra.Command{
Use: "slack [team] [file]",
Short: "Import a team from Slack.",
Long: "Import a team from a Slack export zip file.",
Example: " import slack myteam slack_export.zip",
RunE: slackImportCmdF,
}
View Source
var TestCmd = &cobra.Command{ Use: "test", Short: "Testing Commands", Hidden: true, }
View Source
var VersionCmd = &cobra.Command{
Use: "version",
Short: "Display version information",
RunE: versionCmdF,
}
Functions ¶
func CommandPrettyPrintln ¶
func CommandPrintErrorln ¶
func CommandPrintln ¶
func SetupWithStoreMock ¶
Setup creates an instance of testHelper.
Types ¶
Click to show internal directories.
Click to hide internal directories.