db

package
v0.0.0-...-950c9eb Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	GetWidget(id string) (Widget, error)
	GetWidgets(expireTime uint64, from int, qty int) ([]Widget, error)
	NewWidget(apiHeader string, apiKey string, apiPath string, cacheElapse uint32) (Widget, error)
	UpdateWidget(wObj Widget) (bool, error)
	UpdateNextCheckWidget(wObj Widget) (bool, error)
	DeleteWidget(wObj Widget) (bool, error)
	DeleteWidgetByKey(id string) (bool, error)
	ExpiredWidgetCount(expireTime uint64) (int64, error)
	MinimumWidgetElapseMinutes() (int64, error)
}

func GetDataSource

func GetDataSource(dbType DbType, config map[string]string) DataSource

type DatabaseSource

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

func (DatabaseSource) DeleteWidget

func (this DatabaseSource) DeleteWidget(wObj Widget) (bool, error)

func (DatabaseSource) DeleteWidgetByKey

func (this DatabaseSource) DeleteWidgetByKey(id string) (bool, error)

func (DatabaseSource) ExpiredWidgetCount

func (this DatabaseSource) ExpiredWidgetCount(expireTime uint64) (int64, error)

func (DatabaseSource) GetWidget

func (this DatabaseSource) GetWidget(id string) (Widget, error)

func (DatabaseSource) GetWidgets

func (this DatabaseSource) GetWidgets(expireTime uint64, from int, qty int) ([]Widget, error)

func (DatabaseSource) MinimumWidgetElapseMinutes

func (this DatabaseSource) MinimumWidgetElapseMinutes() (int64, error)

func (DatabaseSource) NewWidget

func (this DatabaseSource) NewWidget(apiHeader string, apiKey string, apiPath string, cacheElapse uint32) (Widget, error)

func (DatabaseSource) UpdateNextCheckWidget

func (this DatabaseSource) UpdateNextCheckWidget(wObj Widget) (bool, error)

func (DatabaseSource) UpdateWidget

func (this DatabaseSource) UpdateWidget(wObj Widget) (bool, error)

type DbType

type DbType int
const (
	Local DbType = iota
	MySQL
)

type Widget

type Widget struct {
	WidgetID    string // `db:"widget_id,size:255"`
	ApiHeader   string
	ApiKey      string // `db:"api_key,size:255"`
	ApiPath     string // `db:"api_path,size:1024"`
	Created     uint64 // `db:"created_at"`
	CacheElapse uint32 // `db:"cache_elapse"`
	NextCheck   uint64 // `db:"next_cache_check"`
}

func (Widget) String

func (this Widget) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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