service

package
v0.0.0-...-8a61a87 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Host         string
	DockerClient *client.Client
}

Service struct

func NewService

func NewService(host, dockerAPIVersion string, defaultHeaders map[string]string) *Service

NewService returns a new instance of the Service structure

func (*Service) GetDeploymentStatus

func (s *Service) GetDeploymentStatus(serviceName string, image string) (ServiceStatus, error)

GetDeploymentStatus returns the information about a service and it verifies if the tasks are running or for some reason it failed

func (*Service) GetService

func (s *Service) GetService(filter filters.Args) (swarm.Service, error)

GetService returns swarm.Service struct You will find the available filters on https://docs.docker.com/engine/api/v1.32/#operation/ServiceList

func (*Service) GetServiceStatus

func (s *Service) GetServiceStatus(serviceName string) (ServiceStatus, error)

GetServiceStatus returns the information about a service and it verifies if the tasks are running or for some reason it failed

func (*Service) GetTask

func (s *Service) GetTask(filter filters.Args) ([]swarm.Task, error)

GetTask returns the tasks related to a specific service id You will find the available filters on https://docs.docker.com/engine/api/v1.32/#operation/TaskList

type ServiceStatus

type ServiceStatus struct {
	ID              string `json:",omitempty"`
	Name            string
	Err             string              `json:",omitempty"`
	TaskStatus      []TaskStatus        `json:",omitempty"`
	Replicas        *uint64             `json:",omitempty"`
	RunningReplicas int                 `json:",omitempty"`
	FailedReplicas  int                 `json:",omitempty"`
	UpdateStatus    *swarm.UpdateStatus `json:",omitempty"`
}

ServiceStatus structure

type Services

type Services interface {
	GetService(filter filters.Args) (swarm.Service, error)
	GetTask(filter filters.Args) ([]swarm.Task, error)
	GetDeploymentStatus(serviceName string, image string) (ServiceStatus, error)
	GetServiceStatus(serviceName string) (ServiceStatus, error)
}

Services defines interfaces with the required methods

type TaskStatus

type TaskStatus struct {
	TaskID       string          `json:",omitempty"`
	Timestamp    time.Time       `json:",omitempty"`
	DesiredState swarm.TaskState `json:",omitempty"`
	State        swarm.TaskState `json:",omitempty"`
	Message      string          `json:",omitempty"`
	Err          string          `json:",omitempty"`
	Image        string          `json:",omitempty"`
}

TaskStatus structure

Jump to

Keyboard shortcuts

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