Documentation ¶
Index ¶
Constants ¶
const ( // PolicyWriteDeepFirst will write to caches starting from the last layer // provided. This is the default behavior, as the more common use case // will be for the last layer to be the most persistent e.g. DB call PolicyWriteDeepFirst = WritePolicy("DEEP_FIRST") // PolicyWriteShallowFirst will write to caches starting from the top, // often least persistent, layer e.g. a struct in process heap PolicyWriteShallowFirst = WritePolicy("SHALLOW_FIRST") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamoDB ¶
type DynamoDB struct {
// contains filtered or unexported fields
}
DynamoDB represents a DynamoDB implementation of autocert.Cache
func NewDynamoDB ¶
func NewDynamoDB(credentials *credentials.Credentials, region, table string) *DynamoDB
NewDynamoDB returns a DynamoDB certificate cache
func (*DynamoDB) Delete ¶
Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.
type Firestore ¶
type Firestore struct {
// contains filtered or unexported fields
}
Firestore is a Google Firestore implementation of autocert.Cache
func NewFirestore ¶
NewFirestore is the default constructor for a Firestore CertCache
func NewFirestoreWithCollection ¶
NewFirestoreWithCollection is a constructor for a FirestoreCertCache with a custom Firestore Collection name
func (*Firestore) Delete ¶
Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.
type Functional ¶
type Functional struct {
// contains filtered or unexported fields
}
Functional allows the user to use functions to define a cert cache. If we have the get function always return an autocert.ErrCacheMiss error, we can use this cert cache for testing next cache layer's preconditions, or simply logging events (see Newlogger() function)
func NewFunctional ¶
func NewFunctional( get func(context.Context, string) ([]byte, error), put func(context.Context, string, []byte) error, del func(context.Context, string) error, ) *Functional
NewFunctional is the constructor for a functional Cert Cache
func NewLogger ¶
func NewLogger() *Functional
NewLogger is the constructor for a Functional cert cache implementation which does nothing other than log events
func (*Functional) Delete ¶
func (f *Functional) Delete(ctx context.Context, key string) error
Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.
type LayeredCache ¶
type LayeredCache struct {
// contains filtered or unexported fields
}
LayeredCache is an implementation of the autocert.Cache interface. The behavior of the cache consists in checking itself for hits, and having a fall back storage layer to search in the event of a cache miss
func NewLayered ¶
func NewLayered(layers ...autocert.Cache) *LayeredCache
NewLayered returns a new layered cache given autocert.Cache implementations
func NewLayeredWithPolicy ¶
func NewLayeredWithPolicy(wp WritePolicy, layers ...autocert.Cache) *LayeredCache
NewLayeredWithPolicy returns a new layered cache and allows the user to specify the write policy
func (*LayeredCache) Delete ¶
func (c *LayeredCache) Delete(ctx context.Context, key string) error
Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
MongoDB represents a MongoDB implementation of autocert.Cache
func NewMongoDB ¶
NewMongoDB returns a Mongo cache given a mongodb connection string e.g. fmt.Sprintf("mongodb://%s:%s@%s/%s", username, password, host, db)
func (*MongoDB) Delete ¶
Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 represents an AWS S3 implementation of autocert.Cache
func NewS3 ¶
func NewS3(credentials *credentials.Credentials, bucket, region string) *S3
NewS3 returns an S3 certificate cache
func (*S3) Delete ¶
Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.
type WritePolicy ¶
type WritePolicy string
WritePolicy determines the order in which the layered cache executes Put