importer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(source string) (bool, error)

IsValid validates a service at a source.

Types

type Dependency added in v0.3.0

type Dependency struct {
	// Image is the Docker image.
	Image string `yaml:"image"`

	// Volumes are the Docker volumes.
	Volumes []string `yaml:"volumes"`

	// VolumesFrom are the docker volumes-from from.
	VolumesFrom []string `yaml:"volumesfrom"`

	// Ports holds ports configuration for container.
	Ports []string `yaml:"ports"`

	// Command is the Docker command which will be executed when container started.
	Command string `yaml:"command"`
}

Dependency represents a Docker container and it holds instructions about how it should run.

type Event added in v0.3.0

type Event struct {
	// Name is the name of event.
	Name string `yaml:"name"`

	// Description is the description of event.
	Description string `yaml:"description"`

	// Data holds the input parameters of event.
	Data map[string]*Parameter `yaml:"data"`
}

Event describes a service task.

type Output added in v0.3.0

type Output struct {
	// Name is the name of task output.
	Name string `yaml:"name"`

	// Description is the description of task output.
	Description string `yaml:"description"`

	// Data holds the output parameters of a task output.
	Data map[string]*Parameter `yaml:"data"`
}

Output describes task output.

type Parameter added in v0.3.0

type Parameter struct {
	// Name is the name of parameter.
	Name string `yaml:"name"`

	// Description is the description of parameter.
	Description string `yaml:"description"`

	// Type is the data type of parameter.
	Type string `yaml:"type"`

	// Optional indicates if parameter is optional.
	Optional bool `yaml:"optional"`
}

Parameter describes task input parameters, output parameters of a task output and input parameters of an event.

type ServiceDefinition added in v0.3.0

type ServiceDefinition struct {
	// Name is the service name.
	Name string `yaml:"name"`

	// Description is service description.
	Description string `yaml:"description"`

	// Tasks are the list of tasks that service can execute.
	Tasks map[string]*Task `yaml:"tasks"`

	// Events are the list of events that service can emit.
	Events map[string]*Event `yaml:"events"`

	// Dependencies are the Docker containers that service can depend on.
	Dependencies map[string]*Dependency `yaml:"dependencies"`

	// Configuration is the Docker container that service runs inside.
	Configuration *Dependency `yaml:"configuration"`

	// Repository holds the service's repository url if it's living on
	// a Git host.
	Repository string `yaml:"repository"`
}

ServiceDefinition represents MESG services configurations.

func From

func From(source string) (*ServiceDefinition, error)

From imports a service from a source.

type Task added in v0.3.0

type Task struct {
	// Name is the name of task.
	Name string `yaml:"name"`

	// Description is the description of task.
	Description string `yaml:"description"`

	// Inputs are the definition of the execution inputs of task.
	Inputs map[string]*Parameter `yaml:"inputs"`

	// Outputs are the definition of the execution results of task.
	Outputs map[string]*Output `yaml:"outputs"`
}

Task describes a service task.

type ValidationError

type ValidationError struct{}

ValidationError is the error type for the Validation of service.

func (*ValidationError) Error

func (v *ValidationError) Error() string

type ValidationResult

type ValidationResult struct {
	ServiceFileExist    bool
	ServiceFileWarnings []string
	DockerfileExist     bool
}

ValidationResult contains the result of the validation of a service.

func Validate

func Validate(source string) (*ValidationResult, error)

Validate validates a service at a source.

func (*ValidationResult) IsValid

func (v *ValidationResult) IsValid() bool

IsValid returns true if the validation result is valid.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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