Documentation ¶
Index ¶
- Constants
- type Job
- type JobRecord
- type Metric
- type Option
- type OptionData
- type Service
- func (s *Service) CreateRecord(record ServiceRecord) error
- func (s *Service) DeleteRecord(serviceID string) (bool, error)
- func (s *Service) GetRecord(serviceID string) (ServiceRecord, error)
- func (s *Service) GetRecords() ([]ServiceRecord, error)
- func (s *Service) UpdateRecord(record ServiceRecord) error
- 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" )
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) CreateRecord ¶
CreateRecord stores a job record
func (*Job) DeleteRecord ¶
DeleteRecord deletes a job record
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) GetRecords ¶ added in v0.1.11
func (s *Service) GetRecords() ([]ServiceRecord, error)
GetRecords get services
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"` Service string `json:"service"` Version string `json:"version"` Configs map[string]string `json:"configs"` DeleteAfter string `json:"deleteAfter"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` }
ServiceRecord type