tgres: Index | Files

package serde

import ""

Package serde is the interface (and currently PostgreSQL implementaiton) for Serialization/Deserialization of data.


Package Files

dbds.go dbrra.go dbseries.go memory.go postgres.go postgres_common.go postgres_misc.go serde.go


var PgSegmentWidth int = 200

func InitDb Uses

func InitDb(connect_string, prefix string) (*pgvSerDe, error)

func NewMemSerDe Uses

func NewMemSerDe() *memSerDe

Returns a SerDe which keeps everything in memory.

type DataSourceSearcher Uses

type DataSourceSearcher interface {
    // Return a list od DS ids based on the query. How the query works
    // is up to the serde, it can even ignore the argumen, but the
    // general idea was a key: regex list where the underlying engine
    // would return all DSs whose ident tags named key match the
    // regex. Remember to Close() the SearchResult in the end.
    Search(query SearchQuery) (SearchResult, error)

type DbAddresser Uses

type DbAddresser interface {
    ListDbClientIps() ([]string, error) // Use the database to infer outside IPs of other connected clients
    MyDbAddr() (*string, error)

type DbDataSource Uses

type DbDataSource struct {
    // contains filtered or unexported fields

func NewDbDataSource Uses

func NewDbDataSource(id int64, ident Ident, seg, idx int64, ds rrd.DataSourcer) *DbDataSource

func (*DbDataSource) Copy Uses

func (ds *DbDataSource) Copy() rrd.DataSourcer

func (*DbDataSource) Created Uses

func (ds *DbDataSource) Created() bool

func (*DbDataSource) Id Uses

func (ds *DbDataSource) Id() int64

func (*DbDataSource) Ident Uses

func (ds *DbDataSource) Ident() Ident

func (*DbDataSource) Idx Uses

func (ds *DbDataSource) Idx() int64

func (*DbDataSource) Seg Uses

func (ds *DbDataSource) Seg() int64

type DbDataSourcer Uses

type DbDataSourcer interface {
    Ident() Ident
    Id() int64
    Seg() int64
    Idx() int64
    Created() bool

type DbRoundRobinArchive Uses

type DbRoundRobinArchive struct {
    // contains filtered or unexported fields

func (*DbRoundRobinArchive) BundleId Uses

func (rra *DbRoundRobinArchive) BundleId() int64

func (*DbRoundRobinArchive) Copy Uses

func (rra *DbRoundRobinArchive) Copy() rrd.RoundRobinArchiver

func (*DbRoundRobinArchive) Id Uses

func (rra *DbRoundRobinArchive) Id() int64

func (*DbRoundRobinArchive) Idx Uses

func (rra *DbRoundRobinArchive) Idx() int64

func (*DbRoundRobinArchive) Seg Uses

func (rra *DbRoundRobinArchive) Seg() int64

func (*DbRoundRobinArchive) SlotRow Uses

func (rra *DbRoundRobinArchive) SlotRow(slot int64) int64

SlotRow returns the row number given a slot number. This is mostly useful in serde implementations.

func (*DbRoundRobinArchive) Width Uses

func (rra *DbRoundRobinArchive) Width() int64

type DbRoundRobinArchiver Uses

type DbRoundRobinArchiver interface {
    Id() int64
    Width() int64
    SlotRow(slot int64) int64
    //DPsAsPGString(start, end int64) string
    //Pos() int64
    Seg() int64
    Idx() int64
    BundleId() int64

type DbSerDe Uses

type DbSerDe interface {
    DbAddresser() DbAddresser

type EventListener Uses

type EventListener interface {
    RegisterDeleteListener(func(Ident)) error

type Fetcher Uses

type Fetcher interface {
    // Fetch all the data sources (used to populate the cache on start)
    FetchDataSources() ([]rrd.DataSourcer, error)
    // Fetch or create a single DS. Passing a nil dsSpec disables creation.
    FetchOrCreateDataSource(ident Ident, dsSpec *rrd.DSSpec) (rrd.DataSourcer, error)
    // FetchSeries is responsible for presenting a DS as a
    // series.Series. This may include selecting the most suitable RRA
    // of the DS to satisfy span and resolution requested, as well as
    // setting up a database cursor which will be used to iterate over
    // the series.
    FetchSeries(ds rrd.DataSourcer, from, to time.Time, maxPoints int64) (series.Series, error)

type Flusher Uses

type Flusher interface {
    FlushDataPoints(bunlde_id, seg, i int64, dps, vers map[int64]interface{}) (int, error)
    FlushDSStates(seg int64, lastupdate, value, duration map[int64]interface{}) (int, error)
    FlushRRAStates(bundle_id, seg int64, latests, value, duration map[int64]interface{}) (int, error)

type Ident Uses

type Ident map[string]string

func (Ident) String Uses

func (it Ident) String() string

type SearchQuery Uses

type SearchQuery map[string]string

type SearchResult Uses

type SearchResult interface {
    Next() bool
    Close() error
    Ident() Ident

An iterator, similar to sql.Rows.

type SerDe Uses

type SerDe interface {
    Fetcher() Fetcher
    Flusher() Flusher
    EventListener() EventListener

Package serde imports 15 packages (graph) and is imported by 8 packages. Updated 2018-08-02. Refresh now. Tools for package owners.