proto

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceRequirementKindSet                = "set"
	ResourceRequirementKindDefaultsLimitRange = "defaults-limit-range"
	ResourceRequirementKindDefaultFromLimits  = "default-from-limits"
)

Variables

This section is empty.

Functions

func Decode

func Decode(in []byte, out interface{}) error

func DecodeGOB

func DecodeGOB(in []byte, out interface{}) error

func DecodeJSON

func DecodeJSON(in []byte, out interface{}) error

func Encode

func Encode(in interface{}) ([]byte, error)

func EncodeGOB

func EncodeGOB(in interface{}) ([]byte, error)

func EncodeJSON

func EncodeJSON(in interface{}) ([]byte, error)

func RegisterGOBTypes

func RegisterGOBTypes()

Types

type ContainerResourceRequirements

type ContainerResourceRequirements struct {
	kv1.ResourceRequirements
	SpecResourceRequirements kv1.ResourceRequirements `json:"spec_resources_requirements,omitempty"`

	LimitsKinds   ResourcesRequirementsKind `json:"limits_kinds,omitempty"`
	RequestsKinds ResourcesRequirementsKind `json:"requests_kinds,omitempty"`
}

type ContainerResources

type ContainerResources struct {
	Requests RequestLimit `json:"requests,omitempty"`
	Limits   RequestLimit `json:"limits,omitempty"`
}

type DecisionExecutionStatus

type DecisionExecutionStatus string
const (
	DecisionExecutionStatusSucceed DecisionExecutionStatus = "executed"
	DecisionExecutionStatusFailed  DecisionExecutionStatus = "failed"
	DecisionExecutionStatusSkipped DecisionExecutionStatus = "skipped"
)

type MetricStoreRequest

type MetricStoreRequest struct {
	Name        string    `json:"name"`
	Type        string    `json:"type"`
	Node        uuid.UUID `json:"node"`
	Application uuid.UUID `json:"application"`
	Service     uuid.UUID `json:"service"`
	Container   uuid.UUID `json:"container"`
	Timestamp   time.Time `json:"timestamp"`
	Value       int64     `json:"value"`
	Pod         string    `json:"pod"`

	AdditionalTags map[string]interface{} `json:"additional_tags"`
}

type PacketApplicationsStoreRequest

type PacketApplicationsStoreRequest []PacketRegisterApplicationItem

type PacketApplicationsStoreResponse

type PacketApplicationsStoreResponse struct{}

type PacketAuthorizationAnswer

type PacketAuthorizationAnswer struct {
	Token []byte `json:"token"`
}

type PacketAuthorizationFailure

type PacketAuthorizationFailure struct{}

type PacketAuthorizationQuestion

type PacketAuthorizationQuestion struct {
	Token []byte `json:"token"`
}

type PacketAuthorizationRequest

type PacketAuthorizationRequest struct {
	AccountID uuid.UUID `json:"account_id"`
	ClusterID uuid.UUID `json:"cluster_id"`
}

type PacketAuthorizationSuccess

type PacketAuthorizationSuccess struct{}

type PacketBye

type PacketBye struct {
	Reason string `json:"reason,omitempty"`
}

type PacketDecision

type PacketDecision struct {
	ID          uuid.UUID `json:"id"`
	ServiceId   uuid.UUID `json:"service_id"`
	ContainerId uuid.UUID `json:"container_id"`

	ContainerResources ContainerResources `json:"container_resources"`
}

type PacketDecisionFeedbackRequest

type PacketDecisionFeedbackRequest struct {
	ID          uuid.UUID `json:"id"`
	ServiceId   uuid.UUID `json:"service_id"`
	ContainerId uuid.UUID `json:"container_id"`

	Status  DecisionExecutionStatus `json:"status"`
	Message string                  `json:"message"`
}

type PacketDecisionFeedbackResponse

type PacketDecisionFeedbackResponse struct{}

type PacketDecisionPullRequest

type PacketDecisionPullRequest struct{}

type PacketDecisionPullResponse

type PacketDecisionPullResponse struct {
	Decisions []*PacketDecision `json:"decisions"`
}

type PacketDecisionResponse

type PacketDecisionResponse struct {
	Error *string `json:"error"`
}

type PacketEventLastValueRequest

