m2mpdb

package
v0.0.0-...-af70fd6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

M2MP DB handling

Index

Constants

View Source
const (
	RN_STATUS_CREATED   = 100
	RN_STATUS_DELETED   = 5
	RN_STATUS_UNDEFINED = 0
)
View Source
const DATE_FORMAT = "2006-01-02"
View Source
const DEBUG = false

Variables

This section is empty.

Functions

func Close

func Close()

func NewSession

func NewSession(session *gocql.Session)

func NewSessionSimple

func NewSessionSimple(keyspace string) error

func RegistryNodeCleanup

func RegistryNodeCleanup() (err error)

Delete all the nodes marked for deletion (and their subnodes)

func SaveTSTime

func SaveTSTime(id string, dataType string, time time.Time, data string) error

func SaveTSTimeObj

func SaveTSTimeObj(id string, dataType string, time time.Time, obj interface{}) error

func SaveTSUUID

func SaveTSUUID(id string, dataType string, utime *gocql.UUID, data string) error

func WipeoutEverything

func WipeoutEverything(sure string)

Types

type RegistryFile

type RegistryFile struct {
	Node *RegistryNode
	// contains filtered or unexported fields
}

func NewRegistryFile

func NewRegistryFile(node *RegistryNode) *RegistryFile

func (*RegistryFile) Block

func (this *RegistryFile) Block(blockNb int) ([]byte, error)

func (*RegistryFile) BlockSize

func (this *RegistryFile) BlockSize() int

func (*RegistryFile) Create

func (this *RegistryFile) Create()

func (*RegistryFile) DelBlock

func (this *RegistryFile) DelBlock(blockNb int) error

func (*RegistryFile) Delete

func (this *RegistryFile) Delete(forReal bool)

func (*RegistryFile) Exists

func (this *RegistryFile) Exists() bool

func (*RegistryFile) Name

func (this *RegistryFile) Name() string

func (*RegistryFile) Ok

func (this *RegistryFile) Ok() bool

func (*RegistryFile) Reader

func (this *RegistryFile) Reader() *RegistryFilePointer

func (*RegistryFile) SetBlock

func (this *RegistryFile) SetBlock(blockNb int, data []byte) error

func (*RegistryFile) SetBlockSize

func (this *RegistryFile) SetBlockSize(size int) error

func (*RegistryFile) SetName

func (this *RegistryFile) SetName(name string) error

func (*RegistryFile) SetOk

func (this *RegistryFile) SetOk(ok bool)

func (*RegistryFile) SetSize

func (this *RegistryFile) SetSize(size int) error

func (*RegistryFile) SetType

func (this *RegistryFile) SetType(mime string) error

func (*RegistryFile) Size

func (this *RegistryFile) Size() int

func (*RegistryFile) Truncate

func (this *RegistryFile) Truncate(size int) error

func (*RegistryFile) Type

func (this *RegistryFile) Type() string

func (*RegistryFile) Writer

func (this *RegistryFile) Writer() *RegistryFilePointer

func (*RegistryFile) WriterEdit

func (this *RegistryFile) WriterEdit() *RegistryFilePointer

type RegistryFilePointer

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

func (*RegistryFilePointer) Read

func (this *RegistryFilePointer) Read(data []byte) (int, error)

Reader interface

func (*RegistryFilePointer) Seek

func (this *RegistryFilePointer) Seek(offset int, whence int)

func (*RegistryFilePointer) Write

func (this *RegistryFilePointer) Write(data []byte) (int, error)

Writer interface

type RegistryNode

type RegistryNode struct {
	Path string
	// contains filtered or unexported fields
}

func NewRegistryNode

func NewRegistryNode(path string) *RegistryNode

func (*RegistryNode) Check

func (node *RegistryNode) Check() *RegistryNode

Check if the node exists If not, create it

func (*RegistryNode) Children

func (node *RegistryNode) Children() []*RegistryNode

Get all the children

func (*RegistryNode) ChildrenNames

func (node *RegistryNode) ChildrenNames() []string

Get all the children names

func (*RegistryNode) Create

func (node *RegistryNode) Create() *RegistryNode

func (*RegistryNode) DelValue

func (node *RegistryNode) DelValue(name string) error

func (*RegistryNode) Delete

func (node *RegistryNode) Delete(forReal bool) error

Delete a node

if forReal is true, we actually delete the node if forReal is false, we just mark it for future deletion (faster and allows risky tests)

func (*RegistryNode) Deleted

func (node *RegistryNode) Deleted() bool

Check if the node was marked for deletion

func (*RegistryNode) Existed

func (node *RegistryNode) Existed() bool

Check if the node exists or existed

func (*RegistryNode) Exists

func (node *RegistryNode) Exists() bool

Check if the node exists

func (*RegistryNode) GetChild

func (node *RegistryNode) GetChild(name string) *RegistryNode

Get a child

func (*RegistryNode) Name

func (node *RegistryNode) Name() string

func (*RegistryNode) Parent

func (node *RegistryNode) Parent() *RegistryNode

Get the parent node

func (*RegistryNode) SetValue

func (node *RegistryNode) SetValue(name, value string) error

func (*RegistryNode) SetValueInt64

func (node *RegistryNode) SetValueInt64(name string, value int64) error

func (*RegistryNode) SetValueTime

func (node *RegistryNode) SetValueTime(name string, time time.Time)

func (*RegistryNode) Status

func (node *RegistryNode) Status() int

func (*RegistryNode) String

func (node *RegistryNode) String() string

func (*RegistryNode) Value

func (node *RegistryNode) Value(name string) string

func (*RegistryNode) ValueInt64

func (node *RegistryNode) ValueInt64(name string) (int64, error)

func (*RegistryNode) ValueTime

func (node *RegistryNode) ValueTime(name string) (time.Time, error)

func (*RegistryNode) Values

func (node *RegistryNode) Values() map[string]string

type Session

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

type TSDataIterator

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

func NewTSDataIterator

func NewTSDataIterator(id string, dataType string, begin, end *time.Time, inverted bool) *TSDataIterator

func (*TSDataIterator) Close

func (this *TSDataIterator) Close()

func (*TSDataIterator) Scan

func (this *TSDataIterator) Scan(td *TimedData) bool

type TimedData

type TimedData struct {
	Id    string
	Type  string
	UTime gocql.UUID
	Data  string
}

func GetTSLast

func GetTSLast(id string, dataType string, begin, end *time.Time, inverted bool) *TimedData

func NewTimedDataFromTime

func NewTimedDataFromTime(id, dataType string, time time.Time, data string) *TimedData

func NewTimedDataFromUUID

func NewTimedDataFromUUID(id, dataType string, time gocql.UUID, data string) *TimedData

func (*TimedData) Time

func (this *TimedData) Time() time.Time

Directories

Path Synopsis
Entities handling
Entities handling

Jump to

Keyboard shortcuts

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