Documentation ¶
Index ¶
- Constants
- Variables
- func BuildGenerateStorageInput(storages []objects.Bucket, policies objects.Policies) []*generator.GenerateStorageInput
- func Compare(source []objects.Bucket, target []objects.Bucket) error
- func GenerateDiffChangeMessage(newData []string, updateData []string, deleteData []string) (string, error)
- func GenerateDiffChangeUpdateMessage(name string, item MigrateItem) (string, error)
- func GenerateDiffMessage(storageName string, diffType DiffType, updateType objects.UpdateBucketType, ...) (string, error)
- func GetDiffChangeMessage(items []MigrateItem) string
- func GetNewCountData(cloudData []objects.Bucket, localData state.ExtractStorageResult) int
- func Migrate(config *raiden.Config, storages []MigrateItem, stateChan chan any, ...) []error
- func PrintDiff(diffData CompareDiffResult)
- func PrintDiffResult(diffResult []CompareDiffResult) error
- type CompareDiffResult
- type DiffType
- type MigrateActionFunc
- type MigrateItem
Constants ¶
View Source
const DiffChangeTemplate = `` /* 330-byte string literal not displayed */
----- diff change -----
View Source
const DiffChangeUpdateTemplate = `` /* 169-byte string literal not displayed */
View Source
const DiffTemplate = `` /* 241-byte string literal not displayed */
----- generate message section -----
View Source
const FuncBodyTemplate = "{{ .Symbol }} return {{ .Value }}"
View Source
const FuncBodyUpdateTemplate = "{{ .Symbol }} return {{ .Value }} >>> {{ .ChangeValue }}"
Variables ¶
View Source
var ActionFunc = MigrateActionFunc{ CreateFunc: supabase.CreateBucket, UpdateFunc: supabase.UpdateBucket, DeleteFunc: supabase.DeleteBucket, }
View Source
var Logger hclog.Logger = logger.HcLog().Named("resource.storages")
Functions ¶
func GenerateDiffChangeUpdateMessage ¶
func GenerateDiffChangeUpdateMessage(name string, item MigrateItem) (string, error)
func GenerateDiffMessage ¶
func GetDiffChangeMessage ¶
func GetDiffChangeMessage(items []MigrateItem) string
func GetNewCountData ¶
func GetNewCountData(cloudData []objects.Bucket, localData state.ExtractStorageResult) int
func Migrate ¶
func Migrate(config *raiden.Config, storages []MigrateItem, stateChan chan any, actions MigrateActionFunc) []error
func PrintDiff ¶
func PrintDiff(diffData CompareDiffResult)
func PrintDiffResult ¶
func PrintDiffResult(diffResult []CompareDiffResult) error
Types ¶
type CompareDiffResult ¶
type CompareDiffResult struct { Name string SourceResource objects.Bucket TargetResource objects.Bucket DiffItems objects.UpdateBucketParam IsConflict bool }
func CompareItem ¶
func CompareItem(source, target objects.Bucket) (diffResult CompareDiffResult)
func CompareList ¶
func CompareList(sourceStorage, targetStorage []objects.Bucket) (diffResult []CompareDiffResult, err error)
type MigrateActionFunc ¶
type MigrateActionFunc = migrator.MigrateActionFunc[objects.Bucket, objects.UpdateBucketParam]
type MigrateItem ¶
type MigrateItem = migrator.MigrateItem[objects.Bucket, objects.UpdateBucketParam]
func BuildMigrateData ¶
func BuildMigrateData(extractedLocalData state.ExtractStorageResult, supabaseData []objects.Bucket) (migrateData []MigrateItem, err error)
func BuildMigrateItem ¶
Click to show internal directories.
Click to hide internal directories.