Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileCache ¶
type FileCache struct { sync.RWMutex // Used for controlling concurrent access to item list and cache table. // contains filtered or unexported fields }
FileCache implements a simple filesystem-based cache for arbitrary data.
func NewFileCache ¶
NewFileCache initializes a file cache under a specific path, most commonly a temporary directory, with an optional quota on the cache size. If the size of the quota is zero, the limit is assumed to be infinite.
func (*FileCache) Add ¶
Add inserts in `value` to file pointed to by `key`. Variable `value` is assumed to be a `[]byte` type, but is passed as an `interface{}` type to satisfy the generic `Cacher` interface.
func (*FileCache) RemoveOldest ¶
func (f *FileCache) RemoveOldest()
RemoveOldest removes the oldest file in cache, as determined by access time.
type Ico ¶
type Ico struct { Quota *int64 // The image cache size maximum, in bytes. S3Region *string // S3 region to use for bucket. S3Bucket *string // S3 bucket to use for image access. S3AccessKey *string // Access key to use for bucket. If empty, access will be attempted with IAM. S3SecretKey *string // Secret key to use for bucket. If empty, access will be attempted with IAM. // contains filtered or unexported fields }
The Ico service, containing state shared between methods.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
A Source represents an image source, which is usually matched against a URL endpoint, and provides options related to that endpoint.
func NewSource ¶
NewSource initializes a new source for region and bucket. Access is either provided by access and secret keys passed as parameters, or by IAM if the keys are invalid or empty. Any subsequent operations on the initialized source will affect the bucket pointed to.
func (*Source) Delete ¶
Delete removes one or more files from local cache and S3 bucket for this source.