Documentation ¶
Index ¶
- Constants
- type Avg
- type Claims
- type Count
- func (c *Count) AsVector() []interface{}
- func (c *Count) Avg(num float64) *Count
- func (c *Count) Decrypt(cipherText string, priv string) error
- func (c *Count) Encrypt(priv string) (string, error)
- func (c *Count) Inc(num float64) *Count
- func (c *Count) Max(num float64) *Count
- func (c *Count) Min(num float64) *Count
- func (c *Count) Per(taken float64, total float64) *Count
- func (c *Count) Time(duration time.Duration) func() time.Duration
- type Counts
- type DashKey
- type DashKeys
- type DashMember
- type DashMembers
- func (dm DashMembers) ApprovedOnly() DashMembers
- func (ds DashMembers) ByDashId() map[int]*DashMember
- func (ds DashMembers) ByUserId() map[int]*DashMember
- func (dm DashMembers) DashIds() []int
- func (ds DashMembers) HasDash(dashId int) *DashMember
- func (ds DashMembers) HasUser(userId int) *DashMember
- type DashStatRow
- type DashStatRows
- type Dashboard
- type Dashboards
- type Filter
- type Inc
- type Log
- type LogPackage
- type Logs
- type Max
- type Metrics
- type Min
- type Per
- type Serie
- type Series
- type Sock
- type SockMap
- func (sm *SockMap) Delete(userId int, uid string) bool
- func (sm *SockMap) Get(userId int, sockId string) *Sock
- func (sm *SockMap) Info() string
- func (sm *SockMap) PushLog(lg *Log) int
- func (sm *SockMap) Set(s *Sock)
- func (sm *SockMap) SetFilter(userId int, sockId string, filter *Filter) bool
- func (sm *SockMap) SetPaused(userId int, sockId string, state bool) bool
- type SockMessage
- type States
- type Time
- type User
- type Users
Constants ¶
View Source
const ( MemberStatusRejected = 0 MemberStatusApproved = 1 MemberStatusInvited = 2 MemberStatusRequested = 3 )
View Source
const ( DashboardSystemId = 1 DashboardDemoId = 2 )
View Source
const ( RoleAdmin = 1 RoleUser = 2 RoleViewer = 3 RoleDemo = 4 )
View Source
const ( ProviderGithub = 1 ProviderGoogle = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Avg ¶
type Claims ¶
type Claims struct { Id int `json:"id"` Role int `json:"role"` GihubId int64 `json:"github_id"` Username string `json:"username"` AccessToken string `json:"access_token,omitempty"` AccessTokenCipher string `json:"access_token_cipher"` jwt.StandardClaims }
func (*Claims) DecryptAccessToken ¶
func (*Claims) EncryptAccessToken ¶
type Count ¶
type Count struct { sync.RWMutex DashId int `db:"dash_id" json:"dash_id,omitempty"` Timestamp int64 `db:"timestamp" json:"timestamp"` Hostname string `db:"hostname" json:"hostname,omitempty"` Logname string `db:"logname" json:"logname,omitempty"` Keyname string `db:"keyname" json:"keyname"` Version string `db:"version" json:"version,omitempty"` Metrics `json:"metrics"` }
type DashMember ¶
type DashMembers ¶
type DashMembers []*DashMember
func (DashMembers) ApprovedOnly ¶
func (dm DashMembers) ApprovedOnly() DashMembers
func (DashMembers) ByDashId ¶
func (ds DashMembers) ByDashId() map[int]*DashMember
func (DashMembers) ByUserId ¶
func (ds DashMembers) ByUserId() map[int]*DashMember
func (DashMembers) DashIds ¶
func (dm DashMembers) DashIds() []int
func (DashMembers) HasDash ¶
func (ds DashMembers) HasDash(dashId int) *DashMember
func (DashMembers) HasUser ¶
func (ds DashMembers) HasUser(userId int) *DashMember
type DashStatRow ¶
type DashStatRow struct { DashId int `db:"dash_id" json:"dash_id,omitempty"` Hostname string `db:"hostname" json:"hostname,omitempty"` Logname string `db:"logname" json:"logname"` Level string `db:"level" json:"level,omitempty"` Version string `db:"version" json:"version,omitempty"` Cnt int `db:"cnt" json:"cnt"` Updated int64 `db:"updated" json:"updated,omitempty"` }
type DashStatRows ¶
type DashStatRows []*DashStatRow
type Dashboards ¶
type Dashboards []*Dashboard
func (Dashboards) ByPrimary ¶
func (ds Dashboards) ByPrimary() map[int]*Dashboard
func (Dashboards) Ids ¶
func (ds Dashboards) Ids() []int
type Filter ¶
type Filter struct { DashId int `json:"dash_id"` Hostname string `json:"hostname"` Logname string `json:"logname"` Level string `json:"level"` Pid int `json:"pid"` Version string `json:"version"` Message string `json:"message"` Timestamp [2]int64 `json:"timestamp"` Pattern string `json:"pattern"` Offset int64 `json:"offset"` Limit int `json:"limit"` Keyname string `json:"keyname"` }
type Log ¶
type Log struct { DashId int `db:"dash_id" json:"dash_id"` Timestamp int64 `db:"timestamp" json:"timestamp,string"` Hostname string `db:"hostname" json:"hostname"` Logname string `db:"logname" json:"logname"` Level string `db:"level" json:"level"` Message string `db:"message" json:"message"` Pid int `db:"pid" json:"pid"` Version string `db:"version" json:"version,omitempty"` Initiator string `db:"initiator" json:"initiator,omitempty"` }
type LogPackage ¶
type LogPackage struct { DashId int `json:"dash_id,omitempty"` PublicKey string `json:"public_key"` CipherLog string `json:"cipher_log,omitempty"` CipherCount string `json:"cipher_count,omitempty"` *Log `json:"log,omitempty"` *Count `json:"count,omitempty"` }
func (*LogPackage) DecryptCount ¶
func (lp *LogPackage) DecryptCount(priv string) error
func (*LogPackage) DecryptLog ¶
func (lp *LogPackage) DecryptLog(priv string) error
type Per ¶
type Sock ¶
type Sock struct { sync.RWMutex SockId string `json:"sock_id"` Listeners map[string]int `json:"listeners"` Paused bool `json:"paused"` *User `json:"user"` *Filter `json:"filter"` *Claims `json:"claims"` *websocket.Conn `json:"conn"` }
func (*Sock) AddListener ¶
func (*Sock) RemoveListener ¶
type SockMessage ¶
Click to show internal directories.
Click to hide internal directories.