Documentation ¶
Index ¶
- Constants
- func DeleteDSSSLKeys(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, xmlID string, ...) error
- func DeleteDeliveryServicesSSLKey(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, key string) error
- func DeleteObject(key string, bucket string, cluster StorageCluster) error
- func FetchObjectValues(key string, bucket string, cluster StorageCluster) ([]*riak.Object, error)
- func GetBucketKey(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, bucket string, ...) ([]byte, bool, error)
- func GetCDNSSLKeysDSNames(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, cdn tc.CDNName) (map[tc.DeliveryServiceName][]string, error)
- func GetCDNSSLKeysObj(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, cdnName string) ([]tc.CDNSSLKey, error)
- func GetDNSSECKeys(cdnName string, tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) (tc.DNSSECKeysRiak, bool, error)
- func GetDeliveryServiceSSLKeysObj(xmlID string, version string, tx *sql.Tx, authOpts *riak.AuthOptions, ...) (tc.DeliveryServiceSSLKeys, bool, error)
- func GetDeliveryServiceSSLKeysObjV15(xmlID string, version string, tx *sql.Tx, authOpts *riak.AuthOptions, ...) (tc.DeliveryServiceSSLKeysV15, bool, error)
- func GetRiakCluster(servers []ServerAddr, authOptions *riak.AuthOptions) (*riak.Cluster, error)
- func GetRiakConfig(riakConfigFile string) (bool, *riak.AuthOptions, error)
- func GetURISigningKeysRaw(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, key string) ([]byte, bool, error)
- func GetURLSigConfigFileName(ds tc.DeliveryServiceName) string
- func GetURLSigKeys(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, ...) (tc.URLSigKeys, bool, error)
- func GetURLSigKeysFromConfigFileKey(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, configFileKey string) (tc.URLSigKeys, bool, error)
- func MakeDSSSLKeyKey(dsName, version string) string
- func Ping(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) (tc.RiakPingResp, error)
- func PingCluster(cluster StorageCluster) error
- func PutDNSSECKeys(keys tc.DNSSECKeysRiak, cdnName string, tx *sql.Tx, authOpts *riak.AuthOptions, ...) error
- func PutDeliveryServiceSSLKeysObj(key tc.DeliveryServiceSSLKeys, tx *sql.Tx, authOpts *riak.AuthOptions, ...) error
- func PutURLSigKeys(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, ...) error
- func SaveObject(obj *riak.Object, bucket string, cluster StorageCluster) error
- func Search(cluster StorageCluster, index string, query string, filterQuery string, ...) ([]*riak.SearchDoc, error)
- func SearchDocsToCDNSSLKeys(docs []*riak.SearchDoc) []tc.CDNSSLKey
- func WithCluster(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, ...) error
- type RiakStorageCluster
- type ServerAddr
- type StorageCluster
- type TOAuthOptions
Constants ¶
const ( // DefaultRiakPort is the port RIAK is listening on, if no port is configured. DefaultRiakPort = uint(8087) TimeOut = time.Second * 5 DefaultHealthCheckInterval = time.Second * 5 DefaultMaxCommandExecutionAttempts = 5 )
const CDNSSLKeysLimit = 1000 // TODO: emulates Perl; reevaluate?
const DNSSECKeysBucket = "dnssec"
const DSSSLKeyVersionLatest = "latest"
const DefaultDSSSLKeyVersion = DSSSLKeyVersionLatest
const DeliveryServiceSSLKeysBucket = "ssl"
const SSLKeysIndex = "sslkeys"
const URISigningKeysBucket = "cdn_uri_sig_keys"
const URLSigKeysBucket = "url_sig_keys"
Variables ¶
This section is empty.
Functions ¶
func DeleteDSSSLKeys ¶
func DeleteDeliveryServicesSSLKey ¶
func DeleteDeliveryServicesSSLKey(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, key string) error
DeleteDeliveryServicesSSLKey deletes a Delivery Service SSL key. This should almost never be used directly, prefer DeleteDSSSLKeys instead. This should only be used to delete keys, which may not conform to the MakeDSSSLKeyKey format. For example when deleting all keys on a delivery service, and some may have been created manually outside Traffic Ops, or are otherwise malformed.
func DeleteObject ¶
func DeleteObject(key string, bucket string, cluster StorageCluster) error
deletes an object from riak storage
func FetchObjectValues ¶
func FetchObjectValues(key string, bucket string, cluster StorageCluster) ([]*riak.Object, error)
fetch an object from riak storage
func GetBucketKey ¶
func GetCDNSSLKeysDSNames ¶
func GetCDNSSLKeysDSNames(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, cdn tc.CDNName) (map[tc.DeliveryServiceName][]string, error)
GetCDNSSLKeysDSNames returns the delivery service names (xml_id) of every delivery service on the given cdn with SSL keys in Riak, and the keys currently in Riak. Returns map[tc.DeliveryServiceName][]key
func GetCDNSSLKeysObj ¶
func GetDNSSECKeys ¶
func GetRiakCluster ¶
func GetRiakCluster(servers []ServerAddr, authOptions *riak.AuthOptions) (*riak.Cluster, error)
func GetRiakConfig ¶
func GetURISigningKeysRaw ¶
func GetURISigningKeysRaw(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, key string) ([]byte, bool, error)
GetURISigningKeysRaw gets the URL Sig keys for the given delivery service, as the raw bytes stored in Riak.
func GetURLSigConfigFileName ¶
func GetURLSigConfigFileName(ds tc.DeliveryServiceName) string
GetURLSigConfigFileName returns the filename of the Apache Traffic Server URLSig config file TODO move to ats config directory/file
func GetURLSigKeys ¶
func GetURLSigKeysFromConfigFileKey ¶
func GetURLSigKeysFromConfigFileKey(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, configFileKey string) (tc.URLSigKeys, bool, error)
GetURLSigKeysFromKey gets the URL Sig keys from the raw Riak key, which is the ATS config file name.
func MakeDSSSLKeyKey ¶
func PingCluster ¶
func PingCluster(cluster StorageCluster) error
PingCluster pings the given Riak cluster, and returns nil on success, or any error
func PutDNSSECKeys ¶
func PutURLSigKeys ¶
func SaveObject ¶
func SaveObject(obj *riak.Object, bucket string, cluster StorageCluster) error
func Search ¶
func Search(cluster StorageCluster, index string, query string, filterQuery string, numRows int, fields []string) ([]*riak.SearchDoc, error)
Search searches Riak for the given query. Returns nil and a nil error if no object was found. If fields is empty, all fields will be returned.
func SearchDocsToCDNSSLKeys ¶
func SearchDocsToCDNSSLKeys(docs []*riak.SearchDoc) []tc.CDNSSLKey
SearchDocsToCDNSSLKeys converts the SearchDoc array returned by Riak into a CDNSSLKey slice. If a SearchDoc doesn't contain expected fields, it creates the key with those fields defaulted to empty strings.
func WithCluster ¶
Types ¶
type RiakStorageCluster ¶
type RiakStorageCluster struct {
Cluster *riak.Cluster
}
RiakStorageCluster ...
func (RiakStorageCluster) Execute ¶
func (ri RiakStorageCluster) Execute(command riak.Command) error
Execute ...
type ServerAddr ¶
func GetRiakServers ¶
func GetRiakServers(tx *sql.Tx, riakPort *uint) ([]ServerAddr, error)
GetRiakServers returns the riak servers from the database. The riakPort may be nil, in which case the default port is returned.
type StorageCluster ¶
StorageCluster ...
func GetPooledCluster ¶
func GetPooledCluster(tx *sql.Tx, authOptions *riak.AuthOptions, riakPort *uint) (StorageCluster, error)
func GetRiakStorageCluster ¶
func GetRiakStorageCluster(servers []ServerAddr, authOptions *riak.AuthOptions) (StorageCluster, error)
type TOAuthOptions ¶
type TOAuthOptions struct { riak.AuthOptions MaxTLSVersion *string }