Documentation ¶
Index ¶
- Variables
- func CloseDB() error
- func CloseIndexClient() error
- func DecodeHashId(hash string) int
- func FetchCachedChannelIndexStatsById(id int) (*elastic.IndicesStatsResponse, bool)
- func GlobalIndexName(ch *Channel) string
- func InitializeDB() error
- func InitializeIndexClient() error
- func TimedIndexName(ch *Channel, ts time.Time) string
- func TimedIndices(ch *Channel, tStart, tEnd time.Time) string
- type AuthToken
- type Channel
- func (c *Channel) BeforeCreate() error
- func (c *Channel) BeforeUpdate() error
- func (c *Channel) Create() error
- func (c *Channel) Delete() error
- func (c *Channel) DeleteIndices() error
- func (c *Channel) FindById(id int) bool
- func (c *Channel) HashId() (string, error)
- func (c *Channel) IndexStats() (*elastic.IndicesStatsResponse, error)
- func (c *Channel) Indices() []string
- func (c *Channel) Update() error
- type ConnectionHistory
- type ConnectionStatus
- type Dashboard
- type Point
- type RawQuery
- type SeriesQuery
- type StatsQuery
- type StringMap
- type StringSlice
- type ValueQuery
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthTokenExpiredErr = errors.New("auth token expired.")
View Source
var CheckSumInvalidErr = errors.New("invalid checksum.")
View Source
var DB *gorm.DB
View Source
var HashLen = 16
View Source
var HistoryLength = 100
View Source
var IndexClient *Client
View Source
var IndexTypeActivities = "activities"
View Source
var IndexTypeMessages = "messages"
View Source
var InternalTags = []string{"_ip"}
View Source
var KeepAlive = "5m"
View Source
var Salt = "Cc4D5xBlbCBqYTuimuNPGsio7YoMo8d8"
View Source
var ScrollSize = 2000
View Source
var SeriesAggName = "series_agg"
View Source
var SupportedDataTypes = []string{"float", "int", "boolean", "string"}
View Source
var SupportedOperators = []string{"eq", "ne", "lt", "gt", "le", "ge"}
View Source
var SupportedSummaryTypes = []string{"avg", "min", "max", "sum", "last"}
View Source
var ValueAggName = "value_agg"
Functions ¶
func CloseIndexClient ¶
func CloseIndexClient() error
func DecodeHashId ¶
func GlobalIndexName ¶
func InitializeDB ¶
func InitializeDB() error
func InitializeIndexClient ¶
func InitializeIndexClient() error
Types ¶
type AuthToken ¶
type AuthToken struct { Username string `json:"username"` TokenString string `json:"token_string"` CreatedAt time.Time `json:"created_at"` ExpiresAt time.Time `json:"expires_at"` }
func DecryptAuthToken ¶
func NewAuthToken ¶
type Channel ¶
type Channel struct { Id int `sql:"type:integer primary key autoincrement" json:"-"` Name string `sql:"type:varchar(255);unique_index" json:"name"` Description string `sql:"type:text" json:"description"` Tags StringSlice `sql:"type:text" json:"tags"` Fields StringMap `sql:"type:text" json:"fields"` MessageHandlers StringSlice `sql:"type:text" json:"-"` AccessTokens StringSlice `sql:"type:text" json:"access_tokens"` }
func FetchCachedChannelById ¶
func (*Channel) BeforeCreate ¶
func (*Channel) BeforeUpdate ¶
func (*Channel) DeleteIndices ¶
func (*Channel) IndexStats ¶
type ConnectionHistory ¶
type ConnectionStatus ¶
type ConnectionStatus struct { ChannelName string `json:"channel"` Status string `json:"status"` ConnectedAt *time.Time `json:"connected_at,omitempty"` LastPingedAt *time.Time `json:"last_pinged_at,omitempty"` Identifier string `json:"identifier"` Metadata map[string]interface{} `json:"metadata,omitempty"` Histories []*ConnectionHistory `json:"histories,omitempty"` }
func FindConnectionStatus ¶
func FindConnectionStatus(ch *Channel, devId string, withHistory bool) *ConnectionStatus
type Dashboard ¶
type Dashboard struct { Id int `sql:"type:integer" json:"id"` Name string `sql:"type:varchar(255)" json:"name"` Description string `sql:"type:text" json:"description"` Definition string `sql:"type:text" json:"definition"` }
func (*Dashboard) BeforeSave ¶
type Point ¶
type Point struct { Id string Timestamp time.Time Tags map[string]string Fields map[string]interface{} // contains filtered or unexported fields }
func (*Point) MarshalJSON ¶
extra information about a point is mixed in here
type RawQuery ¶
type SeriesQuery ¶
type SeriesQuery struct { Channel *Channel Field string Tags map[string]string SummaryType string TimeStart time.Time TimeEnd time.Time TimeInterval string }
func (*SeriesQuery) QueryES ¶
func (q *SeriesQuery) QueryES() (interface{}, error)
type StatsQuery ¶
func (*StatsQuery) QueryES ¶
func (q *StatsQuery) QueryES() (interface{}, error)
type StringSlice ¶
type StringSlice []string
func (*StringSlice) Scan ¶
func (s *StringSlice) Scan(src interface{}) error
Click to show internal directories.
Click to hide internal directories.