Documentation ¶
Overview ¶
Package postgres provides a TrafficVault implementation which uses PostgreSQL as the backend.
Index ¶
- type Config
- type Error
- type HashiCorpVault
- type Postgres
- func (p *Postgres) DeleteDNSSECKeys(cdnName string, tx *sql.Tx, ctx context.Context) error
- func (p *Postgres) DeleteDeliveryServiceSSLKeys(xmlID string, version string, tx *sql.Tx, ctx context.Context) error
- func (p *Postgres) DeleteOldDeliveryServiceSSLKeys(existingXMLIDs map[string]struct{}, cdnName string, tx *sql.Tx, ...) error
- func (p *Postgres) DeleteURISigningKeys(xmlID string, tx *sql.Tx, ctx context.Context) error
- func (p *Postgres) DeleteURLSigKeys(xmlID string, tx *sql.Tx, ctx context.Context) error
- func (p *Postgres) GetBucketKey(bucket string, key string, tx *sql.Tx) ([]byte, bool, error)
- func (p *Postgres) GetCDNSSLKeys(cdnName string, tx *sql.Tx, ctx context.Context) ([]tc.CDNSSLKey, error)
- func (p *Postgres) GetDNSSECKeys(cdnName string, tx *sql.Tx, ctx context.Context) (tc.DNSSECKeysTrafficVault, bool, error)
- func (p *Postgres) GetDeliveryServiceSSLKeys(xmlID string, version string, tx *sql.Tx, ctx context.Context) (tc.DeliveryServiceSSLKeysV15, bool, error)
- func (p *Postgres) GetExpirationInformation(tx *sql.Tx, ctx context.Context, days int) ([]tc.SSLKeyExpirationInformation, error)
- func (p *Postgres) GetURISigningKeys(xmlID string, tx *sql.Tx, ctx context.Context) ([]byte, bool, error)
- func (p *Postgres) GetURLSigKeys(xmlID string, tx *sql.Tx, ctx context.Context) (tc.URLSigKeys, bool, error)
- func (p *Postgres) Ping(tx *sql.Tx, ctx context.Context) (tc.TrafficVaultPing, error)
- func (p *Postgres) PutDNSSECKeys(cdnName string, keys tc.DNSSECKeysTrafficVault, tx *sql.Tx, ...) error
- func (p *Postgres) PutDeliveryServiceSSLKeys(key tc.DeliveryServiceSSLKeys, tx *sql.Tx, ctx context.Context) error
- func (p *Postgres) PutURISigningKeys(xmlID string, keysJson []byte, tx *sql.Tx, ctx context.Context) error
- func (p *Postgres) PutURLSigKeys(xmlID string, keys tc.URLSigKeys, tx *sql.Tx, ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DBName string `json:"dbname"` Hostname string `json:"hostname"` User string `json:"user"` Password string `json:"password"` Port int `json:"port"` SSL bool `json:"ssl"` MaxConnections int `json:"max_connections"` MaxIdleConnections int `json:"max_idle_connections"` ConnMaxLifetimeSeconds int `json:"conn_max_lifetime_seconds"` QueryTimeoutSeconds int `json:"query_timeout_seconds"` AesKeyLocation string `json:"aes_key_location"` HashiCorpVault *HashiCorpVault `json:"hashicorp_vault"` }
type HashiCorpVault ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) DeleteDNSSECKeys ¶
func (*Postgres) DeleteDeliveryServiceSSLKeys ¶
func (p *Postgres) DeleteDeliveryServiceSSLKeys(xmlID string, version string, tx *sql.Tx, ctx context.Context) error
DeleteDeliveryServiceSSLKeys removes the SSL keys of the given version (or latest if version is empty) for the delivery service identified by the given xmlID.
func (*Postgres) DeleteOldDeliveryServiceSSLKeys ¶
func (p *Postgres) DeleteOldDeliveryServiceSSLKeys(existingXMLIDs map[string]struct{}, cdnName string, tx *sql.Tx, ctx context.Context) error
DeleteOldDeliveryServiceSSLKeys takes a set of existingXMLIDs as input and will remove all SSL keys for delivery services in the CDN identified by the given cdnName that do not contain an xmlID in the given set of existingXMLIDs. This method is called during a snapshot operation in order to delete SSL keys for delivery services that no longer exist.
func (*Postgres) DeleteURISigningKeys ¶
func (*Postgres) DeleteURLSigKeys ¶
func (*Postgres) GetBucketKey ¶
func (*Postgres) GetCDNSSLKeys ¶
func (p *Postgres) GetCDNSSLKeys(cdnName string, tx *sql.Tx, ctx context.Context) ([]tc.CDNSSLKey, error)
GetCDNSSLKeys retrieves all the SSL keys for delivery services in the CDN identified by the given cdnName.
func (*Postgres) GetDNSSECKeys ¶
func (*Postgres) GetDeliveryServiceSSLKeys ¶
func (p *Postgres) GetDeliveryServiceSSLKeys(xmlID string, version string, tx *sql.Tx, ctx context.Context) (tc.DeliveryServiceSSLKeysV15, bool, error)
GetDeliveryServiceSSLKeys retrieves the SSL keys of the given version for the delivery service identified by the given xmlID. If version is empty, the implementation should return the latest version.
func (*Postgres) GetExpirationInformation ¶
func (p *Postgres) GetExpirationInformation(tx *sql.Tx, ctx context.Context, days int) ([]tc.SSLKeyExpirationInformation, error)
GetExpirationInformation returns the expiration information for all SSL Keys.
func (*Postgres) GetURISigningKeys ¶
func (*Postgres) GetURLSigKeys ¶
func (*Postgres) PutDNSSECKeys ¶
func (*Postgres) PutDeliveryServiceSSLKeys ¶
func (p *Postgres) PutDeliveryServiceSSLKeys(key tc.DeliveryServiceSSLKeys, tx *sql.Tx, ctx context.Context) error
PutDeliveryServiceSSLKeys stores the given SSL keys for a delivery service.