common

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2014 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_INT = iota
	TYPE_STRING
	TYPE_BOOL
	TYPE_DOUBLE
	TYPE_UNKNOWN
)
View Source
const (
	WrongNumberOfArguments = iota
	InvalidArgument
	InternalError
)

Variables

View Source
var (
	TRUE  = true
	FALSE = false
)

Functions

func ConvertToDataStoreSeries added in v0.5.0

func ConvertToDataStoreSeries(s ApiSeries, precision TimePrecision) (*protocol.Series, error)

func CurrentTime

func CurrentTime() int64

func GetFileSize added in v0.4.0

func GetFileSize(path string) (int64, error)

func MergeSeries added in v0.5.6

func MergeSeries(s1, s2 *protocol.Series) *protocol.Series

merges two time series making sure that the resulting series has the union of the two series columns and the values set properly. will panic if the two series don't have the same name

func ParseTimeDuration added in v0.5.0

func ParseTimeDuration(value string) (int64, error)

Returns the parsed duration in nanoseconds, support 'u', 's', 'm', 'h', 'd' and 'w' suffixes.

func RecoverFunc added in v0.5.5

func RecoverFunc(database, query string, cleanup func(err interface{}))

func StringToSeriesArray

func StringToSeriesArray(seriesString string, args ...interface{}) ([]*protocol.Series, error)

func TimeToMicroseconds

func TimeToMicroseconds(t time.Time) int64

Types

type ApiSeries added in v0.5.5

type ApiSeries interface {
	GetName() string
	GetColumns() []string
	GetPoints() [][]interface{}
}

type AuthenticationError added in v0.5.0

type AuthenticationError string

func NewAuthenticationError added in v0.5.0

func NewAuthenticationError(formatStr string, args ...interface{}) AuthenticationError

func (AuthenticationError) Error added in v0.5.0

func (self AuthenticationError) Error() string

type AuthorizationError added in v0.1.0

type AuthorizationError string

func NewAuthorizationError added in v0.1.0

func NewAuthorizationError(formatStr string, args ...interface{}) AuthorizationError

func (AuthorizationError) Error added in v0.1.0

func (self AuthorizationError) Error() string

type DatabaseExistsError added in v0.6.0

type DatabaseExistsError string

func NewDatabaseExistsError added in v0.6.0

func NewDatabaseExistsError(db string) DatabaseExistsError

func (DatabaseExistsError) Error added in v0.6.0

func (self DatabaseExistsError) Error() string

type EnhancedTime

type EnhancedTime time.Time

type ErrorWithStacktrace added in v0.5.0

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

An error that remembers where it was thrown from

func NewErrorWithStacktrace added in v0.5.0

func NewErrorWithStacktrace(cause error, msg ...interface{}) *ErrorWithStacktrace

if msg is provided, msg is treated as the error message and the error is treated as the original cause of this error. Otherwise the error is used as the error message. This is useful for chaining multiple errors to trace what was the original error that triggered the subsequent errors

func (*ErrorWithStacktrace) Error added in v0.5.0

func (self *ErrorWithStacktrace) Error() string

type QueryError

type QueryError struct {
	ErrorCode int
	ErrorMsg  string
}

func NewQueryError

func NewQueryError(code int, msg string, args ...interface{}) *QueryError

func (*QueryError) Error

func (self *QueryError) Error() string

type SerializedSeries added in v0.5.0

type SerializedSeries struct {
	Name    string          `json:"name"`
	Columns []string        `json:"columns"`
	Points  [][]interface{} `json:"points"`
}

func SerializeSeries added in v0.5.0

func SerializeSeries(memSeries map[string]*protocol.Series, precision TimePrecision) []*SerializedSeries

takes a slice of protobuf series and convert them to the format that the http api expect

func (*SerializedSeries) GetColumns added in v0.5.5

func (self *SerializedSeries) GetColumns() []string

func (*SerializedSeries) GetName added in v0.5.5

func (self *SerializedSeries) GetName() string

func (*SerializedSeries) GetPoints added in v0.5.5

func (self *SerializedSeries) GetPoints() [][]interface{}

type TimePrecision added in v0.5.0

type TimePrecision int
const (
	MicrosecondPrecision TimePrecision = iota
	MillisecondPrecision
	SecondPrecision
)

type Type added in v0.4.0

type Type int

func CoerceValues added in v0.4.0

func CoerceValues(leftValue, rightValue *protocol.FieldValue) (interface{}, interface{}, Type)

type User added in v0.0.2

type User interface {
	GetName() string
	IsDeleted() bool
	IsClusterAdmin() bool
	IsDbAdmin(db string) bool
	GetDb() string
	HasWriteAccess(name string) bool
	HasReadAccess(name string) bool
}

Jump to

Keyboard shortcuts

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