services

package
v0.0.0-...-b872246 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProcessManagerPort

func GetProcessManagerPort(projectDir string) (int, error)

func ListenToChanges

func ListenToChanges(ctx context.Context, opts *ListenerOpts) error

func ProcessManagerIsRunning

func ProcessManagerIsRunning(projectDir string) bool

func RestartServices

func RestartServices(ctx context.Context, serviceName, projectDir string, w io.Writer) error

func StartProcessManager

func StartProcessManager(
	ctx context.Context,
	w io.Writer,
	requestedServices []string,
	availableServices Services,
	projectDir string,
	processComposeBinPath string,
	processComposeBackground bool,
) error

func StartServices

func StartServices(ctx context.Context, w io.Writer, serviceName, projectDir string) error

func StopAllProcessManagers

func StopAllProcessManagers(ctx context.Context, w io.Writer) error

func StopProcessManager

func StopProcessManager(ctx context.Context, projectDir string, w io.Writer) error

func StopServices

func StopServices(ctx context.Context, serviceName, projectDir string, w io.Writer) error

Types

type ListenerOpts

type ListenerOpts struct {
	HostID     string
	ProjectDir string
	UpdateFunc updateFunc
	Writer     io.Writer
}

type Process

type Process struct {
	Name     string
	Status   string
	ExitCode int
}

func ListServices

func ListServices(ctx context.Context, projectDir string, w io.Writer) ([]Process, error)

type Service

type Service struct {
	Name               string
	ProcessComposePath string
}

type ServiceStatus

type ServiceStatus struct {
	LocalPort string `json:"local_port"`
	Name      string `json:"name"`
	Port      string `json:"port"`
	Running   bool   `json:"running"`
}

type Services

type Services map[string]Service // name -> Service

func FromProcessCompose

func FromProcessCompose(path string) (Services, error)

func FromUserProcessCompose

func FromUserProcessCompose(projectDir, userProcessCompose string) Services

Jump to

Keyboard shortcuts

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