riaksvc

package
v5.1.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
const CDNSSLKeysLimit = 1000 // TODO: emulates Perl; reevaluate?
View Source
const DNSSECKeysBucket = "dnssec"
View Source
const DSSSLKeyVersionLatest = "latest"
View Source
const DefaultDSSSLKeyVersion = DSSSLKeyVersionLatest
View Source
const DeliveryServiceSSLKeysBucket = "ssl"
View Source
const SSLKeysIndex = "sslkeys"
View Source
const URISigningKeysBucket = "cdn_uri_sig_keys"
View Source
const URLSigKeysBucket = "url_sig_keys"

Variables

This section is empty.

Functions

func DeleteDSSSLKeys

func DeleteDSSSLKeys(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, xmlID string, version string) error

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 GetBucketKey(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, bucket string, key string) ([]byte, bool, error)

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 GetCDNSSLKeysObj(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, cdnName string) ([]tc.CDNSSLKey, error)

func GetDNSSECKeys

func GetDNSSECKeys(cdnName string, tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) (tc.DNSSECKeysRiak, bool, error)

func GetDeliveryServiceSSLKeysObj

func GetDeliveryServiceSSLKeysObj(xmlID string, version string, tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) (tc.DeliveryServiceSSLKeys, bool, error)

func GetDeliveryServiceSSLKeysObjV15

func GetDeliveryServiceSSLKeysObjV15(xmlID string, version string, tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) (tc.DeliveryServiceSSLKeysV15, bool, error)

func GetRiakCluster

func GetRiakCluster(servers []ServerAddr, authOptions *riak.AuthOptions) (*riak.Cluster, error)

func GetRiakConfig

func GetRiakConfig(riakConfigFile string) (bool, *riak.AuthOptions, error)

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 GetURLSigKeys(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, ds tc.DeliveryServiceName) (tc.URLSigKeys, bool, error)

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 MakeDSSSLKeyKey(dsName, version string) string

func Ping

func Ping(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) (tc.RiakPingResp, error)

func PingCluster

func PingCluster(cluster StorageCluster) error

PingCluster pings the given Riak cluster, and returns nil on success, or any error

func PutDNSSECKeys

func PutDNSSECKeys(keys tc.DNSSECKeysRiak, cdnName string, tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) error

func PutDeliveryServiceSSLKeysObj

func PutDeliveryServiceSSLKeysObj(key tc.DeliveryServiceSSLKeys, tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint) error

func PutURLSigKeys

func PutURLSigKeys(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, ds tc.DeliveryServiceName, keys tc.URLSigKeys) error

func SaveObject

func SaveObject(obj *riak.Object, bucket string, cluster StorageCluster) error
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

func WithCluster(tx *sql.Tx, authOpts *riak.AuthOptions, riakPort *uint, f func(StorageCluster) error) error

Types

type RiakStorageCluster

type RiakStorageCluster struct {
	Cluster *riak.Cluster
}

RiakStorageCluster ...

func (RiakStorageCluster) Execute

func (ri RiakStorageCluster) Execute(command riak.Command) error

Execute ...

func (RiakStorageCluster) Start

func (ri RiakStorageCluster) Start() error

Start ...

func (RiakStorageCluster) Stop

func (ri RiakStorageCluster) Stop() error

Stop ...

type ServerAddr

type ServerAddr struct {
	FQDN string
	Port string
}

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

type StorageCluster interface {
	Start() error
	Stop() error
	Execute(riak.Command) error
}

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
}

Jump to

Keyboard shortcuts

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