supervisor

package module
v0.0.0-...-488755c Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 17 Imported by: 0

README

simple-hypervisor

just dead simple processes hypervisor

how to install

go install -v github.com/nordicdyno/simple-hypervisor/cmd/...

how to use

start server:

sh-srv

show services list:

sh-ctl list

add service:

sh-ctl add

todo

  • set ports via command line
  • http API docs
  • logs redirection
  • more sh-ctl commands
  • pretty output
  • wait service start/stop command

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlServer

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

func NewControlServer

func NewControlServer(super *Supervisor) *ControlServer

func (*ControlServer) AddService

func (s *ControlServer) AddService(ctx context.Context, svc *pb.NewService) (*pb.Nope, error)

func (*ControlServer) AllServices

func (s *ControlServer) AllServices(context.Context, *pb.Nope) (*pb.Services, error)

AllServices returns all registered services.

func (*ControlServer) GetService

func (s *ControlServer) GetService(ctx context.Context, name *pb.ServiceName) (*pb.Service, error)

GetService returns service description for provided topic name.

func (*ControlServer) Start

func (s *ControlServer) Start(ctx context.Context) error

func (*ControlServer) Stop

func (s *ControlServer) Stop(ctx context.Context)

func (*ControlServer) UpdateService

func (s *ControlServer) UpdateService(ctx context.Context, svc *pb.NewService) (*pb.Nope, error)

type Service

type Service struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type Supervisor

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

func NewSupervisor

func NewSupervisor() *Supervisor

func (*Supervisor) AddService

func (s *Supervisor) AddService(name string, cmdline string) error

func (*Supervisor) AllServiceNames

func (s *Supervisor) AllServiceNames() []string

func (*Supervisor) Get

func (s *Supervisor) Get(name string) (*Service, error)

func (*Supervisor) GetService

func (s *Supervisor) GetService(name string) (*pb.Service, error)

func (*Supervisor) StopAll

func (s *Supervisor) StopAll()

func (*Supervisor) StopService

func (s *Supervisor) StopService(name string) error

func (*Supervisor) UpdateService

func (s *Supervisor) UpdateService(name string, cmdline string) error

Directories

Path Synopsis
cmd
Package pb is a reverse proxy.
Package pb is a reverse proxy.

Jump to

Keyboard shortcuts

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