cassandra

package
v0.0.0-...-9be4a76 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2016 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAIN_KEYSPACE_ALIAS = "__main__"
)

Variables

View Source
var QUERY_AND = " AND "
View Source
var QUERY_DELETE = "DELETE FROM %s WHERE %s"
View Source
var QUERY_INSERT = "INSERT INTO %s (%s) VALUES(%s)"
View Source
var QUERY_ITEM = "%s = ?"
View Source
var QUERY_SELECT = "SELECT %s FROM "
View Source
var QUERY_SEPARATOR = ", "
View Source
var QUERY_UPDATE = "UPDATE %s SET %s WHERE %s"
View Source
var Sessions map[string]*gocql.Session
View Source
var TAG_NAME = "cassandra"

Functions

func AExecuteBatch

func AExecuteBatch(alias string, batch *gocql.Batch) error

func AQuery

func AQuery(alias, stmt string, values ...interface{}) *gocql.Query

func Delete

func Delete(table string, data interface{}) error

func ExecuteBatch

func ExecuteBatch(batch *gocql.Batch) error

func Insert

func Insert(table string, data interface{}, stmtExtras ...string) error

func NewKeyspaceSession

func NewKeyspaceSession(keyspace, alias string) (*gocql.Session, error)

func ParseUUID

func ParseUUID(input string) (gocql.UUID, error)

func Query

func Query(stmt string, values ...interface{}) *gocql.Query

func Select

func Select(table string) *selectQuery

func TimeUUID

func TimeUUID() gocql.UUID

func Update

func Update(table string, data interface{}) error

Types

type JSONTime

type JSONTime struct {
	time.Time
}

func Now

func Now() JSONTime

func Unix

func Unix(sec, nsec int64) JSONTime

func (JSONTime) MarshalCQL

func (t JSONTime) MarshalCQL(info gocql.TypeInfo) ([]byte, error)

func (JSONTime) MarshalJSON

func (t JSONTime) MarshalJSON() ([]byte, error)

func (*JSONTime) UnmarshalCQL

func (t *JSONTime) UnmarshalCQL(info gocql.TypeInfo, data []byte) error

type Order

type Order int
const (
	ASC Order = iota
	DESC
)

Jump to

Keyboard shortcuts

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