model

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 10 Imported by: 0

README

Data Model

Documentation

Index

Constants

View Source
const (
	// PendingStatus constant
	PendingStatus = "PENDING"

	// FailedStatus constant
	FailedStatus = "FAILED"

	// SuccessStatus constant
	SuccessStatus = "SUCCESS"

	// DeployJob constant
	DeployJob = "@deployService"

	// DestroyJob constant
	DestroyJob = "@destroyService"
)
View Source
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 NewJobStore

func NewJobStore(db driver.Database) *Job

NewJobStore creates a new instance

func (*Job) CreateRecord

func (j *Job) CreateRecord(record JobRecord) error

CreateRecord stores a job record

func (*Job) DeleteRecord

func (j *Job) DeleteRecord(serviceID, jobID string) (bool, error)

DeleteRecord deletes a job record

func (*Job) GetRecord

func (j *Job) GetRecord(serviceID, jobID string) (JobRecord, error)

GetRecord gets job record data

func (*Job) UpdateRecord

func (j *Job) UpdateRecord(record JobRecord) error

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

func (m *Metric) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Metric) GetValueAsFloat added in v0.1.1

func (m *Metric) GetValueAsFloat() (float64, error)

GetValueAsFloat gets a list of label values

func (*Metric) LabelKeys added in v0.1.1

func (m *Metric) LabelKeys() []string

LabelKeys gets a list of label keys

func (*Metric) LabelValues added in v0.1.1

func (m *Metric) LabelValues() []string

LabelValues gets a list of label values

func (*Metric) LoadFromJSON added in v0.1.1

func (m *Metric) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option type

func NewOptionStore

func NewOptionStore(db driver.Database) *Option

NewOptionStore creates a new instance

func (*Option) CreateOption

func (o *Option) CreateOption(option OptionData) error

CreateOption stores an option

func (*Option) DeleteOptionByKey

func (o *Option) DeleteOptionByKey(key string) (bool, error)

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

func NewServiceStore(db driver.Database) *Service

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

func (s *Service) DeleteRecord(serviceID string) (bool, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL