Documentation ¶
Index ¶
Constants ¶
View Source
const ( // required ConfigKeyBucket = "bucket" // optional ConfigKeyBasepath = "basepath" ConfigKeyMaxZoom = "max_zoom" ConfigKeyRegion = "region" // defaults to "us-east-1" ConfigKeyEndpoint = "endpoint" // defaults to "" ConfigKeyAWSAccessKeyID = "aws_access_key_id" ConfigKeyAWSSecretKey = "aws_secret_access_key" ConfigKeyACL = "access_control_list" // defaults to "" ConfigKeyCacheControl = "cache_control" // defaults to "" ConfigKeyContentType = "content_type" // defaults to "application/vnd.mapbox-vector-tile" )
View Source
const ( DefaultBasepath = "" DefaultRegion = "us-east-1" DefaultAccessKey = "" DefaultSecretKey = "" DefaultContentType = mvt.MimeType DefaultEndpoint = "" )
View Source
const CacheType = "s3"
Variables ¶
View Source
var (
ErrMissingBucket = errors.New("s3cache: missing required param 'bucket'")
)
Functions ¶
Types ¶
type Cache ¶
type Cache struct { // Bucket is the name of the s3 bucket to operate on Bucket string // Basepath is a path prefix added to all cache operations inside of the S3 bucket // helpful so a bucket does not need to be dedicated to only this cache Basepath string // MaxZoom determines the max zoom the cache to persist. Beyond this // zoom, cache Set() calls will be ignored. This is useful if the cache // should not be leveraged for higher zooms when data changes often. MaxZoom uint // client holds a reference to the s3 client. it's expected the client // has an active session and read, write, delete permissions have been checked Client *s3.S3 // ACL is the aws ACL, if the not set it will use the default value for aws. ACL string // CacheControl is the http Cache Control header, if the not set it will use the default value for aws. CacheControl string // ContentType is MIME content type of the tile. Default is "application/vnd.mapbox-vector-tile" ContentType string }
Click to show internal directories.
Click to hide internal directories.