type PacketEventLastValueRequest struct {
	Entity    string `json:"entity"`
	EntityID  string `json:"entity_id"`
	EventKind string `json:"kind"`
}

type PacketEventLastValueResponse

type PacketEventLastValueResponse struct {
	Value interface{} `json:"value"`
}

type PacketEventsStoreRequest

type PacketEventsStoreRequest []watcher.Event

type PacketEventsStoreResponse

type PacketEventsStoreResponse struct{}

type PacketHello

type PacketHello struct {
	Major     uint      `json:"major"`
	Minor     uint      `json:"minor"`
	Build     string    `json:"build"`
	StartID   string    `json:"start_id"`
	AccountID uuid.UUID `json:"account_id"`
	ClusterID uuid.UUID `json:"cluster_id"`
}

type PacketKind

type PacketKind string
const (
	PacketKindHello PacketKind = "hello"

	PacketKindAuthorizationRequest  PacketKind = "authorization/request"
	PacketKindAuthorizationQuestion PacketKind = "authorization/question"
	PacketKindAuthorizationAnswer   PacketKind = "authorization/answer"
	PacketKindAuthorizationFailure  PacketKind = "authorization/failure"
	PacketKindAuthorizationSuccess  PacketKind = "authorization/success"

	PacketKindLogs PacketKind = "logs"

	PacketKindMetricsStoreRequest     PacketKind = "metrics/store"
	PacketKindMetricsPromStoreRequest PacketKind = "metrics/prom/store"

	PacketKindApplicationsStoreRequest PacketKind = "applications/store"

	PacketKindNodesStoreRequest PacketKind = "nodes/store"

	PacketKindEventLastValueRequest PacketKind = "events/query/last_value"
	PacketKindEventsStoreRequest    PacketKind = "events/store"

	PacketKindStatusStoreRequest PacketKind = "status/store"

	PacketKindBye PacketKind = "bye"

	PacketKindDecision         PacketKind = "decision"
	PacketKindDecisionFeedback PacketKind = "decision/feedback"
	PacketKindDecisionPull     PacketKind = "decision/pull"

	PacketKindRestart PacketKind = "restart"

	PacketKindRawStoreRequest PacketKind = "raw/store"
)
const (
	PacketKindPing PacketKind = "ping"
	PacketKindPong PacketKind = "pong"
)

func (PacketKind) String

func (kind PacketKind) String() string

type PacketLogItem

type PacketLogItem struct {
	Level lorg.Level  `json:"level"`
	Date  time.Time   `json:"date"`
	Data  interface{} `json:"data"`
}

type PacketLogs

type PacketLogs []PacketLogItem

type PacketMetricFamilyItem

type PacketMetricFamilyItem struct {
	Name string
	Help string
	Type string
	Tags []string

	Values []*PacketMetricValueItem
}

type PacketMetricValueItem

type PacketMetricValueItem struct {
	Node        *uuid.UUID
	Application *uuid.UUID
	Service     *uuid.UUID
	Container   *uuid.UUID

	Tags  map[string]string
	Value float64
}

type PacketMetricsPromStoreRequest

type PacketMetricsPromStoreRequest struct {
	Timestamp time.Time

	Metrics []*PacketMetricFamilyItem
}

type PacketMetricsPromStoreResponse

type PacketMetricsPromStoreResponse struct {
}

type PacketMetricsStoreRequest

type PacketMetricsStoreRequest []MetricStoreRequest

type PacketMetricsStoreResponse

type PacketMetricsStoreResponse struct {
}

type PacketNodesStoreRequest

type PacketNodesStoreRequest []PacketRegisterNodeItem

type PacketNodesStoreResponse

type PacketNodesStoreResponse struct{}

type PacketPing

type PacketPing struct {
	Number  int       `json:"number,omitempty"`
	Started time.Time `json:"started"`
}

type PacketPong

type PacketPong struct {
	Number  int       `json:"number,omitempty"`
	Started time.Time `json:"started"`
}

type PacketRaw

type PacketRaw map[string]interface{}

type PacketRawRequest

type PacketRawRequest struct {
	PacketRaw

	Timestamp time.Time
}

type PacketRawResponse

type PacketRawResponse struct{}

type PacketRegisterApplicationItem

