tilezen

package module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

README

go-http-tilezen

Work in progress.

Example

TilezenProxyHandler
import (
	tz_http "github.com/sfomuseum/go-http-tilezen/http"
	"github.com/whosonfirst/go-cache-blob"
	"net/http"	
)

func main() {

	blob_dsn := "s3://your-bucket?region=us-east-1&prefix=tilezen&credentials=iam:"     
	proxy_timeout := 30
	proxy_url := "/tiles/"
	
	mux := http.NewServeMux()
			
	blob_cache, _ := blob.NewBlobCacheWithDSN(blob_dsn)

	timeout := time.Duration(proxy_timeout) * time.Second
		
	proxy_opts := &tz_http.TilezenProxyHandlerOptions{
		Cache: blob_cache,
		Timeout: timeout,
	}

	proxy_handler, _ := tz_http.TilezenProxyHandler(proxy_opts)

	mux.Handle(proxy_url, proxy_handler)

	http.ListenAndServe(":8080", mux)

Error handling removed for the sake of brevity.

See also

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL