service

package
v0.0.0-...-a0900a7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 6 Imported by: 5

Documentation

Overview

Package service provides a interface and base type for starting and proxying to services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvVar

type EnvVar struct {
	Name  string `yaml:"name" json:"name"`
	Value string `yaml:"value" json:"value"`
}

EnvVar key value pair to pass envionment values to a service.

type Interface

type Interface interface {
	ProxySpec() string
	RunCmd(string) []string
	ID() string
}

Interface service interface to specify service types.

type Manifest

type Manifest struct {
	ApiVersion  string  `yaml:"apiVersion" json:"apiVersion"`
	Spec        Service `yaml:"spec" json:"spec"`
	DateChanged time.Time
}

ServiceManifest struct matching the a service deployment manifest file.

func ReadService

func ReadService(filename string) (Manifest, error)

ReadService reads a service manifest from supplied file.

type Service

type Service struct {
	Name        string   `yaml:"name" json:"name"`
	Port        int      `yaml:"port" json:"port"`
	Domain      string   `yaml:"domain" json:"domain"`
	Image       string   `yaml:"image" json:"image"`
	VolumeMount string   `yaml:"volumeMount" json:"volumeMount"`
	Env         []EnvVar `yaml:"env" json:"env"`
	Active      bool     `yaml:"active" json:"active"`
}

Service holds information to start, identify and proxy traffic to a containarized service.

func (Service) ID

func (s Service) ID() string

ID returns and identifying string from a service.

func (Service) ProxySpec

func (s Service) ProxySpec() string

ProxySpec creates an server block in Nginx format in order to proxy traffic to a service.

func (Service) RunCmd

func (s Service) RunCmd(network string) []string

DockerRunCmd creates a docker run command for a service based on its attributes.

Jump to

Keyboard shortcuts

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