config

package
v0.0.0-...-34c5bf1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LangGo        = "go"
	SysDocker     = "docker"
	SysKubernetes = "kubernetes"
	SysSystemd    = "systemd"
	ArchARMv6     = "ARMv6"
)

Service constants

Variables

This section is empty.

Functions

func Init

func Init(filename string) (err error)

Init reads and validates config

Types

type Config

type Config struct {
	Repository string
	Targets    map[string]*Target
	Services   map[string]*Service
}

Config holds configuration for the deploy tool

func Get

func Get() *Config

Get gets the current config, assuming Init() has already been called.

type DockerConfig

type DockerConfig struct {
	// contains filtered or unexported fields
}

DockerConfig holds options related building the service using Docker

func (*DockerConfig) Args

func (d *DockerConfig) Args() map[string]string

Args returns a map of arguments for the Dockerfile

func (*DockerConfig) Dockerfile

func (d *DockerConfig) Dockerfile() string

Dockerfile returns the path to the Dockerfile

type KubernetesConfig

type KubernetesConfig struct {
	// contains filtered or unexported fields
}

KubernetesConfig holds options related to a Kubernetes deployment

func (*KubernetesConfig) ManifestArgs

func (k *KubernetesConfig) ManifestArgs() *KubernetesManifestArgs

ManifestArgs returns data that should be given to the manifest template

func (*KubernetesConfig) Manifests

func (k *KubernetesConfig) Manifests() []string

Manifests returns the paths of the Kubernetes manifest files

type KubernetesManifestArgs

type KubernetesManifestArgs struct {
	// contains filtered or unexported fields
}

KubernetesManifestArgs holds data that should be given to the manifest template

func (*KubernetesManifestArgs) NodePort

func (a *KubernetesManifestArgs) NodePort() int

NodePort returns a non-zero int if a custom node port is set in the manifest args

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the microservice to be deployed

func (*Service) DashedName

func (s *Service) DashedName() string

DashedName returns home-automation-foo for foo

func (*Service) Docker

func (s *Service) Docker() *DockerConfig

Docker returns the docker configuration for the service

func (*Service) EnvFiles

func (s *Service) EnvFiles() []string

EnvFiles returns the env files that should be supplied to the service at runtime

func (*Service) Kubernetes

func (s *Service) Kubernetes() *KubernetesConfig

Kubernetes returns the Kubernetes configuration for the service

func (*Service) Language

func (s *Service) Language() string

Language returns the programming language of the service

func (*Service) Name

func (s *Service) Name() string

Name returns the name of the service

func (*Service) Path

func (s *Service) Path() string

Path returns the path of the service

func (*Service) SyslogIdentifier

func (s *Service) SyslogIdentifier() string

SyslogIdentifier returns the value that can be used in a systemd unit file.

func (*Service) TargetNames

func (s *Service) TargetNames() []string

TargetNames returns the names of the service's targets

func (*Service) Targets

func (s *Service) Targets() []*Target

Targets returns the service's targets

type Target

type Target struct {
	// contains filtered or unexported fields
}

Target is the destination server for the deployment

func (*Target) Architecture

func (t *Target) Architecture() string

Architecture returns the target's architecture

func (*Target) Directory

func (t *Target) Directory() string

Directory returns the working directory to use on the target

func (*Target) DockerRegistry

func (t *Target) DockerRegistry() string

DockerRegistry returns the Docker registry that images should be pushed to to be deployed to the target

func (*Target) DockerRepository

func (t *Target) DockerRepository() string

DockerRepository returns the name of the Docker repository that images should be in to be deployed to the target. In the image 192.168.1.1/jakewright/s-foo, jakewright is the repository.

func (*Target) Host

func (t *Target) Host() string

Host returns the hostname of the target

func (*Target) KubeContext

func (t *Target) KubeContext() string

KubeContext returns the k8s context to use when interacting with the target

func (*Target) Name

func (t *Target) Name() string

Name returns the friendly name of the target

func (*Target) Namespace

func (t *Target) Namespace() string

Namespace returns the k8s namespace to use when interacting with the target

func (*Target) System

func (t *Target) System() string

System returns the system used by the target

func (*Target) Username

func (t *Target) Username() string

Username returns the username to connect to the target

Jump to

Keyboard shortcuts

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