services

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx *app.Context, service Service) error

Run backgrounds an appropriate routine based on the Service type.

func StartApp

func StartApp(svc Service, ctx *app.Context)

StartApp executes a service and manages it's lifecycle.

func StartHTTP

func StartHTTP(svc Service, ctx *app.Context)

StartHTTP creates a new HTTP server and manages it's lifecycle.

Types

type Service

type Service struct {
	Skip   bool   `yaml:"skip"`
	Name   string `yaml:"name"`
	Port   int    `yaml:"port"`
	Type   Type   `yaml:"type"`
	Exec   string `yaml:"exec"`
	Stdout bool   `yaml:"stdout"`
	Stderr bool   `yaml:"stderr"`

	Files     []string
	Responses []*http_results.Result
}

Service is parsed from a service yaml file.

func List

func List(ctx *app.Context) ([]Service, error)

List uses app.Context's flags to list all services in the service directory.

func NewService

func NewService(data []byte) (*Service, error)

NewService takes in the content of a service yaml file and creates a Service.

type Type

type Type string
const (
	ServiceHTTP Type = "http"
	ServiceApp  Type = "app"
)

Jump to

Keyboard shortcuts

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