application

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2017 License: MIT Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanApplicationContainers

func CleanApplicationContainers(appDir, composeProjectName string, logChannel chan string) error

CleanApplicationContainers cleans all Docker containers started by the docker-compose.yml file under appDir/tmp/

func CleanServiceTestContainers

func CleanServiceTestContainers(appDir, composeProjectName string, logChannel chan string) error

CleanServiceTestContainers cleans all Docker containers started by the docker-compose.yml files under appDir/serviceLocation/tests/tmp/

func StartDeploy

func StartDeploy(deployConfig types.DeployConfig) error

StartDeploy starts the deployment process

Types

type Initializer

type Initializer struct {
	AppConfig                types.AppConfig
	DockerComposeConfig      types.DockerCompose
	DockerComposeProjectName string
	ServiceData              map[string]types.ServiceData
	ServiceConfigs           map[string]types.ServiceConfig
	AppDir                   string
	HomeDir                  string
	BuildMode                composebuilder.BuildMode
	// contains filtered or unexported fields
}

Initializer sets up the app

func NewInitializer

func NewInitializer(appConfig types.AppConfig, logChannel chan string, logRole, appDir, homeDir, dockerComposeProjectName string, mode composebuilder.BuildMode) (*Initializer, error)

NewInitializer is Initializer's constructor

func (*Initializer) GetDockerConfigs

func (i *Initializer) GetDockerConfigs() (types.DockerConfigs, error)

GetDockerConfigs returns the docker configs of all services and dependencies in the application

func (*Initializer) Initialize

func (i *Initializer) Initialize() error

Initialize sets up the entire app and returns an error if any

type Logger

type Logger struct {
	Roles         []string
	SilencedRoles []string
	Length        int
	Colors        map[string]color.Attribute
	Writer        io.Writer
}

Logger represents a logger

func NewLogger

func NewLogger(roles, silencedRoles []string, writer io.Writer) *Logger

NewLogger is Logger's constructor

func (*Logger) GetLogChannel

func (l *Logger) GetLogChannel(role string) chan string

GetLogChannel returns a channel which will be endless read from and logged with the given role

func (*Logger) Log

func (l *Logger) Log(role, text string) error

Log logs the given text

type Runner

type Runner struct {
	AppConfig                types.AppConfig
	ServiceConfigs           map[string]types.ServiceConfig
	BuiltDependencies        map[string]config.AppDevelopmentDependency
	DockerComposeDir         string
	DockerComposeProjectName string
	Logger                   *Logger
	// contains filtered or unexported fields
}

Runner runs the overall application

func NewRunner

func NewRunner(appConfig types.AppConfig, logger *Logger, logRole, appDir, homeDir, dockerComposeProjectName string) (*Runner, error)

NewRunner is Runner's constructor

func (*Runner) Shutdown

func (r *Runner) Shutdown(shutdownConfig types.ShutdownConfig) error

Shutdown shuts down the application and returns the process output and an error if any

func (*Runner) Start

func (r *Runner) Start() error

Start runs the application and returns the process and returns an error if any

type ServiceTester

type ServiceTester struct {
	Role              string
	ServiceConfig     types.ServiceConfig
	BuiltDependencies map[string]config.AppDevelopmentDependency
	AppDir            string
	ServiceDir        string
	*Initializer
	*Runner
}

ServiceTester runs the tests for the given service

func NewServiceTester

func NewServiceTester(role string, serviceConfig types.ServiceConfig, builtDependencies map[string]config.AppDevelopmentDependency, appDir, serviceDir string, initializer *Initializer, runner *Runner) (*ServiceTester, error)

NewServiceTester is ServiceTester's constructor

func (*ServiceTester) Run

func (s *ServiceTester) Run() (bool, error)

Run runs the tests for the service and return true if the tests passed and an error if any

type Tester

type Tester struct {
	AppConfig              types.AppConfig
	InternalServiceConfigs map[string]types.ServiceConfig
	ServiceData            map[string]types.ServiceData
	AppDir                 string

	DockerComposeProjectName string
	Logger                   *Logger
	// contains filtered or unexported fields
}

Tester runs tests for all internal services of the application

func NewTester

func NewTester(appConfig types.AppConfig, logger *Logger, appDir, homeDir, dockerComposeProjectName string, mode composebuilder.BuildMode) (*Tester, error)

NewTester is Tester's constructor

func (*Tester) RunAppTests

func (a *Tester) RunAppTests() (bool, error)

RunAppTests runs the tests for the entire application

func (*Tester) RunServiceTest

func (a *Tester) RunServiceTest(serviceName string) (bool, error)

RunServiceTest runs the tests for a single service

Jump to

Keyboard shortcuts

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