45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"federated.computer/wp-sync-slowtwitch/services/wordpress"
|
|
"fmt"
|
|
)
|
|
|
|
const baseUrl = "https://go-api-playground.local/wp-json/"
|
|
const wordpressKey = "admin"
|
|
const wordpressSecret = "S34E keY1 A1uX 6ncs Rx4T f21W"
|
|
|
|
const slowtwitchAdminUser = "admin"
|
|
const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv"
|
|
const slowtwitchDbName = "slowtwitch"
|
|
const migrationDbName = "slowtwitch_transfer"
|
|
const federatedDbUrl = "slowtwitch.northend.network"
|
|
const federatedDbPort = "3306"
|
|
|
|
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)
|
|
}
|
|
fmt.Println(result)
|
|
}
|