model

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

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

View Source
var (
	// JobPending pending job type
	JobPending = "pending"

	// JobFailed failed job type
	JobFailed = "failed"

	// JobSuccess success job type
	JobSuccess = "success"

	// JobOnHold on hold job type
	JobOnHold = "on_hold"

	// JobDeploymentUpdate deployment update
	JobDeploymentUpdate = "deployment.update"

	// JobDeploymentNotify deployment notify
	JobDeploymentNotify = "deployment.notify"
)
View Source
var (
	// RecreateStrategy var
	RecreateStrategy = "recreate"
	// RampedStrategy var
	RampedStrategy = "ramped"
	// CanaryStrategy var
	CanaryStrategy = "canary"
	// BlueGreenStrategy var
	BlueGreenStrategy = "blue_green"
)

Functions

func In

func In(val interface{}, array interface{}) bool

In check if value is on array

Types

type App

type App struct {
	ID          string
	Name        string
	ImageFormat string
}

App struct

type Application

type Application struct {
	ID         string      `json:"id"`
	Name       string      `json:"name"`
	Format     string      `json:"format"`
	Containers []Container `json:"containers"`
}

Application struct

func (*Application) ConvertToJSON

func (c *Application) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Application) LoadFromJSON

func (c *Application) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Applications

type Applications struct {
	Applications []Application `json:"applications"`
}

Applications struct

func (*Applications) ConvertToJSON

func (c *Applications) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Applications) LoadFromJSON

func (c *Applications) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Cluster

type Cluster struct {
	Name   string `json:"name"`
	Health bool   `json:"health"`
}

Cluster struct

func (*Cluster) ConvertToJSON

func (c *Cluster) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Cluster) LoadFromJSON

func (c *Cluster) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Clusters

type Clusters struct {
	Clusters []Cluster `json:"clusters"`
}

Clusters struct

func (*Clusters) ConvertToJSON

func (c *Clusters) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Clusters) LoadFromJSON

func (c *Clusters) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type ConfigMap

type ConfigMap struct {
	Name              string            `json:"name"`
	Namespace         string            `json:"namespace"`
	UID               string            `json:"uid"`
	CreationTimestamp string            `json:"creation_timestamp"`
	Data              map[string]string `json:"data"`
	Labels            map[string]string `json:"labels"`
}

ConfigMap struct

func (*ConfigMap) ConvertToJSON

func (d *ConfigMap) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*ConfigMap) LoadFromJSON

func (d *ConfigMap) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Configs

type Configs struct {
	Exists       bool
	Version      string
	Applications []App
}

Configs struct

type Container

type Container struct {
	Name       string     `json:"name"`
	Image      string     `json:"image"`
	Version    string     `json:"version"`
	Deployment Deployment `json:"deployment"`
}

Container struct

type DSN

type DSN struct {
	Driver   string `json:"driver"`
	Username string `json:"username"`
	Password string `json:"password"`
	Hostname string `json:"hostname"`
	Port     int    `json:"port"`
	Name     string `json:"name"`
}

DSN struct

func (*DSN) ConvertToJSON

func (d *DSN) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*DSN) LoadFromJSON

func (d *DSN) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

func (*DSN) ToString

func (d *DSN) ToString() string

ToString gets the dsn string

type Deployment

type Deployment struct {
	Name string `json:"name"`
	UID  string `json:"uid"`
}

Deployment struct

func (*Deployment) ConvertToJSON

func (d *Deployment) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Deployment) LoadFromJSON

func (d *Deployment) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type DeploymentRequest

type DeploymentRequest struct {
	Cluster     string `json:"cluster"`
	Namespace   string `json:"namespace"`
	Application string `json:"application"`
	Version     string `json:"version"`
	Strategy    string `json:"strategy"`
	Status      string `json:"status"`

	// Ramped Strategy
	MaxSurge       string `json:"maxSurge"`
	MaxUnavailable string `json:"maxUnavailable"`
}

DeploymentRequest struct

func (*DeploymentRequest) ConvertToJSON

func (d *DeploymentRequest) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*DeploymentRequest) LoadFromJSON

func (d *DeploymentRequest) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

func (*DeploymentRequest) Validate

func (d *DeploymentRequest) Validate(strategies []string) error

Validate validates the request

type Job

type Job struct {
	ID        int        `json:"id"`
	UUID      string     `json:"uuid"`
	Payload   string     `json:"payload"`
	Status    string     `json:"status"`
	Type      string     `json:"type"`
	Result    string     `json:"result"`
	Retry     int        `json:"retry"`
	Parent    int        `json:"parent"`
	RunAt     *time.Time `json:"run_at"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
}

Job struct

func (*Job) ConvertToJSON

func (j *Job) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Job) LoadFromJSON

func (j *Job) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Jobs

type Jobs struct {
	Jobs []Job `json:"jobs"`
}

Jobs struct

func (*Jobs) ConvertToJSON

func (j *Jobs) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Jobs) LoadFromJSON

func (j *Jobs) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Message

type Message struct {
	UUID string `json:"uuid"`
	Job  int    `json:"job"`
}

Message struct

func (*Message) ConvertToJSON

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

ConvertToJSON convert object to json

func (*Message) LoadFromJSON

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

LoadFromJSON update object from json

type Metric

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

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

ConvertToJSON convert object to json

func (*Metric) GetValueAsFloat

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

GetValueAsFloat gets a list of label values

func (*Metric) LabelKeys

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

LabelKeys gets a list of label keys

func (*Metric) LabelValues

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

LabelValues gets a list of label values

func (*Metric) LoadFromJSON

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

LoadFromJSON update object from json

type Migration

type Migration struct {
	ID    int       `json:"id"`
	Flag  string    `json:"file"`
	RunAt time.Time `json:"run_at"`
}

Migration struct

func (*Migration) ConvertToJSON

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

ConvertToJSON convert object to json

func (*Migration) LoadFromJSON

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

LoadFromJSON update object from json

type Namespace

type Namespace struct {
	Name   string `json:"name"`
	UID    string `json:"uid"`
	Status string `json:"status"`
}

Namespace struct

func (*Namespace) ConvertToJSON

func (d *Namespace) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Namespace) LoadFromJSON

func (d *Namespace) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type Namespaces

type Namespaces struct {
	Namespaces []Namespace `json:"namespaces"`
}

Namespaces struct

func (*Namespaces) ConvertToJSON

func (d *Namespaces) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Namespaces) LoadFromJSON

func (d *Namespaces) LoadFromJSON(data []byte) (bool, error)

LoadFromJSON update object from json

type PatchStringValue

type PatchStringValue struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

PatchStringValue specifies a patch operation for a string.

type PatchUInt32Value

type PatchUInt32Value struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value uint32 `json:"value"`
}

PatchUInt32Value specifies a patch operation for a uint32.

Jump to

Keyboard shortcuts

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