Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyspaceIdentifier ¶
func GenerateKeyspaceIdentifier() string
GenerateKeyspaceIdentifier generates the unique ID for keyspaces
Types ¶
type Backend ¶
type Backend interface { // CreateKeyspace should create a keyspace to store data CreateKeyspace( name, datacenter, contact string, replication int, ttl int, ) gobol.Error // DeleteKeyspace should delete a keyspace from the database DeleteKeyspace(id string) gobol.Error // ListKeyspaces should return a list of all available keyspaces ListKeyspaces() ([]Keyspace, gobol.Error) // GetKeyspace should return the management data regarding the keyspace GetKeyspace(id string) (Keyspace, bool, gobol.Error) // UpdateKeyspace should update metadata and contact information about the // keyspace UpdateKeyspace(ksid, contact string) gobol.Error // ListDatacenters should list all available datacenters ListDatacenters() ([]string, gobol.Error) }
Backend hides the underlying implementation of the persistence
type Keyspace ¶
type Keyspace struct { // Name is a human-friendly name for the keyspace Name string `json:"name"` // Contact should be an email address for an owner of the keyspace Contact string `json:"contact"` // DC is the datacenter where the keyspace should reside DC string `json:"datacenter"` // TTL is the time-to-live for the keyspace data TTL int `json:"ttl"` // --- This will be removed --- Replication int `json:"replicationFactor"` }
Keyspace represents a keyspace within the database
type Storage ¶
type Storage struct { // Backend is the thing that actually does the specific work in the storage Backend // contains filtered or unexported fields }
Storage is a storage for data
func NewStorage ¶
func NewStorage( ksAdmin string, grantUser string, logger *zap.Logger, session *gocql.Session, metadata *metadata.Storage, stats *tsstats.StatsTS, devMode bool, defaultTTL int, ) (*Storage, error)
NewStorage creates a new storage persistence
func (*Storage) CreateKeyspace ¶
func (storage *Storage) CreateKeyspace( name, datacenter, contact string, replication int, ttl int, ) gobol.Error
CreateKeyspace is a wrapper around the Backend in order to create metadata with the actual keyspace creation
func (*Storage) DatacenterExists ¶
DatacenterExists checks whether a given datacenter exists
Click to show internal directories.
Click to hide internal directories.