Documentation ¶
Index ¶
- Constants
- Variables
- func NewRouter(s *Server) *mux.Router
- func ParseTime(t string) (time.Time, error)
- type CheckUpgradeRequest
- type CheckUpgradeResponse
- type DBCache
- type Location
- type RequestSchema
- type ResponseConfig
- type Schema
- type Server
- func (s *Server) CheckUpgrade(rw http.ResponseWriter, req *http.Request)
- func (s *Server) GenerateCheckUpgradeResponse(request *CheckUpgradeRequest) (*CheckUpgradeResponse, error)
- func (s *Server) HealthCheck(rw http.ResponseWriter, req *http.Request)
- func (s *Server) ValidateExtraInfo(key string, value interface{}, extraInfoType string) bool
- type Version
Constants ¶
View Source
const ( VersionTagLatest = "latest" AppMinimalVersion = "v0.0.1" InfluxDBMeasurement = "upgrade_request" InfluxDBMeasurementDownSampling = "upgrade_request_down_sampling" InfluxDBMeasurementByAppVersion = "by_app_version_down_sampling" InfluxDBMeasurementByCountryCode = "by_country_code_down_sampling" InfluxDBContinuousQueryDownSampling = "cq_upgrade_request_down_sampling" InfluxDBContinuousQueryByAppVersion = "cq_by_app_version_down_sampling" InfluxDBContinuousQueryByCountryCode = "cq_by_country_code_down_sampling" )
Variables ¶
View Source
var ( InfluxDBPrecisionNanosecond = "ns" // ns is good for counting nodes InfluxDBDatabase = "upgrade_responder" InfluxDBContinuousQueryPeriod = "1h" InfluxDBTagAppVersion = "app_version" InfluxDBTagKubernetesVersion = "kubernetes_version" InfluxDBTagLocationCity = "city" InfluxDBTagLocationCountry = "country" InfluxDBTagLocationCountryISOCode = "country_isocode" HTTPHeaderXForwardedFor = "X-Forwarded-For" ValueFieldKey = "value" // A dummy InfluxDB field used to count the number of points ValueFieldValue = 1 )
Functions ¶
Types ¶
type CheckUpgradeRequest ¶
type CheckUpgradeResponse ¶
type DBCache ¶ added in v0.2.0
type DBCache struct { sync.RWMutex Database string Precision string SyncInterval time.Duration CacheSize int BatchPoints influxcli.BatchPoints InfluxClient influxcli.Client // contains filtered or unexported fields }
func NewDBCache ¶ added in v0.2.0
type RequestSchema ¶ added in v0.2.0
type ResponseConfig ¶
type ResponseConfig struct {
Versions []Version `json:"versions"`
}
type Server ¶
type Server struct { VersionMap map[string]*Version TagVersionsMap map[string][]*Version RequestSchema RequestSchema // contains filtered or unexported fields }
func (*Server) CheckUpgrade ¶
func (s *Server) CheckUpgrade(rw http.ResponseWriter, req *http.Request)
func (*Server) GenerateCheckUpgradeResponse ¶
func (s *Server) GenerateCheckUpgradeResponse(request *CheckUpgradeRequest) (*CheckUpgradeResponse, error)
func (*Server) HealthCheck ¶
func (s *Server) HealthCheck(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.