endpoint

package
v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyspacesPathFormat    = "v1/keyspaces"
	TablesPathFormat       = "v1/keyspaces/%s/tables"
	TableSinglePathFormat  = "v1/keyspaces/%s/tables/%s"
	ColumnsPathFormat      = "v1/keyspaces/%s/tables/%s/columns"
	ColumnSinglePathFormat = "v1/keyspaces/%s/tables/%s/columns/%s"
	RowsPathFormat         = "v1/keyspaces/%s/tables/%s/rows"
	RowSinglePathFormat    = "v1/keyspaces/%s/tables/%s/rows/%s"
	QueryPathFormat        = "v1/keyspaces/%s/tables/%s/rows/query"
)

Variables

This section is empty.

Functions

func RespondJSONObjectWithCode

func RespondJSONObjectWithCode(w http.ResponseWriter, code int, obj interface{})

RespondJSONObjectWithCode writes the object and status header to the response. Important to note that if this is being used for an error case then an empty return will need to immediately follow the call to this function

func RespondWithError

func RespondWithError(w http.ResponseWriter, message string, code int)

func RespondWithKeyspaceNotAllowed

func RespondWithKeyspaceNotAllowed(w http.ResponseWriter)

func Routes

func Routes(prefix string, operations config.SchemaOperations, singleKeyspace string, cfg config.Config, dbClient *db.Db) []types.Route

Routes returns a slice of all the REST endpoint routes

Types

type InternalError

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

func (*InternalError) Error

func (e *InternalError) Error() string

func (*InternalError) StatusCode

func (e *InternalError) StatusCode() int

Jump to

Keyboard shortcuts

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