Skip to content

mnhkahn/swiftype

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swiftype v1

This is a Golang client for swiftype. Only support search.

Getting started

To get the package, execute:

go get gopkg.in/mnhkahn/swiftype.v1

For more details, see the API documentation.

godoc

Example

import "gopkg.in/mnhkahn/swiftype.v1"

var (
	SWIFTYPE        *swiftype.Client
	SWIFTYPE_APIKEY = "YOUR OWN API KEY"
	SWIFTYPE_HOST   = "api.swiftype.com"
	SWIFTYPE_ENGINE = "YOUR OWN ENGINE"
)

func InitSwiftype() error {
	SWIFTYPE = swiftype.NewClientWithApiKey(SWIFTYPE_APIKEY, SWIFTYPE_HOST)
	return nil
}

func Search(q string) *swiftype.SwiftypeResult {
	data, err := SWIFTYPE.Search(SWIFTYPE_ENGINE, q)
	if err != nil {
		panic(err)
	}
	return data
}

About

This is a Golang client for swiftype.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%