type PacketRegisterApplicationItem struct {
	PacketRegisterEntityItem

	LimitRanges []kv1.LimitRange            `json:"limit_ranges"`
	Services    []PacketRegisterServiceItem `json:"services"`
}

type PacketRegisterContainerItem

type PacketRegisterContainerItem struct {
	PacketRegisterEntityItem

	Image     string          `json:"image"`
	Resources json.RawMessage `json:"resources"`

	LivenessProbe  json.RawMessage `json:"liveness_probe"`
	ReadinessProbe json.RawMessage `json:"readiness_probe"`
}

type PacketRegisterEntityItem

type PacketRegisterEntityItem struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
	Kind string    `json:"kind,omitempty"`

	Annotations map[string]string `json:"annotations,omitempty"`
}

type PacketRegisterNodeCapacityItem

type PacketRegisterNodeCapacityItem struct {
	CPU              int `json:"cpu"`
	Memory           int `json:"memory"`
	StorageEphemeral int `json:"storage_ephemeral"`
	Pods             int `json:"pods"`
}

type PacketRegisterNodeContainerListItem

type PacketRegisterNodeContainerListItem struct {
	// cluster where host of container located in
	Cluster string `json:"cluster"`
	// image of container
	Image string `json:"image"`
	// limits of container
	Limits *PacketRegisterNodeContainerListResourcesItem `json:"limits"`
	// requests of container
	Requests *PacketRegisterNodeContainerListResourcesItem `json:"requests"`
	// name of container (not guaranteed to be unique in cluster scope)
	Name string `json:"name"`
	// namespace where pod located in
	Namespace string `json:"namespace"`
	// node where container located in
	Node string `json:"node"`
	// pod where container located in
	Pod string `json:"pod"`
}

type PacketRegisterNodeContainerListResourcesItem

type PacketRegisterNodeContainerListResourcesItem struct {
	CPU    int `json:"cpu"`
	Memory int `json:"memory"`
}

PacketRegisterNodeContainerListResourcesItem

type PacketRegisterNodeItem

type PacketRegisterNodeItem struct {
	ID            uuid.UUID                              `json:"id,omitempty"`
	Name          string                                 `json:"name"`
	IP            string                                 `json:"ip"`
	Roles         string                                 `json:"roles"`
	Region        string                                 `json:"region,omitempty"`
	Provider      string                                 `json:"provider,omitempty"`
	InstanceType  string                                 `json:"instance_type,omitempty"`
	InstanceSize  string                                 `json:"instance_size,omitempty"`
	Capacity      PacketRegisterNodeCapacityItem         `json:"capacity"`
	Allocatable   PacketRegisterNodeCapacityItem         `json:"allocatable"`
	Containers    int                                    `json:"containers,omitempty"`
	ContainerList []*PacketRegisterNodeContainerListItem `json:"container_list,omitempty"`
}

type PacketRegisterServiceItem

type PacketRegisterServiceItem struct {
	PacketRegisterEntityItem
	ReplicasStatus ReplicasStatus                `json:"replicas_status,omitempty"`
	Containers     []PacketRegisterContainerItem `json:"containers"`
}

type PacketRestart

type PacketRestart struct {
	Status int `json:"status"`
}

type PacketStatusStoreRequest

type PacketStatusStoreRequest struct {
	Entity    string                         `json:"entity"`
	EntityID  uuid.UUID                      `json:"entity_id"`
	Status    watcher.Status                 `json:"status"`
	Source    *watcher.ContainerStatusSource `json:"source"`
	Timestamp time.Time                      `json:"timestamp"`
}

type PacketStatusStoreResponse

type PacketStatusStoreResponse struct{}

type ReplicasStatus

type ReplicasStatus struct {
	Desired   *int32 `json:"desired,omitempty"`
	Current   *int32 `json:"current,omitempty"`
	Ready     *int32 `json:"ready,omitempty"`
	Available *int32 `json:"available,omitempty"`
}

type RequestLimit

type RequestLimit struct {
	CPU    *int64 `json:"cpu,omitempty"`
	Memory *int64 `json:"memory,omitempty"`
}

type ResourcesRequirementsKind

type ResourcesRequirementsKind = map[kv1.ResourceName]string

Jump to

Keyboard shortcuts

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