Documentation ¶
Index ¶
- Constants
- func NewCloudDatastoreStorage(caURL *url.URL) (caddytls.Storage, error)
- type CloudDsStorage
- func (cds *CloudDsStorage) DeleteSite(domain string) error
- func (cds *CloudDsStorage) LoadSite(domain string) (*caddytls.SiteData, error)
- func (cds *CloudDsStorage) LoadUser(email string) (*caddytls.UserData, error)
- func (cds *CloudDsStorage) MostRecentUserEmail() string
- func (cds *CloudDsStorage) SiteExists(domain string) (bool, error)
- func (cds *CloudDsStorage) StoreSite(domain string, data *caddytls.SiteData) error
- func (cds *CloudDsStorage) StoreUser(email string, data *caddytls.UserData) error
- func (cds *CloudDsStorage) TryLock(domain string) (caddytls.Waiter, error)
- func (cds *CloudDsStorage) Unlock(domain string) error
Constants ¶
const ( // DefaultPrefix defines the default prefix in KV store DefaultPrefix = "caddytls" // DefaultAESKeyB64 32 bytes when decoded DefaultAESKeyB64 = "Y29uc3VsdGxzLTEyMzQ1Njc4OTAtY2FkZHl0bHMtMzI=" // EnvNameAESKey defines the env variable name to override AES key, create with `openssl rand -base64 32` or similar EnvNameAESKey = "CADDY_CLOUDDATASTORETLS_B64_AESKEY" // EnvNamePrefix defines the env variable name to override key prefix EnvNamePrefix = "CADDY_CLOUDDATASTORETLS_PREFIX" EnvNameProjectId = "DATASTORE_PROJECT_ID" // id, not name // Create a service account at https://console.developers.google.com/permissions/serviceaccounts // with a Datastore -> Cloud Datastore User role, then create and download a json key for the service account. // This env var is the full path to the json key file EnvNameServiceAccountPath = "CADDY_CLOUDDATASTORETLS_SERVICE_ACCOUNT_FILE" SITE_RECORD = "caddytlsSiteRecord" USER_RECORD = "caddytlsUserRecord" MOST_RECENT_USER_RECORD = "caddytlsMostRecentUserRecord" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudDsStorage ¶
type CloudDsStorage struct {
// contains filtered or unexported fields
}
CloudDsStorage holds all parameters for the Cloud Datastore connection
func (*CloudDsStorage) DeleteSite ¶
func (cds *CloudDsStorage) DeleteSite(domain string) error
DeleteSite deletes site data for a given domain
func (*CloudDsStorage) LoadSite ¶
func (cds *CloudDsStorage) LoadSite(domain string) (*caddytls.SiteData, error)
LoadSite loads the site data for a domain from Cloud Datastore
func (*CloudDsStorage) LoadUser ¶
func (cds *CloudDsStorage) LoadUser(email string) (*caddytls.UserData, error)
LoadUser loads user data for a given email address
func (*CloudDsStorage) MostRecentUserEmail ¶
func (cds *CloudDsStorage) MostRecentUserEmail() string
MostRecentUserEmail returns the last modified Email address from cloud datastore.
func (*CloudDsStorage) SiteExists ¶
func (cds *CloudDsStorage) SiteExists(domain string) (bool, error)
SiteExists checks if a cert for a specific domain already exists
func (*CloudDsStorage) StoreSite ¶
func (cds *CloudDsStorage) StoreSite(domain string, data *caddytls.SiteData) error
StoreSite stores the site data for a given domain in Cloud Datastore
func (*CloudDsStorage) StoreUser ¶
func (cds *CloudDsStorage) StoreUser(email string, data *caddytls.UserData) error
StoreUser stores user data for a given email address in KV store
func (*CloudDsStorage) TryLock ¶
func (cds *CloudDsStorage) TryLock(domain string) (caddytls.Waiter, error)
TryLock attempts to set a global lock for a given domain. If a lock is already set it will return a `caddytls.Waiter` that will resolve when the lock is free.
func (*CloudDsStorage) Unlock ¶
func (cds *CloudDsStorage) Unlock(domain string) error
Unlock releases an existing lock