gorc
A golang client for Orchestrate.io
Supports go 1.1 or later
Go Style Documentation:
http://godoc.org/github.com/orchestrate-io/gorc
Usage examples
import "github.com/orchestrate-io/gorc"
c := gorc.NewClient("Your API Key")
result, _ := c.Get("collection", "key")
valueMap := make(map[string]interface{})
result.Value(&valueMap)
domainObject := DomainObject{}
result.Value(&domainObject)
c.PutRaw("collection", "key", strings.NewReader("Some JSON"))
group := Group{Name: "name", Founded: 1990}
c.Put("collection", "key", group)
results, _ := c.Search("collection", "A Lucene Query", 100, 0)
var values []DomainObject{} = make([]DomainObject{}, len(results.Results))
for i, result := range results.Results {
result.Value(&values[i])
}
if results.HasNext() {
results, err := c.SearchGetNext(results)
}
events, _ := c.GetEvents("collection", "key", "kind")
c.PutEvent("collection", "key", "kind", domainObject)
c.PutEventRaw("collection", "key", "kind", strings.NewReader(serializedJson))
relations, _ := c.GetRelations("collection", "key", []string{"kind", "kind"})
c.PutRelation("sourceCollection", "sourceKey", "kind", "sinkCollection", "sinkKey")
valueAtRef := c.GetRef("collection", "key", "ref")
valueHistory := c.ListRefs("collection", "key", 10, true)