Documentation ¶
Index ¶
- func OpenDB(config DBConfig) (*sql.DB, error)
- type CreateConnectorFunc
- type DBConfig
- type DBTX
- type Driver
- type GetMonitorPriorityRow
- type GetScorerLogScoresParams
- type GetScorerRecentScoresParams
- type GetScorerStatusRow
- type GetScorersRow
- type GetServerScoreParams
- type GetServersParams
- type InsertLogScoreParams
- type InsertScorerParams
- type InsertScorerStatusParams
- type InsertServerScoreParams
- type LogScore
- type LogScoreAttributes
- type Monitor
- type MonitorConfig
- type MonitorsIpVersion
- type MonitorsStatus
- type MonitorsType
- type NullMonitorsIpVersion
- type NullMonitorsStatus
- type NullMonitorsType
- type NullServerScoresStatus
- type NullServersIpVersion
- type Queries
- func (q *Queries) GetMinLogScoreID(ctx context.Context) (uint64, error)
- func (q *Queries) GetMonitorPriority(ctx context.Context, serverID uint32) ([]GetMonitorPriorityRow, error)
- func (q *Queries) GetMonitorTLSName(ctx context.Context, tlsName sql.NullString) (Monitor, error)
- func (q *Queries) GetScorerLogScores(ctx context.Context, arg GetScorerLogScoresParams) ([]LogScore, error)
- func (q *Queries) GetScorerNextLogScoreID(ctx context.Context, logScoreID uint64) (uint64, error)
- func (q *Queries) GetScorerRecentScores(ctx context.Context, arg GetScorerRecentScoresParams) ([]LogScore, error)
- func (q *Queries) GetScorerStatus(ctx context.Context) ([]GetScorerStatusRow, error)
- func (q *Queries) GetScorers(ctx context.Context) ([]GetScorersRow, error)
- func (q *Queries) GetServer(ctx context.Context, id uint32) (Server, error)
- func (q *Queries) GetServerIP(ctx context.Context, ip string) (Server, error)
- func (q *Queries) GetServerScore(ctx context.Context, arg GetServerScoreParams) (ServerScore, error)
- func (q *Queries) GetServers(ctx context.Context, arg GetServersParams) ([]Server, error)
- func (q *Queries) GetServersMonitorReview(ctx context.Context) ([]uint32, error)
- func (q *Queries) GetSystemMonitor(ctx context.Context, name string, ipVersion NullMonitorsIpVersion) (*SystemMonitor, error)
- func (q *Queries) GetSystemSetting(ctx context.Context, key string) (string, error)
- func (q *Queries) InsertLogScore(ctx context.Context, arg InsertLogScoreParams) (sql.Result, error)
- func (q *Queries) InsertScorer(ctx context.Context, arg InsertScorerParams) (sql.Result, error)
- func (q *Queries) InsertScorerStatus(ctx context.Context, arg InsertScorerStatusParams) error
- func (q *Queries) InsertServerScore(ctx context.Context, arg InsertServerScoreParams) error
- func (q *Queries) ListMonitors(ctx context.Context) ([]Monitor, error)
- func (q *Queries) UpdateMonitorSeen(ctx context.Context, arg UpdateMonitorSeenParams) error
- func (q *Queries) UpdateMonitorSubmit(ctx context.Context, arg UpdateMonitorSubmitParams) error
- func (q *Queries) UpdateMonitorVersion(ctx context.Context, arg UpdateMonitorVersionParams) error
- func (q *Queries) UpdateScorerStatus(ctx context.Context, arg UpdateScorerStatusParams) error
- func (q *Queries) UpdateServer(ctx context.Context, arg UpdateServerParams) error
- func (q *Queries) UpdateServerScore(ctx context.Context, arg UpdateServerScoreParams) error
- func (q *Queries) UpdateServerScoreStatus(ctx context.Context, arg UpdateServerScoreStatusParams) error
- func (q *Queries) UpdateServerScoreStratum(ctx context.Context, arg UpdateServerScoreStratumParams) error
- func (q *Queries) UpdateServerStratum(ctx context.Context, arg UpdateServerStratumParams) error
- func (q *Queries) UpdateServersMonitorReview(ctx context.Context, arg UpdateServersMonitorReviewParams) error
- func (q *Queries) UpdateServersMonitorReviewChanged(ctx context.Context, arg UpdateServersMonitorReviewChangedParams) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Server
- type ServerScore
- type ServerScoresStatus
- type ServersIpVersion
- type SystemMonitor
- type UpdateMonitorSeenParams
- type UpdateMonitorSubmitParams
- type UpdateMonitorVersionParams
- type UpdateScorerStatusParams
- type UpdateServerParams
- type UpdateServerScoreParams
- type UpdateServerScoreStatusParams
- type UpdateServerScoreStratumParams
- type UpdateServerStratumParams
- type UpdateServersMonitorReviewChangedParams
- type UpdateServersMonitorReviewParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateConnectorFunc ¶
type Driver ¶
type Driver struct {
CreateConnectorFunc CreateConnectorFunc
}
type GetMonitorPriorityRow ¶
type GetMonitorPriorityRow struct { ID uint32 `json:"id"` TlsName sql.NullString `json:"tls_name"` AvgRtt interface{} `json:"avg_rtt"` MonitorPriority float64 `json:"monitor_priority"` AvgStep interface{} `json:"avg_step"` Healthy interface{} `json:"healthy"` MonitorStatus MonitorsStatus `json:"monitor_status"` Status NullServerScoresStatus `json:"status"` Count int64 `json:"count"` }
type GetScorerRecentScoresParams ¶
type GetScorerRecentScoresParams struct { ServerID uint32 `json:"server_id"` MonitorStatus ServerScoresStatus `json:"monitor_status"` MonitorStatus2 ServerScoresStatus `json:"monitor_status_2"` Ts time.Time `json:"ts"` TimeLookback interface{} `json:"time_lookback"` }
type GetScorerStatusRow ¶
type GetScorersRow ¶
type GetScorersRow struct { ID uint32 `json:"id"` StatusID uint32 `json:"status_id"` Status MonitorsStatus `json:"status"` LogScoreID uint64 `json:"log_score_id"` Name string `json:"name"` }
type GetServerScoreParams ¶
type GetServersParams ¶
type GetServersParams struct { MonitorID uint32 `json:"monitor_id"` IpVersion ServersIpVersion `json:"ip_version"` IntervalSeconds interface{} `json:"interval_seconds"` IntervalSecondsTesting interface{} `json:"interval_seconds_testing"` IntervalSecondsAll interface{} `json:"interval_seconds_all"` Limit int32 `json:"limit"` Offset int32 `json:"offset"` }
type InsertLogScoreParams ¶
type InsertLogScoreParams struct { ServerID uint32 `json:"server_id"` MonitorID sql.NullInt32 `json:"monitor_id"` Ts time.Time `json:"ts"` Score float64 `json:"score"` Step float64 `json:"step"` Offset sql.NullFloat64 `json:"offset"` Rtt sql.NullInt32 `json:"rtt"` Attributes sql.NullString `json:"attributes"` }
type InsertScorerParams ¶
type InsertScorerParams struct { Name string `json:"name"` TlsName sql.NullString `json:"tls_name"` }
type InsertServerScoreParams ¶
type LogScore ¶
type LogScore struct { ID uint64 `json:"id"` MonitorID sql.NullInt32 `json:"monitor_id"` ServerID uint32 `json:"server_id"` Ts time.Time `json:"ts"` Score float64 `json:"score"` Step float64 `json:"step"` Offset sql.NullFloat64 `json:"offset"` Rtt sql.NullInt32 `json:"rtt"` Attributes sql.NullString `json:"attributes"` }
func (*LogScore) AbsoluteOffset ¶
type LogScoreAttributes ¶
type LogScoreAttributes struct { Leap int8 `json:"leap,omitempty"` Stratum int8 `json:"stratum,omitempty"` NoResponse bool `json:"no_response,omitempty"` Error string `json:"error,omitempty"` Warning string `json:"warning,omitempty"` FromLSID int `json:"from_ls_id,omitempty"` FromSSID int `json:"from_ss_id,omitempty"` }
type Monitor ¶
type Monitor struct { ID uint32 `json:"id"` Type MonitorsType `json:"type"` UserID sql.NullInt32 `json:"user_id"` AccountID sql.NullInt32 `json:"account_id"` Name string `json:"name"` Location string `json:"location"` Ip sql.NullString `json:"ip"` IpVersion NullMonitorsIpVersion `json:"ip_version"` TlsName sql.NullString `json:"tls_name"` ApiKey sql.NullString `json:"api_key"` Status MonitorsStatus `json:"status"` Config string `json:"config"` ClientVersion string `json:"client_version"` LastSeen sql.NullTime `json:"last_seen"` LastSubmit sql.NullTime `json:"last_submit"` CreatedOn time.Time `json:"created_on"` }
func (*Monitor) GetConfig ¶
func (m *Monitor) GetConfig() (*MonitorConfig, error)
func (*Monitor) GetConfigWithDefaults ¶
func (m *Monitor) GetConfigWithDefaults(defaults []byte) (*MonitorConfig, error)
type MonitorConfig ¶
type MonitorConfig struct { Samples int32 `json:"samples"` NatIP string `json:"nat_ip,omitempty"` // have the monitor bind to a different IP BaseChecks []string `json:"base_checks,omitempty"` MQTT *pb.MQTTConfig // contains filtered or unexported fields }
type MonitorsIpVersion ¶
type MonitorsIpVersion string
const ( MonitorsIpVersionV4 MonitorsIpVersion = "v4" MonitorsIpVersionV6 MonitorsIpVersion = "v6" )
func (*MonitorsIpVersion) Scan ¶
func (e *MonitorsIpVersion) Scan(src interface{}) error
func (MonitorsIpVersion) String ¶
func (mipv MonitorsIpVersion) String() string
type MonitorsStatus ¶
type MonitorsStatus string
const ( MonitorsStatusPending MonitorsStatus = "pending" MonitorsStatusTesting MonitorsStatus = "testing" MonitorsStatusActive MonitorsStatus = "active" MonitorsStatusPaused MonitorsStatus = "paused" MonitorsStatusDeleted MonitorsStatus = "deleted" )
func (*MonitorsStatus) Scan ¶
func (e *MonitorsStatus) Scan(src interface{}) error
type MonitorsType ¶
type MonitorsType string
const ( MonitorsTypeMonitor MonitorsType = "monitor" MonitorsTypeScore MonitorsType = "score" )
func (*MonitorsType) Scan ¶
func (e *MonitorsType) Scan(src interface{}) error
type NullMonitorsIpVersion ¶
type NullMonitorsIpVersion struct { MonitorsIpVersion MonitorsIpVersion `json:"monitors_ip_version"` Valid bool `json:"valid"` // Valid is true if MonitorsIpVersion is not NULL }
func (*NullMonitorsIpVersion) Scan ¶
func (ns *NullMonitorsIpVersion) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullMonitorsStatus ¶
type NullMonitorsStatus struct { MonitorsStatus MonitorsStatus `json:"monitors_status"` Valid bool `json:"valid"` // Valid is true if MonitorsStatus is not NULL }
func (*NullMonitorsStatus) Scan ¶
func (ns *NullMonitorsStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullMonitorsType ¶
type NullMonitorsType struct { MonitorsType MonitorsType `json:"monitors_type"` Valid bool `json:"valid"` // Valid is true if MonitorsType is not NULL }
func (*NullMonitorsType) Scan ¶
func (ns *NullMonitorsType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullServerScoresStatus ¶
type NullServerScoresStatus struct { ServerScoresStatus ServerScoresStatus `json:"server_scores_status"` Valid bool `json:"valid"` // Valid is true if ServerScoresStatus is not NULL }
func (*NullServerScoresStatus) Scan ¶
func (ns *NullServerScoresStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullServersIpVersion ¶
type NullServersIpVersion struct { ServersIpVersion ServersIpVersion `json:"servers_ip_version"` Valid bool `json:"valid"` // Valid is true if ServersIpVersion is not NULL }
func (*NullServersIpVersion) Scan ¶
func (ns *NullServersIpVersion) Scan(value interface{}) error
Scan implements the Scanner interface.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) GetMinLogScoreID ¶
func (*Queries) GetMonitorPriority ¶
func (*Queries) GetMonitorTLSName ¶
func (*Queries) GetScorerLogScores ¶
func (*Queries) GetScorerNextLogScoreID ¶
this is very slow when there's a backlog, so only run it when there are no results to make sure we don't get stuck behind a bunch of scoring ids. https://github.com/kyleconroy/sqlc/issues/1965
func (*Queries) GetScorerRecentScores ¶
func (*Queries) GetScorerStatus ¶
func (q *Queries) GetScorerStatus(ctx context.Context) ([]GetScorerStatusRow, error)
func (*Queries) GetScorers ¶
func (q *Queries) GetScorers(ctx context.Context) ([]GetScorersRow, error)
func (*Queries) GetServerIP ¶
func (*Queries) GetServerScore ¶
func (q *Queries) GetServerScore(ctx context.Context, arg GetServerScoreParams) (ServerScore, error)
func (*Queries) GetServers ¶
func (*Queries) GetServersMonitorReview ¶
func (*Queries) GetSystemMonitor ¶
func (q *Queries) GetSystemMonitor(ctx context.Context, name string, ipVersion NullMonitorsIpVersion) (*SystemMonitor, error)
func (*Queries) GetSystemSetting ¶
func (*Queries) InsertLogScore ¶
func (*Queries) InsertScorer ¶
func (*Queries) InsertScorerStatus ¶
func (q *Queries) InsertScorerStatus(ctx context.Context, arg InsertScorerStatusParams) error
func (*Queries) InsertServerScore ¶
func (q *Queries) InsertServerScore(ctx context.Context, arg InsertServerScoreParams) error
func (*Queries) ListMonitors ¶
func (*Queries) UpdateMonitorSeen ¶
func (q *Queries) UpdateMonitorSeen(ctx context.Context, arg UpdateMonitorSeenParams) error
func (*Queries) UpdateMonitorSubmit ¶
func (q *Queries) UpdateMonitorSubmit(ctx context.Context, arg UpdateMonitorSubmitParams) error
func (*Queries) UpdateMonitorVersion ¶
func (q *Queries) UpdateMonitorVersion(ctx context.Context, arg UpdateMonitorVersionParams) error
func (*Queries) UpdateScorerStatus ¶
func (q *Queries) UpdateScorerStatus(ctx context.Context, arg UpdateScorerStatusParams) error
func (*Queries) UpdateServer ¶
func (q *Queries) UpdateServer(ctx context.Context, arg UpdateServerParams) error
func (*Queries) UpdateServerScore ¶
func (q *Queries) UpdateServerScore(ctx context.Context, arg UpdateServerScoreParams) error
func (*Queries) UpdateServerScoreStatus ¶
func (q *Queries) UpdateServerScoreStatus(ctx context.Context, arg UpdateServerScoreStatusParams) error
func (*Queries) UpdateServerScoreStratum ¶
func (q *Queries) UpdateServerScoreStratum(ctx context.Context, arg UpdateServerScoreStratumParams) error
func (*Queries) UpdateServerStratum ¶
func (q *Queries) UpdateServerStratum(ctx context.Context, arg UpdateServerStratumParams) error
func (*Queries) UpdateServersMonitorReview ¶
func (q *Queries) UpdateServersMonitorReview(ctx context.Context, arg UpdateServersMonitorReviewParams) error
func (*Queries) UpdateServersMonitorReviewChanged ¶
func (q *Queries) UpdateServersMonitorReviewChanged(ctx context.Context, arg UpdateServersMonitorReviewChangedParams) error
type Server ¶
type Server struct { ID uint32 `json:"id"` Ip string `json:"ip"` IpVersion ServersIpVersion `json:"ip_version"` UserID uint32 `json:"user_id"` AccountID sql.NullInt32 `json:"account_id"` Hostname sql.NullString `json:"hostname"` Stratum sql.NullInt32 `json:"stratum"` InPool uint32 `json:"in_pool"` InServerList uint32 `json:"in_server_list"` Netspeed uint32 `json:"netspeed"` NetspeedTarget uint32 `json:"netspeed_target"` CreatedOn time.Time `json:"created_on"` UpdatedOn time.Time `json:"updated_on"` ScoreTs sql.NullTime `json:"score_ts"` ScoreRaw float64 `json:"score_raw"` DeletionOn sql.NullTime `json:"deletion_on"` Flags string `json:"flags"` }
type ServerScore ¶
type ServerScore struct { ID uint64 `json:"id"` MonitorID uint32 `json:"monitor_id"` ServerID uint32 `json:"server_id"` ScoreTs sql.NullTime `json:"score_ts"` ScoreRaw float64 `json:"score_raw"` Stratum sql.NullInt32 `json:"stratum"` Status ServerScoresStatus `json:"status"` CreatedOn time.Time `json:"created_on"` ModifiedOn time.Time `json:"modified_on"` }
type ServerScoresStatus ¶
type ServerScoresStatus string
const ( ServerScoresStatusNew ServerScoresStatus = "new" ServerScoresStatusTesting ServerScoresStatus = "testing" ServerScoresStatusActive ServerScoresStatus = "active" )
func (*ServerScoresStatus) Scan ¶
func (e *ServerScoresStatus) Scan(src interface{}) error
type ServersIpVersion ¶
type ServersIpVersion string
const ( ServersIpVersionV4 ServersIpVersion = "v4" ServersIpVersionV6 ServersIpVersion = "v6" )
func (*ServersIpVersion) Scan ¶
func (e *ServersIpVersion) Scan(src interface{}) error
type SystemMonitor ¶
type SystemMonitor struct {
Monitor
}
type UpdateMonitorSeenParams ¶
type UpdateServerParams ¶
type UpdateServerScoreParams ¶
type UpdateServerScoreStatusParams ¶
type UpdateServerScoreStatusParams struct { Status ServerScoresStatus `json:"status"` MonitorID uint32 `json:"monitor_id"` ServerID uint32 `json:"server_id"` }
Click to show internal directories.
Click to hide internal directories.