services

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Internal Service Registry
	Registry map[string]*Service

	// Path variables
	OrchestraServicePath string
	ProjectPath          string

	// Other internal variables
	MaxServiceNameLength int
)

Functions

func DiscoverServices

func DiscoverServices()

DiscoverServices walks into the project path and looks in every subdirectory for the service.yml file. For every service it registers it after trying to import the package using Go's build.Import package

func Init

func Init()

Init initializes the OrchestraServicePath to the workingdir/.orchestra path and starts the service discovery

Types

type Service

type Service struct {
	Name        string
	Description string
	Path        string
	Color       string

	// Path
	OrchestraPath string
	LogFilePath   string
	PidFilePath   string
	BinPath       string

	// Process, Service and Package information
	FileInfo    os.FileInfo
	PackageInfo *build.Package
	Process     *os.Process
	Env         []string
	Args        []string
	Ports       string
}

Service encapsulates all the information needed for a service

func (*Service) IsRunning

func (s *Service) IsRunning() bool

type SortableRegistry

type SortableRegistry []*Service

func Sort

func Sort(r map[string]*Service) SortableRegistry

func (SortableRegistry) Len

func (s SortableRegistry) Len() int

func (SortableRegistry) Less

func (s SortableRegistry) Less(i, j int) bool

func (SortableRegistry) Swap

func (s SortableRegistry) Swap(i, j int)

Jump to

Keyboard shortcuts

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