postgres

package
v7.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 21 Imported by: 4

Documentation

Overview

Package postgres provides a TrafficVault implementation which uses PostgreSQL as the backend.

Index

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 Error

type Error string

func (Error) Error

func (e Error) Error() string

type HashiCorpVault

type HashiCorpVault struct {
	Address    string `json:"address"`
	RoleID     string `json:"role_id"`
	SecretID   string `json:"secret_id"`
	LoginPath  string `json:"login_path"`
	SecretPath string `json:"secret_path"`
	TimeoutSec int    `json:"timeout_sec"`
	Insecure   bool   `json:"insecure"`
}

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func (*Postgres) DeleteDNSSECKeys

func (p *Postgres) DeleteDNSSECKeys(cdnName string, tx *sql.Tx, ctx context.Context) error

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 (p *Postgres) DeleteURISigningKeys(xmlID string, tx *sql.Tx, ctx context.Context) error

func (*Postgres) DeleteURLSigKeys

func (p *Postgres) DeleteURLSigKeys(xmlID string, tx *sql.Tx, ctx context.Context) error

func (*Postgres) GetBucketKey

func (p *Postgres) GetBucketKey(bucket string, key string, tx *sql.Tx) ([]byte, bool, error)

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 (p *Postgres) GetDNSSECKeys(cdnName string, tx *sql.Tx, ctx context.Context) (tc.DNSSECKeysTrafficVault, bool, error)

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 (p *Postgres) GetURISigningKeys(xmlID string, tx *sql.Tx, ctx context.Context) ([]byte, bool, error)

func (*Postgres) GetURLSigKeys

func (p *Postgres) GetURLSigKeys(xmlID string, tx *sql.Tx, ctx context.Context) (tc.URLSigKeys, bool, error)

func (*Postgres) Ping

func (p *Postgres) Ping(tx *sql.Tx, ctx context.Context) (tc.TrafficVaultPing, error)

func (*Postgres) PutDNSSECKeys

func (p *Postgres) PutDNSSECKeys(cdnName string, keys tc.DNSSECKeysTrafficVault, tx *sql.Tx, ctx context.Context) error

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.

func (*Postgres) PutURISigningKeys

func (p *Postgres) PutURISigningKeys(xmlID string, keysJson []byte, tx *sql.Tx, ctx context.Context) error

func (*Postgres) PutURLSigKeys

func (p *Postgres) PutURLSigKeys(xmlID string, keys tc.URLSigKeys, tx *sql.Tx, ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL