config

package
v0.0.0-...-2759aa6 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Services map[string]*Service `json:"services"`

	Proxy struct {
		HTTP  string `json:"http"`
		HTTPS string `json:"https"`
	} `json:"proxy"`

	ControlPlane struct {
		Host string `json:"host"`
	} `json:"controlPlane"`

	Locator *locator.Locator `json:"locator"`
}

Config holds vite's configuration.

func Get

func Get(l *locator.Locator) (*Config, error)

func GetUsingDefaultLocator

func GetUsingDefaultLocator() (*Config, error)

GetUsingDefaultLocator returns the Config given a config locator.Locator.

type Hooks

type Hooks struct {
	// Commands to run before the container is started.
	Prestart []string `json:"prestart" yaml:"prestart"`
	// Commands to run after the container is started.
	Poststart []string `json:"poststart" yaml:"poststart"`
	// Commands to run before the container is stopped.
	Prestop []string `json:"prestop" yaml:"prestop"`
	// Commands to run after the container is stopped.
	Poststop []string `json:"poststop" yaml:"poststop"`
}

Hooks contains a service's hooks. It is used both my the configYAML and the Config

type Service

type Service struct {
	// IsTopLevel indicates whether this service is depended on by other services.
	IsTopLevel bool `json:"isTopLevel"`

	// Name is the service's name. It need not contain the registry host.
	Name string `json:"name"`

	// Image is the service's Docker image.
	Image string `json:"image"`

	// Hosts are a list of hosts to which the service answers to.
	Hosts []string `json:"hosts"`

	// Env is a list of environment variables to set.
	Env []string `json:"env"`

	// Hooks are the service's hooks: prestart, poststart, prestop, poststop.
	Hooks Hooks `json:"hooks"`

	// Requires is a list of services that must be running before this service
	Requires []*Service `json:"requires"`

	// Registry is the auth configuration for the service's registry.
	Registry *types.AuthConfig `yaml:"registry"`
}

Service contains the configuration about a service.

Jump to

Keyboard shortcuts

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