run

package
v0.29.14 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// CleanupDataDir controls whether the data directory is deleted on Stop().
	// Defaults to true. Set to false to preserve the data directory.
	CleanupDataDir *bool

	// StdoutWriter is an optional writer to receive stdout logs.
	// If nil, stdout will be captured to a buffer accessible via Relay.Stdout().
	StdoutWriter io.Writer

	// StderrWriter is an optional writer to receive stderr logs.
	// If nil, stderr will be captured to a buffer accessible via Relay.Stderr().
	StderrWriter io.Writer
}

Options configures relay startup behavior.

type Relay

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

Relay represents a running relay instance that can be started and stopped.

func Start

func Start(cfg *config.C, opts *Options) (relay *Relay, err error)

Start initializes and starts a relay with the given configuration. It bypasses the configuration loading step and uses the provided config directly.

Parameters:

  • cfg: The configuration to use for the relay
  • opts: Optional configuration for relay behavior. If nil, defaults are used.

Returns:

  • relay: A Relay instance that can be used to stop the relay
  • err: An error if initialization or startup fails

func (*Relay) Stderr

func (r *Relay) Stderr() string

Stderr returns the complete stderr log buffer contents.

func (*Relay) StderrBytes

func (r *Relay) StderrBytes() []byte

StderrBytes returns the complete stderr log buffer as bytes.

func (*Relay) Stdout

func (r *Relay) Stdout() string

Stdout returns the complete stdout log buffer contents.

func (*Relay) StdoutBytes

func (r *Relay) StdoutBytes() []byte

StdoutBytes returns the complete stdout log buffer as bytes.

func (*Relay) Stop

func (r *Relay) Stop() (err error)

Stop gracefully stops the relay by canceling the context and closing the database. If CleanupDataDir is enabled (default), it also removes the data directory.

Returns:

  • err: An error if shutdown fails

Source Files

  • run.go

Jump to

Keyboard shortcuts

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