Post-Migrator/main.go

45 lines
1.1 KiB
Go
Raw Normal View History

2024-05-07 22:03:15 +00:00
package main
import (
"federated.computer/wp-sync-slowtwitch/services/wordpress"
"fmt"
)
const baseUrl = "https://go-api-playground.local/wp-json/"
2024-05-08 00:52:47 +00:00
const wordpressKey = "admin"
const wordpressSecret = "S34E keY1 A1uX 6ncs Rx4T f21W"
2024-05-07 22:03:15 +00:00
2024-05-14 21:59:04 +00:00
const slowtwitchAdminUser = "admin"
const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv"
const slowtwitchDbName = "slowtwitch"
const migrationDbName = "slowtwitch_transfer"
const federatedDbUrl = "slowtwitch.northend.network"
const federatedDbPort = "3306"
2024-05-14 21:59:04 +00:00
2024-05-07 22:03:15 +00:00
var appCache AppCache
func main() {
// TODO Category migration
// TODO User migration
// TODO Article migration
//slowtwitchDB, err := migration.Connect(slowtwitchAdminUser, slowtwitchAdminPass, federatedDbUrl, federatedDbPort, slowtwitchDbName)
createRedirect := wordpress.CreateRedirect{
Url: "/gotest",
Title: "Test From Go",
MatchType: "page",
ActionType: "url",
ActionCode: 301,
GroupId: 1,
ActionData: wordpress.ActionData{
Url: "/GoTestResult",
},
}
result, err := createRedirect.Execute(baseUrl, wordpressKey, wordpressSecret)
if err != nil {
panic(err)
2024-05-14 21:59:04 +00:00
}
fmt.Println(result)
}