コード例 #1
0
func tearDown(t *testing.T) {
	orchestrate_api_key := os.Getenv("ORCHESTRATE_API_KEY")
	o := gorc.NewClient(orchestrate_api_key)
	o.DeleteCollection("documents")
	o.DeleteCollection("signings")
	o.DeleteCollection("signature_elements")
	o.DeleteCollection("text_elements")
}
コード例 #2
0
func Conn() *gorc.Client {
	client := gorc.NewClient(ORCHESTRATE_API_KEY)
	return client
}
コード例 #3
0
package main

import (
	"bytes"
	"encoding/json"
	"github.com/hoisie/web"
	"github.com/orchestrate-io/gorc"
	"log"
	"os"
	"strconv"
)

var (
	c = gorc.NewClient(os.Getenv("ORC_KEY"))
)

func main() {
	port := os.Getenv("PORT")
	log.Printf("Listening on port %v ...", port)
	web.Get("/([^/]+/?)", search)
	web.Run(":" + port)
}

func search(ctx *web.Context, collection string) {
	ctx.ContentType("json")
	ctx.SetHeader("Access-Control-Allow-Origin", "*", true)

	query := ctx.Params["query"]

	var limit, offset int64
	var err error