gopm

package module
v0.0.0-...-dcf77fd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gopm

This is a hard fork of supervisord with the intention of using it strictly to manage a group of processes for local microservice development.

Installation

$ make install

Building in Development

$ make

The resulting binaries will be in bin/ directory. These binaries will seek out the ./webgui assets on disk when rendering the web UI.

If you'd like to build for release, set RELEASE environment variable like so:

$ make RELEASE=1

This will include the release build tag and embed any assets in the binaries.

Development Dependencies

grpc-web

Required to rebuild the grpc-web Javascript libraries. On macOS, install grpc-web with Homebrew:

$ brew install protoc-gen-grpc-web

To recompile the Javascript client:

$ make webgui/js/bundle.js

Documentation

Index

Constants

View Source
const (
	// Version the version of gopm
	Version = "1.0"
)

Variables

View Source
var HTTP http.FileSystem = http.Dir("./webgui")

HTTP auto generated

Functions

func ReapZombie

func ReapZombie()

ReapZombie reap the zombie child process

Types

type Errors

type Errors interface {
	Errors() []error
}

type Supervisor

type Supervisor struct {
	rpc.UnimplementedGopmServer
	// contains filtered or unexported fields
}

Supervisor manage all the processes defined in the supervisor configuration file. All the supervisor public interface is defined in this class

func NewSupervisor

func NewSupervisor(configFile string) *Supervisor

NewSupervisor create a Supervisor object with supervisor configuration file

func (*Supervisor) GetManager

func (s *Supervisor) GetManager() *process.Manager

GetManager get the Manager object created by superisor

func (*Supervisor) GetProcessInfo

func (s *Supervisor) GetProcessInfo(_ context.Context, _ *empty.Empty) (*rpc.ProcessInfoResponse, error)

func (*Supervisor) GetSupervisorID

func (s *Supervisor) GetSupervisorID() string

GetSupervisorID get the supervisor identifier from configuration file

func (*Supervisor) GetVersion

func (s *Supervisor) GetVersion(_ context.Context, _ *empty.Empty) (*rpc.VersionResponse, error)

func (*Supervisor) IsRestarting

func (s *Supervisor) IsRestarting() bool

IsRestarting check if supervisor is in restarting state

func (*Supervisor) Reload

func (s *Supervisor) Reload() error

Reload reloads the supervisor configuration

func (*Supervisor) ReloadConfig

func (*Supervisor) RestartProcess

func (s *Supervisor) RestartProcess(_ context.Context, req *rpc.StartStopRequest) (*rpc.StartStopResponse, error)

func (*Supervisor) Shutdown

func (s *Supervisor) Shutdown(context.Context, *empty.Empty) (*empty.Empty, error)

func (*Supervisor) SignalAllProcesses

func (s *Supervisor) SignalAllProcesses(_ context.Context, req *rpc.SignalProcessRequest) (*rpc.ProcessInfoResponse, error)

func (*Supervisor) SignalProcess

func (s *Supervisor) SignalProcess(_ context.Context, req *rpc.SignalProcessRequest) (*empty.Empty, error)

func (*Supervisor) SignalProcessGroup

func (s *Supervisor) SignalProcessGroup(_ context.Context, req *rpc.SignalProcessRequest) (*rpc.ProcessInfoResponse, error)

func (*Supervisor) StartAllProcesses

func (s *Supervisor) StartAllProcesses(_ context.Context, req *rpc.StartStopAllRequest) (*rpc.ProcessInfoResponse, error)

func (*Supervisor) StartProcess

func (*Supervisor) StopAllProcesses

func (s *Supervisor) StopAllProcesses(_ context.Context, req *rpc.StartStopAllRequest) (*rpc.ProcessInfoResponse, error)

func (*Supervisor) StopProcess

func (*Supervisor) TailLog

func (s *Supervisor) TailLog(req *rpc.TailLogRequest, stream rpc.Gopm_TailLogServer) error

func (*Supervisor) WaitForExit

func (s *Supervisor) WaitForExit()

WaitForExit wait the supervisor to exit

type SupervisorConfigError

type SupervisorConfigError struct {
	Err error
}

SupervisorConfigError is returned when there was a problem loading the supervisor configuration file.

func (SupervisorConfigError) Error

func (sc SupervisorConfigError) Error() string

func (SupervisorConfigError) Unwrap

func (sc SupervisorConfigError) Unwrap() error

type SupervisorWebgui

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

SupervisorWebgui the interface to show a WEBGUI to control the supervisor

func NewSupervisorWebgui

func NewSupervisorWebgui(supervisor *Supervisor) *SupervisorWebgui

NewSupervisorWebgui create a new SupervisorWebgui object

func (*SupervisorWebgui) CreateHandler

func (sw *SupervisorWebgui) CreateHandler() http.Handler

CreateHandler create a http handler to process the request from WEBGUI

Directories

Path Synopsis
cmd
gopm command
gopmctl command
internal
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
pkg
env

Jump to

Keyboard shortcuts

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