Documentation ¶
Overview ¶
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 The Fossul Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func BasicAuth(h http.Handler, myUser, myPass string) http.Handler
- func BoolToString(b bool) string
- func ConfigMapToJson(configMap map[string]string) (string, error)
- func ConvertEpoch(epoch string) string
- func ConvertEpochToTime(epoch string) time.Time
- func CreateDir(path string, mode os.FileMode) error
- func DirectoryList(path string) ([]string, error)
- func DirectoryTreeList(dir string) ([]string, error)
- func EncodeConfig(config Config) (*bytes.Buffer, error)
- func EncodePluginConfig(configMap map[string]string) (*bytes.Buffer, error)
- func ExistsBackupRetention(policy string, retentions []BackupRetention) bool
- func ExistsInArray(array []string, str string) bool
- func ExistsPath(path string) bool
- func FileList(path string) ([]string, error)
- func GetArchiveRetention(policy string, retentions []ArchiveRetention) int
- func GetBackupDirFromConfig(config Config) string
- func GetBackupDirFromMap(configMap map[string]string) string
- func GetBackupName(name, policy, workflowId, timestamp string) string
- func GetBackupPathFromConfig(config Config) string
- func GetBackupPathFromMap(configMap map[string]string) string
- func GetBackupRetention(policy string, retentions []BackupRetention) int
- func GetCronScheduleId(w http.ResponseWriter, r *http.Request) (cron.EntryID, error)
- func GetLoggerInstance() *log.Logger
- func GetPluginConfig(w http.ResponseWriter, r *http.Request) (map[string]string, error)
- func GetPluginPath(pluginName, pluginType string) string
- func GetRestoreSnapshot(config Config, snapshots []string) (string, error)
- func GetRestoreSrcPath(config Config) (string, error)
- func GetRestoreSrcPathFromMap(configMap map[string]string) (string, error)
- func GetTimestamp() int64
- func GetWorkflowId() int
- func Int32ToString(i int32) string
- func Int64ToString(i int64) string
- func IntInSlice(i int, list []int) bool
- func IntToString(i int) string
- func IsDirectory(path string) (bool, error)
- func JoinArray(array, combinedArray []string) []string
- func LogApi(inner http.Handler, name string) http.Handler
- func LogCmdMessage(l *log.Logger, message string)
- func LogCommentMessage(l *log.Logger, message string)
- func LogDebugMessage(l *log.Logger, message string)
- func LogErrorMessage(l *log.Logger, message string)
- func LogInfoMessage(l *log.Logger, message string)
- func LogMessageToConsole(l *log.Logger, message Message)
- func LogResult(l *log.Logger, result Result)
- func LogResults(l *log.Logger, result []Result)
- func LogWarnMessage(l *log.Logger, message string)
- func PluginList(path, configName string) ([]string, error)
- func ReadConfigToMap(filePath string) (map[string]string, error)
- func ReadGob(filePath string, object interface{}) error
- func RecursiveDirDelete(dir string) error
- func SerializeBackup(resultsDir string, backup *Backup)
- func SerializeWorkflow(resultsDir string, workflow *Workflow)
- func SerializeWorkflowStepResults(resultsDir string, stepId int, results Result)
- func SetStepComplete(workflow *Workflow, step Step)
- func SetStepError(workflow *Workflow, step Step)
- func SetWorkflowStatusEnd(workflow *Workflow)
- func SetWorkflowStatusError(workflow *Workflow)
- func SetWorkflowStatusStart(workflow *Workflow)
- func SetWorkflowStep(workflow *Workflow, step Step)
- func StringToInt(s string) int
- func StringToInt64(s string) int64
- func WriteConfig(filePath string, config Config) error
- func WriteGob(filePath string, object interface{}) error
- func WritePluginConfig(filePath string, configMap map[string]string) error
- type AppPlugin
- type Archive
- type ArchivePlugin
- type ArchiveRetention
- type Archives
- type Backup
- type BackupByWorkflow
- type BackupRetention
- type Backups
- type ByEpochArchive
- type ByEpochBackup
- type Capability
- type Config
- func GetConfig(w http.ResponseWriter, r *http.Request) (Config, error)
- func GetConsolidatedConfig(configDir, profileName, configName, policyName string) (Config, error)
- func ReadConfig(filePath string) (Config, error)
- func SetAppPluginParameters(appConfigPath string, config Config) (Config, error)
- func SetArchivePluginParameters(archiveConfigPath string, config Config) (Config, error)
- func SetStoragePluginParameters(storageConfigPath string, config Config) (Config, error)
- type ConfigMapResult
- type ConfigResult
- type Content
- type CronSchedule
- type Discover
- type DiscoverResult
- type Job
- type JobSchedule
- type JobScheduleResult
- type JobSchedulesResult
- type Jobs
- type Message
- type Plugin
- type PluginConfigMap
- type PluginInfoResult
- type Result
- func DeleteJobs(baseDir, profileName, configName string, jobRetention int) Result
- func ExecuteCommand(args ...string) (result Result)
- func ExecutePlugin(config Config, pluginType string, args ...string) (result Result)
- func SetResult(code int, messages []Message) Result
- func SetResultMessage(code int, level, msg string) Result
- type ResultSimple
- type Status
- type Step
- type StoragePlugin
- type Workflow
- type WorkflowResult
- type WorkflowStatusResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolToString ¶
func ConvertEpoch ¶
func ConvertEpochToTime ¶
func DirectoryList ¶
func DirectoryTreeList ¶
func EncodePluginConfig ¶
func ExistsBackupRetention ¶
func ExistsBackupRetention(policy string, retentions []BackupRetention) bool
func ExistsInArray ¶
func ExistsPath ¶
func GetArchiveRetention ¶
func GetArchiveRetention(policy string, retentions []ArchiveRetention) int
func GetBackupDirFromConfig ¶
func GetBackupDirFromMap ¶
func GetBackupName ¶
func GetBackupPathFromConfig ¶
func GetBackupPathFromMap ¶
func GetBackupRetention ¶
func GetBackupRetention(policy string, retentions []BackupRetention) int
func GetCronScheduleId ¶
func GetCronScheduleId(w http.ResponseWriter, r *http.Request) (cron.EntryID, error)
func GetLoggerInstance ¶
func GetPluginConfig ¶
func GetPluginPath ¶
func GetRestoreSnapshot ¶
func GetRestoreSrcPath ¶
func GetTimestamp ¶
func GetTimestamp() int64
func GetWorkflowId ¶
func GetWorkflowId() int
func Int32ToString ¶
func Int64ToString ¶
func IntInSlice ¶
func IntToString ¶
func IsDirectory ¶
func LogCmdMessage ¶
func LogCommentMessage ¶
func LogDebugMessage ¶
func LogErrorMessage ¶
func LogInfoMessage ¶
func LogMessageToConsole ¶
func LogResults ¶
func LogWarnMessage ¶
func PluginList ¶
func RecursiveDirDelete ¶
func SerializeBackup ¶
func SerializeWorkflow ¶
func SetStepComplete ¶
func SetStepError ¶
func SetWorkflowStatusEnd ¶
func SetWorkflowStatusEnd(workflow *Workflow)
func SetWorkflowStatusError ¶
func SetWorkflowStatusError(workflow *Workflow)
func SetWorkflowStatusStart ¶
func SetWorkflowStatusStart(workflow *Workflow)
func SetWorkflowStep ¶
func StringToInt ¶
func StringToInt64 ¶
func WriteConfig ¶
Types ¶
type AppPlugin ¶
type AppPlugin interface { SetEnv(Config) Result Quiesce(Config) Result Unquiesce(Config) Result PreRestore(Config) Result PostRestore(Config) Result Discover(Config) DiscoverResult Info() Plugin }
func GetAppInterface ¶
type Archive ¶
type Archive struct { Name string `json:"name,omitempty"` Timestamp string `json:"timestamp,omitempty"` Epoch int `json:"epoch,omitempty"` Policy string `json:"policy,omitempty"` WorkflowId string `json:"workflowId,omitempty"` }
func GetArchivesByPolicy ¶
type ArchivePlugin ¶
type ArchivePlugin interface { SetEnv(Config) Result Archive(Config) Result ArchiveDelete(Config) Result ArchiveList(Config) Archives Info() Plugin }
func GetArchiveInterface ¶
func GetArchiveInterface(path string) (ArchivePlugin, error)
type ArchiveRetention ¶
type Backup ¶
type Backup struct { Name string `json:"name,omitempty"` Timestamp string `json:"timestamp,omitempty"` Epoch int `json:"epoch,omitempty"` Policy string `json:"policy,omitempty"` WorkflowId string `json:"workflowId,omitempty"` Contents []Content `json:"contents,omitempty"` }
func GetBackupsByPolicy ¶
type BackupByWorkflow ¶
type BackupRetention ¶
type ByEpochArchive ¶
type ByEpochArchive []Archive
func (ByEpochArchive) Len ¶
func (a ByEpochArchive) Len() int
func (ByEpochArchive) Less ¶
func (a ByEpochArchive) Less(i, j int) bool
func (ByEpochArchive) Swap ¶
func (a ByEpochArchive) Swap(i, j int)
type ByEpochBackup ¶
type ByEpochBackup []Backup
func (ByEpochBackup) Len ¶
func (a ByEpochBackup) Len() int
func (ByEpochBackup) Less ¶
func (a ByEpochBackup) Less(i, j int) bool
func (ByEpochBackup) Swap ¶
func (a ByEpochBackup) Swap(i, j int)
type Capability ¶
type Capability struct {
Name string `json:"name"`
}
type Config ¶
type Config struct { ProfileName string `json:"profileName,omitempty"` ConfigName string `json:"configName,omitempty"` WorkflowId string `json:"workflowId,omitempty"` WorkflowType string `json:"workflowType,omitempty"` WorkflowTimestamp int64 `json:"workflowTimestamp,omitempty"` Backup Backup `json:"backup,omitempty"` OperatorControlled bool `json:"operatorControlled"` ContainerPlatform string `json:"containerPlatform,omitempty"` AccessWithinCluster string `json:"accessWithinCluster,omitempty"` AppPlugin string `json:"appPlugin"` StoragePlugin string `json:"storagePlugin"` ArchivePlugin string `json:"archivePlugin"` AutoDiscovery bool `json:"autoDiscovery"` JobRetention int `json:"jobRetention"` BackupRetentions []BackupRetention `json:"backupRetentions"` ArchiveRetentions []ArchiveRetention `json:"archiveRetentions"` SelectedBackupPolicy string `json:"backupPolicy,omitmepty"` SelectedBackupRetention int `json:"backupRetention,omitmepty"` SelectedArchiveRetention int `json:"archiveRetention,omitmepty"` SelectedWorkflowId int `json:"selectedWorkflowId,omitmepty"` PreAppQuiesceCmd string `json:"preAppQuiesceCmd,omitempty"` AppQuiesceCmd string `json:"appQuiesceCmd,omitempty"` PostAppQuiesceCmd string `json:"postAppQuiesceCmd,omitempty"` BackupCreateCmd string `json:"backupCreateCmd,omitempty"` BackupDeleteCmd string `json:"backupDeleteCmd,omitempty"` ArchiveCreateCmd string `json:"archiveCreateCmd,omitempty"` ArchiveDeleteCmd string `json:"archiveDeleteCmd,omitempty"` PreAppUnquiesceCmd string `json:"preAppUnquiesceCmd,omitempty"` AppUnquiesceCmd string `json:"appUnquiesceCmd,omitempty"` PostAppUnquiesceCmd string `json:"postAppUnquiesceCmd,omitempty"` PreAppRestoreCmd string `json:"preAppRestoreCmd,omitempty"` RestoreCmd string `json:"restoreCmd,omitempty"` PostAppRestoreCmd string `json:"postAppRestoreCmd,omitempty"` SendTrapErrorCmd string `json:"sendTrapErrorCmd,omitempty"` SendTrapSuccessCmd string `json:"sendTrapSuccessCmd,omitempty"` AppPluginParameters map[string]string `json:"appPluginParameters,omitempty"` StoragePluginParameters map[string]string `json:"storagePluginParameters,omitempty"` ArchivePluginParameters map[string]string `json:"archivePluginParameters,omitempty"` }
func GetConsolidatedConfig ¶
func ReadConfig ¶
func SetAppPluginParameters ¶
type ConfigMapResult ¶
type ConfigResult ¶
type Content ¶
type Content struct { Type string `json:"type,omitempty"` Source string `json:"source,omitempty"` Metadata string `json:"metadata,omitempty"` Data string `json:"data,omitempty"` Size string `json:"size,omitempty"` StorageClass string `json:"storageClass,omitempty"` VolumeSnapshotClass string `json:"volumeSnapshotClass,omitempty"` }
type CronSchedule ¶
type CronSchedule struct {
Value string `json:"value,omitempty"`
}
func GetCronSchedule ¶
func GetCronSchedule(w http.ResponseWriter, r *http.Request) (CronSchedule, error)
type DiscoverResult ¶
type Job ¶
type JobSchedule ¶
type JobScheduleResult ¶
type JobScheduleResult struct { JobSchedule JobSchedule `json:"jobSchedule,omitempty"` Result Result `json:"result,omitempty"` }
type JobSchedulesResult ¶
type JobSchedulesResult struct { JobSchedules []JobSchedule `json:"jobSchedules,omitempty"` Result Result `json:"result,omitempty"` }
type Message ¶
type Message struct { Timestamp int64 `json:"time,omitempty"` Level string `json:"level,omitempty"` Message string `json:"message,omitempty"` }
func PrependMessage ¶
func PrependMessages ¶
func SetMessage ¶
func SetMessages ¶
type Plugin ¶
type Plugin struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Version string `json:"version,omitempty"` Type string `json:"type,omitempty"` Capabilities []Capability `json:"capabilities"` }
type PluginConfigMap ¶
type PluginInfoResult ¶
type Result ¶
type Result struct { Code int `json:"code,omitempty"` Messages []Message `json:"messages,omitempty"` Data []string `json:"data,omitempty"` Backup Backup `json:"backup,omitempty"` }
func DeleteJobs ¶
func ExecuteCommand ¶
func ExecutePlugin ¶
func SetResultMessage ¶
type ResultSimple ¶
type ResultSimple struct { Code int `json:"code,omitempty"` Messages []string `json:"messages,omitempty"` Data []string `json:"data,omitempty"` }
func ExecutePluginSimple ¶
func ExecutePluginSimple(config Config, pluginType string, args ...string) (result ResultSimple)
func SetResultSimple ¶
func SetResultSimple(code int, messages []string) ResultSimple
type Step ¶
type Step struct { Id int `json:"id"` Status string `json:"status"` Label string `json:"label,omitempty"` }
func CreateCommentStep ¶
func CreateStep ¶
func GetWorkflowSteps ¶
func GetWorkflowSteps(w http.ResponseWriter, r *http.Request) []Step
type StoragePlugin ¶
type StoragePlugin interface { SetEnv(Config) Result Backup(Config) Result Restore(Config) Result BackupDelete(Config) Result BackupDeleteWorkflow(Config) Result Mount(Config) Result Unmount(Config) Result BackupList(Config) Backups Info() Plugin }
func GetStorageInterface ¶
func GetStorageInterface(path string) (StoragePlugin, error)