Documentation ¶
Index ¶
- Constants
- func CacheDelete(key string)
- func CacheEnabled() bool
- func CacheGet(key string) (value interface{}, ok bool)
- func CacheInit(opt *Opt)
- func CachePut(key, value interface{})
- func GetBackendWorker() *work.Client
- func GetRedisPool() *redis.Pool
- func InitBackendWorker(redisPoolConfig *RedisPoolConfig)
- func InitHarborClient(hc *HarborClient)
- func StartCacheCleaner()
- type Exporter
- type HarborClient
- type HealthCollector
- type JobServiceCollector
- type Opt
- type ProjectCollector
- type RedisPoolConfig
- type StatisticsCollector
- type SystemInfoCollector
Constants ¶
const JobServiceCollectorName = "JobServiceCollector"
JobServiceCollectorName ...
const ProjectCollectorName = "ProjectCollector"
ProjectCollectorName ...
const StatisticsCollectorName = "StatisticsCollector"
Variables ¶
This section is empty.
Functions ¶
func InitBackendWorker ¶
func InitBackendWorker(redisPoolConfig *RedisPoolConfig)
InitBackendWorker initiate backend worker
func InitHarborClient ¶
func InitHarborClient(hc *HarborClient)
InitHarborClient initialize the harbor client
Types ¶
type Exporter ¶
Exporter is struct for Harbor which can used to connection Harbor and collecting data
func NewExporter ¶
NewExporter creates a exporter for Harbor with the configuration
func (*Exporter) Collect ¶
func (e *Exporter) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector
func (*Exporter) Describe ¶
func (e *Exporter) Describe(c chan<- *prometheus.Desc)
Describe implements prometheus.Collector
func (*Exporter) RegisterCollector ¶
RegisterCollector register a collector to expoter
type HarborClient ¶
HarborClient is client for request harbor
type HealthCollector ¶
type HealthCollector struct {
*HarborClient
}
HealthCollector is the Heartbeat
func NewHealthCollect ¶
func NewHealthCollect(cli *HarborClient) *HealthCollector
NewHealthCollect ...
func (*HealthCollector) Collect ¶
func (hc *HealthCollector) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector
func (*HealthCollector) Describe ¶
func (hc *HealthCollector) Describe(c chan<- *prometheus.Desc)
Describe implements prometheus.Collector
func (*HealthCollector) GetName ¶
func (hc *HealthCollector) GetName() string
GetName returns the name of the health collector
type JobServiceCollector ¶
type JobServiceCollector struct {
Namespace string
}
JobServiceCollector ...
func NewJobServiceCollector ¶
func NewJobServiceCollector() *JobServiceCollector
NewJobServiceCollector ...
func (*JobServiceCollector) Collect ¶
func (hc *JobServiceCollector) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector
func (*JobServiceCollector) Describe ¶
func (hc *JobServiceCollector) Describe(c chan<- *prometheus.Desc)
Describe implements prometheus.Collector
func (*JobServiceCollector) GetName ¶
func (hc *JobServiceCollector) GetName() string
GetName returns the name of the job service collector
type Opt ¶
type Opt struct { Port int MetricsPath string ExporterMetricsEnabled bool MaxRequests int TLSEnabled bool Certificate string Key string CacheDuration int64 CacheCleanInterval int64 }
Opt is the config of Harbor exporter
type ProjectCollector ¶
type ProjectCollector struct{}
ProjectCollector ...
func (*ProjectCollector) Collect ¶
func (hc *ProjectCollector) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector
func (*ProjectCollector) Describe ¶
func (hc *ProjectCollector) Describe(c chan<- *prometheus.Desc)
Describe implements prometheus.Collector
func (*ProjectCollector) GetName ¶
func (hc *ProjectCollector) GetName() string
GetName returns the name of the project info collector
type RedisPoolConfig ¶
RedisPoolConfig ...
type StatisticsCollector ¶
type StatisticsCollector struct {
// contains filtered or unexported fields
}
func NewStatisticsCollector ¶
func NewStatisticsCollector() *StatisticsCollector
func (StatisticsCollector) Collect ¶
func (g StatisticsCollector) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector
func (StatisticsCollector) Describe ¶
func (g StatisticsCollector) Describe(c chan<- *prometheus.Desc)
func (StatisticsCollector) GetName ¶
func (g StatisticsCollector) GetName() string
type SystemInfoCollector ¶
type SystemInfoCollector struct {
*HarborClient
}
SystemInfoCollector ...
func NewSystemInfoCollector ¶
func NewSystemInfoCollector(hbrCli *HarborClient) *SystemInfoCollector
NewSystemInfoCollector ...
func (*SystemInfoCollector) Collect ¶
func (hc *SystemInfoCollector) Collect(c chan<- prometheus.Metric)
Collect implements prometheus.Collector
func (*SystemInfoCollector) Describe ¶
func (hc *SystemInfoCollector) Describe(c chan<- *prometheus.Desc)
Describe implements prometheus.Collector
func (*SystemInfoCollector) GetName ¶
func (hc *SystemInfoCollector) GetName() string
GetName returns the name of the system info collector