HTTP Driver for the for the Cloud CMS API
In your module directory, run:
go get github.com/gitana/cloudcms-go-driver
Below are some examples of how you might use this driver:
package main
import (
"github.com/gitana/cloudcms-go-driver"
)
func main() {
// Connect to CloudCMS using gitana.json in working directory
session, err := cloudcms.ConnectDefault()
if err != nil {
fmt.Println(err)
return
}
var repositoryId string
// List branches
branches, _ := session.ListBranches(repositoryId, nil)
// Read branch
branchId := "master"
branch, _ := session.ReadBranch(repositoryId, branchId)
// Read Node
node, _ := session.ReadNode(repositoryId, branchId, nodeId)
// Create Node
nodeObj := cloudcms.JsonObject{
"title": "Twelfth Night",
"description": "An old play",
}
nodeId, _ := session.createNode(repositoryId, branchId, nodeObj, nil)
// Query Nodes
query := cloudcms.JsonObject{
"_type": "store:book",
}
pagination := cloudcms.JsonObject{
"limit": 1,
}
queriedNodes, _ session.QueryNodes(repositoryId, branchId, query, pagination)
// Find Nodes
find := cloudcms.JsonObject{
"search": "Shakespeare",
"query": JsonObject{
"_type": "store:book",
}
}
findNodes, _ := session.FindNodes(repositoryId, branchId, find ,nil)
}
- Cloud CMS: https://www.cloudcms.com
- Github: https://github.com/gitana/cloudcms-go-driver
- Go Driver Download: TODO
- Cloud CMS Documentation: https://www.cloudcms.com/documentation.html
- Developers Guide: https://www.cloudcms.com/developers.html
For information or questions about the Go Driver, please contact Cloud CMS at [email protected].