Documentation ¶
Index ¶
- Constants
- type Job
- func (j *Job) CountServiceJobs(serviceID, status string) (int, error)
- func (j *Job) CreateRecord(record JobRecord) error
- func (j *Job) DeleteRecord(serviceID, jobID string) (bool, error)
- func (j *Job) GetRecord(serviceID, jobID string) (*JobRecord, error)
- func (j *Job) GetServiceJobs(serviceID string) ([]*JobRecord, error)
- func (j *Job) UpdateRecord(record JobRecord) error
- type JobRecord
- type Metric
- type Option
- type OptionData
- type Service
- type ServiceRecord
Constants ¶
const ( // PendingStatus constant PendingStatus = "@pending" // FailedStatus constant FailedStatus = "@failed" // SuccessStatus constant SuccessStatus = "@success" // DeployJob constant DeployJob = "@deployService" // DestroyJob constant DestroyJob = "@destroyService" )
const ( // COUNTER is a Prometheus COUNTER metric COUNTER string = "counter" // GAUGE is a Prometheus GAUGE metric GAUGE string = "gauge" // HISTOGRAM is a Prometheus HISTOGRAM metric HISTOGRAM string = "histogram" // SUMMARY is a Prometheus SUMMARY metric SUMMARY string = "summary" )
const (
// RedisService constant
RedisService = "REDIS_SERVICE"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job type
func (*Job) CountServiceJobs ¶ added in v0.1.1
CountServiceJobs counts service jobs
func (*Job) CreateRecord ¶
CreateRecord stores a job record
func (*Job) DeleteRecord ¶
DeleteRecord deletes a job record
func (*Job) GetServiceJobs ¶ added in v0.1.1
GetServiceJobs get jobs for a service
func (*Job) UpdateRecord ¶
UpdateRecord updates a job record
type JobRecord ¶
type JobRecord struct { ID string `json:"id"` Action string `json:"action"` Service ServiceRecord `json:"service"` Status string `json:"status"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
JobRecord type
type Metric ¶ added in v0.1.1
type Metric struct { Type string `json:"type"` Name string `json:"name"` Help string `json:"help"` Method string `json:"method"` Value string `json:"value"` Labels prometheus.Labels `json:"labels"` Buckets []float64 `json:"buckets"` }
Metric struct
func (*Metric) ConvertToJSON ¶ added in v0.1.1
ConvertToJSON convert object to json
func (*Metric) GetValueAsFloat ¶ added in v0.1.1
GetValueAsFloat gets a list of label values
func (*Metric) LabelValues ¶ added in v0.1.1
LabelValues gets a list of label values
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option type
func NewOptionStore ¶
NewOptionStore creates a new instance
func (*Option) CreateOption ¶
func (o *Option) CreateOption(option OptionData) error
CreateOption stores an option
func (*Option) DeleteOptionByKey ¶
DeleteOptionByKey deletes an option by a key
func (*Option) GetOptionByKey ¶
func (o *Option) GetOptionByKey(key string) (*OptionData, error)
GetOptionByKey gets an option by a key
func (*Option) UpdateOptionByKey ¶
func (o *Option) UpdateOptionByKey(option OptionData) error
UpdateOptionByKey updates an option by key
func (*Option) UpdateOptions ¶
func (o *Option) UpdateOptions(options []OptionData) error
UpdateOptions update options
type OptionData ¶
type OptionData struct { Key string `json:"key"` Value string `json:"value"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
OptionData struct
type Service ¶ added in v0.1.1
type Service struct {
// contains filtered or unexported fields
}
Service type
func NewServiceStore ¶ added in v0.1.1
NewServiceStore creates a new instance
func (*Service) CreateRecord ¶ added in v0.1.1
func (s *Service) CreateRecord(record ServiceRecord) error
CreateRecord stores a service record
func (*Service) DeleteRecord ¶ added in v0.1.1
DeleteRecord deletes a service record
func (*Service) GetRecord ¶ added in v0.1.1
func (s *Service) GetRecord(serviceID string) (*ServiceRecord, error)
GetRecord gets service record data
func (*Service) UpdateRecord ¶ added in v0.1.1
func (s *Service) UpdateRecord(record ServiceRecord) error
UpdateRecord updates a service record
type ServiceRecord ¶ added in v0.1.1
type ServiceRecord struct { ID string `json:"id"` Template string `json:"template"` Configs map[string]string `json:"configs"` DeleteAfter string `json:"deleteAfter"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
ServiceRecord type
func (*ServiceRecord) GetConfig ¶ added in v0.1.6
func (s *ServiceRecord) GetConfig(key, def string) string
GetConfig get a config value