keyspace

package
v2.28.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: GPL-3.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Key               string `json:"key"`
	Name              string `json:"name"`
	Datacenter        string `json:"datacenter"`
	ReplicationFactor int    `json:"replicationFactor"`
	Contact           string `json:"contact"`
	TTL               int    `json:"ttl"`
}

Config is the json format for the keyspace configuration

func (*Config) Validate

func (c *Config) Validate() gobol.Error

Validate checks if config is valid

type ConfigUpdate

type ConfigUpdate struct {
	Contact string `json:"contact,omitempty"`
}

ConfigUpdate is the json format for a keyspace update request

func (*ConfigUpdate) Validate

func (c *ConfigUpdate) Validate() gobol.Error

Validate checks if the update to the keyspace will be valid

type CreateResponse

type CreateResponse struct {
	Ksid string `json:"ksid,omitempty"`
}

CreateResponse is the json format for a keyspace creation endpoint response

type Keyspace

type Keyspace struct {
	*persistence.Storage
	// contains filtered or unexported fields
}

Keyspace is a structure that represents the functionality of this module

func New

func New(
	timelineManager *tlmanager.Instance,
	storage *persistence.Storage,
	devMode bool,
	defaultTTL int,
	maxAllowedTTL int,
) *Keyspace

New creates a new keyspace manager

func (*Keyspace) Check

func (kspace *Keyspace) Check(
	w http.ResponseWriter,
	r *http.Request,
	ps httprouter.Params,
)

Check verifies if a keyspace exists

func (*Keyspace) Create

func (kspace *Keyspace) Create(
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
)

Create is a rest endpoint to create a keyspace

func (*Keyspace) GetAll

func (kspace *Keyspace) GetAll(
	w http.ResponseWriter,
	r *http.Request,
	ps httprouter.Params,
)

GetAll is a rest endpoint that returns all the datacenters

func (*Keyspace) ListDC

func (kspace *Keyspace) ListDC(
	w http.ResponseWriter,
	r *http.Request,
	ps httprouter.Params,
)

ListDC lists all the datacenters in the cassandra / scylladb cluster

func (*Keyspace) Update

func (kspace *Keyspace) Update(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

Update is a rest endpoint that takes care of updating the keyspace metadata information

type Response

type Response struct {
	TotalRecords int         `json:"totalRecords,omitempty"`
	Payload      interface{} `json:"payload,omitempty"`
	Message      interface{} `json:"message,omitempty"`
}

Response is a generic endpoint response

Jump to

Keyboard shortcuts

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