envelope

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Child

type Child interface {
	// Start starts the child
	Start(context.Context, *protos.AppConfig, *protos.AkasaletArgs) error

	// Wait for the child to exit
	Wait() error

	// Stdout Different IO streams connection us to the child
	Stdout() io.ReadCloser
	Stderr() io.ReadCloser

	// Pid Identifier for child process, if available.
	Pid() (int, bool)
}

Child manages the child of an envelope. This is typically a child process, but tests may manage some in-process resources.

type Envelope

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

func NewEnvelope

func NewEnvelope(ctx context.Context, aletArgs *protos.AkasaletArgs, config *protos.AppConfig, options Options) (*Envelope, error)

func (*Envelope) AkasaletAddress

func (e *Envelope) AkasaletAddress() string

func (*Envelope) GetHealth

func (e *Envelope) GetHealth(ctx context.Context) protos.HealthStatus

func (*Envelope) Pid

func (e *Envelope) Pid() (int, bool)

func (*Envelope) Serve

func (e *Envelope) Serve(h Handler) error

func (*Envelope) UpdateComponents

func (e *Envelope) UpdateComponents(components []string) error

func (*Envelope) UpdateRoutingInfo

func (e *Envelope) UpdateRoutingInfo(ctx context.Context, routing *protos.RoutingInfo) error

type Handler

type Handler interface {
	ActivateComponent(ctx context.Context, req *protos.ActivateComponentRequest) (*protos.ActivateComponentReply, error)
	LogBatch(ctx context.Context, batch *protos.LogEntryBatch) error
}

type Options

type Options struct {
	TempDir string
	Logger  *slog.Logger
	Tracer  trace.Tracer
	Child   Child
}

type ProcessChild

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

func (*ProcessChild) Pid

func (p *ProcessChild) Pid() (int, bool)

func (*ProcessChild) Start

func (p *ProcessChild) Start(ctx context.Context, config *protos.AppConfig, args *protos.AkasaletArgs) error

func (*ProcessChild) Stderr

func (p *ProcessChild) Stderr() io.ReadCloser

func (*ProcessChild) Stdout

func (p *ProcessChild) Stdout() io.ReadCloser

func (*ProcessChild) Wait

func (p *ProcessChild) Wait() error

Jump to

Keyboard shortcuts

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