Documentation
¶
Overview ¶
Copyright (C) 2020 Alex Neo
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Communication ¶
type Communication interface { // Send data to a specific queue Send(message []byte, queue string) error // Receive data from a specific queue Receive(queue string) (<-chan amqp.Delivery, error) // Connect to a queue microservice Connect() error }
Interface to standadized communication between microservices in the Epsilon distributed system
type CommunicationClient ¶
type CommunicationClient struct {
// contains filtered or unexported fields
}
CommunicationClient stucture
func NewCommunicationClient ¶
func NewCommunicationClient(host string) (CommunicationClient, error)
Create a new communication client for communication with the queue microservice
func (*CommunicationClient) Connect ¶
func (c *CommunicationClient) Connect() error
Attempt to connect to the queue microservice
func (*CommunicationClient) QueueDeclare ¶
func (c *CommunicationClient) QueueDeclare(queue string) error
Create a new queue to either receive or send messages
type ExperimentPayload ¶
type ExperimentPayload struct { // Type of microservice Type string // The hostname of the microservice that send this message Hostname string // The time a microservice receive the pod InTime time.Time // The the a microservice finish processing a pod OutTime time.Time // The pod getting processed Pod *corev1.Pod }
Message structure for communicating with the Experiment microservice
type RetryRequest ¶
type RetryRequest struct { Req ScheduleRequest //Name of the queue the Retry microservice is using Queue string }
Message structure for communicating with the Retry microservice
type ScheduleRequest ¶
type ScheduleRequest struct { // A string containing pod details in the following format [pod name]@[namespace] Key string // Next backoff duration if the pod fails to schedule NextBackOffTime int // Total time taken to complete scheduling ProcessedTime time.Duration // Supporting information if required [optional] Message string // Supporting information if required [optional] }
Message structure used by the Scheduler microservice