local

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package local runs services as processes on this machine. Processes are detached into their own process group, so they outlive the rig command that started them; pid and log files live under .rig/<env>/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(env core.Env, c *spec.Component) (any, error)

Types

type Options

type Options struct {
	Env map[string]string `yaml:"env"`
	// StopTimeout is how long a process gets after SIGTERM before SIGKILL.
	StopTimeout time.Duration `yaml:"stop_timeout"`
}

type Runtime

type Runtime struct {
	localhost.Host
	// contains filtered or unexported fields
}

func (*Runtime) Deploy

func (r *Runtime) Deploy(ctx context.Context, s *spec.Service, _ core.Release) error

func (*Runtime) Discover

func (r *Runtime) Discover(ctx context.Context) ([]core.Workload, error)

func (*Runtime) Exec

func (r *Runtime) Exec(ctx context.Context, s *spec.Service, o core.ExecOptions) error

func (*Runtime) Forward

func (r *Runtime) Forward(ctx context.Context, t core.Target) (string, error)

Forward is the port itself, except a service's metrics port when its process does not listen there: local configs often give every service its own metrics port while rig.yaml names one for all, so the process's own port serving /metrics stands in.

func (*Runtime) Logs

func (r *Runtime) Logs(ctx context.Context, s *spec.Service, o core.LogOptions) (<-chan core.LogLine, error)

func (*Runtime) PID

func (r *Runtime) PID(svc string) (int, bool)

PID is the process id of a running service, for adapters that attach to it (delve, perf).

func (*Runtime) Relaunch

func (r *Runtime) Relaunch(ctx context.Context, s *spec.Service, wrap func([]string) []string) error

func (*Runtime) Restart

func (r *Runtime) Restart(ctx context.Context, s *spec.Service) error

func (*Runtime) Scale

func (r *Runtime) Scale(ctx context.Context, s *spec.Service, n int) error

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, s *spec.Service) error

func (*Runtime) Status

func (r *Runtime) Status(ctx context.Context, s *spec.Service) (core.Status, error)

func (*Runtime) Stop

func (r *Runtime) Stop(ctx context.Context, s *spec.Service) error

Jump to

Keyboard shortcuts

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