rpc

package
v1.0.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DiffChangeTemplate = `` /* 318-byte string literal not displayed */

----- diff change -----

View Source
const DiffTemplate = ` 
{{.Head}}
{{.Body}}
{{.End}}
  `

----- generate message section ------

Variables

View Source
var ActionFunc = MigrateActionFunc{
	CreateFunc: supabase.CreateFunction,
	UpdateFunc: func(cfg *raiden.Config, param objects.Function, items any) (err error) {
		return supabase.UpdateFunction(cfg, param)
	},
	DeleteFunc: supabase.DeleteFunction,
}
View Source
var Logger hclog.Logger = logger.HcLog().Named("resource.rpc")

Functions

func Compare

func Compare(source []objects.Function, target []objects.Function) error

func GenerateDiffChangeMessage

func GenerateDiffChangeMessage(newData []string, updateData []string, deleteData []string) (string, error)

func GenerateDiffMessage

func GenerateDiffMessage(name string, value, changeValue string) (string, error)

func GetDiffChangeMessage

func GetDiffChangeMessage(items []MigrateItem) string

func GetNewCountData

func GetNewCountData(supabaseData []objects.Function, localData state.ExtractRpcResult) int

func Migrate

func Migrate(config *raiden.Config, rpc []MigrateItem, stateChan chan any, actions MigrateActionFunc) []error

func PrintDiff

func PrintDiff(diffData CompareDiffResult)

func PrintDiffResult

func PrintDiffResult(diffResult []CompareDiffResult) error

----- print diff section -----

Types

type CompareDiffResult

type CompareDiffResult struct {
	Name           string
	SourceResource objects.Function
	TargetResource objects.Function
	IsConflict     bool
}

func CompareItem

func CompareItem(source, target objects.Function) (diffResult CompareDiffResult)

func CompareList

func CompareList(sourceFn []objects.Function, targetFn []objects.Function) (diffResult []CompareDiffResult, err error)

type MigrateItem

type MigrateItem = migrator.MigrateItem[objects.Function, any]

func BuildMigrateData

func BuildMigrateData(extractedLocalData state.ExtractRpcResult, supabaseData []objects.Function) (migrateData []MigrateItem, err error)

func BuildMigrateItem

func BuildMigrateItem(supabaseData []objects.Function, localData []objects.Function) (migratedData []MigrateItem, err error)

Jump to

Keyboard shortcuts

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