svcctl

package
v0.0.0-...-7426b64 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Overview

Package svcctl provides functions that make use of an IPC device, as well as common IPC handlers and requesters. The intent is to guard the authority and uniqueness of the state service, so localized error messages refer to the "service" rather than just the IPC server.

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyHTTPAddr  = "http-addr"
	KeyLogFile   = "log-file"
	KeyHeartbeat = "heart<"
	KeyExitCode  = "exitcode<"
)

Functions

func EnsureExecStartedAndLocateHTTP

func EnsureExecStartedAndLocateHTTP(ipComm IPCommunicator, exec, argText string) (addr string, err error)

func EnsureStartedAndLocateHTTP

func EnsureStartedAndLocateHTTP(argText string) (addr string, err error)

func ExitCodeHandler

func ExitCodeHandler(cfg *config.Instance, resolver Resolver, analyticsReporter AnalyticsReporter) ipc.RequestHandler

func HTTPAddrHandler

func HTTPAddrHandler(addr string) ipc.RequestHandler

func HeartbeatHandler

func HeartbeatHandler(cfg *config.Instance, resolver Resolver, analyticsReporter AnalyticsReporter) ipc.RequestHandler

func LocateHTTP

func LocateHTTP(ipComm IPCommunicator) (addr string, err error)

func LogFileHandler

func LogFileHandler(logFile string) ipc.RequestHandler

func LogFileName

func LogFileName(ipComm IPCommunicator) (string, error)

func NewDefaultIPCClient

func NewDefaultIPCClient() *ipc.Client

func NewIPCSockPathFromGlobals

func NewIPCSockPathFromGlobals() *ipc.SockPath

func StopServer

func StopServer(ipComm IPCommunicator) error

Types

type AnalyticsReporter

type AnalyticsReporter interface {
	EventWithSource(category, action, source string, dims ...*dimensions.Values)
	EventWithSourceAndLabel(category, action, source, label string, dims ...*dimensions.Values)
}

type Comm

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

func NewComm

func NewComm(req Requester) *Comm

func (*Comm) GetHTTPAddr

func (c *Comm) GetHTTPAddr(ctx context.Context) (string, error)

func (*Comm) GetLogFileName

func (c *Comm) GetLogFileName(ctx context.Context) (string, error)

type IPCommunicator

type IPCommunicator interface {
	Requester
	PingServer(context.Context) (time.Duration, error)
	StopServer(context.Context) error
	SockPath() *ipc.SockPath
}

type Requester

type Requester interface {
	Request(ctx context.Context, key string) (value string, err error)
}

type Resolver

type Resolver interface {
	ReportRuntimeUsage(ctx context.Context, pid int, exec, source string, dimensionsJSON string) (*graph.ReportRuntimeUsageResponse, error)
}

Directories

Path Synopsis
Package svcmsg models the Exit Code data that the executor must communicate to the service.
Package svcmsg models the Exit Code data that the executor must communicate to the service.

Jump to

Keyboard shortcuts

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