network

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package network implements a Transport that works over a socket.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	util.BaseConfig
	Name       xml.Name `xml:"config"`
	Address    string   `xml:"address"`
	StartLocal bool     `xml:"start_local"`
	IsUnix     bool     `xml:"is_unix,attr"`
	TLS        bool     `xml:"tls,attr"`
}

Config is a config for a networkTransport

type Transport

type Transport struct {
	*Config
	// contains filtered or unexported fields
}

Transport is an implementation of the transport interface that is designed to be used over the network

func New

func New(conf tomlconf.ConfigHolder, logger *log.Logger) (*Transport, error)

New creates a new network Transport

func (*Transport) GetHumanStatus

func (t *Transport) GetHumanStatus() string

GetHumanStatus returns the status of the transport that is human readable

func (*Transport) GetStatus

func (t *Transport) GetStatus() util.TransportStatus

GetStatus returns the current state of the transport

func (*Transport) IsRunning

func (t *Transport) IsRunning() bool

IsRunning returns whether or not the underlying process is currently running. For more information use GetStatus.

func (*Transport) Run

func (t *Transport) Run(start chan struct{}) (retcode int, ret string, _ error)

Run runs the underlying process on the Transport. It returns the return code of the process (or -1 if start failed) a string representation of the exit, if applicable, and an error. error should be checked first as the string may not be filled for some errors.

func (*Transport) Stderr

func (t *Transport) Stderr() <-chan []byte

Stderr returns a channel that will have lines from stdout sent over it. multiple calls are not supported.

func (*Transport) Stdout

func (t *Transport) Stdout() <-chan []byte

Stdout returns a channel that will have lines from stdout sent over it. multiple calls are not supported.

func (*Transport) StopOrKill

func (t *Transport) StopOrKill() error

StopOrKill implements StopOrKiller

func (*Transport) StopOrKillTimeout

func (t *Transport) StopOrKillTimeout(duration time.Duration) error

StopOrKillTimeout implements StopOrKiller

func (*Transport) StopOrKillWaitgroup

func (t *Transport) StopOrKillWaitgroup(group *sync.WaitGroup)

StopOrKillWaitgroup implements StopOrKiller

func (*Transport) Update

func (t *Transport) Update(confHolder tomlconf.ConfigHolder) error

Update updates the Transport with a TransportConfig

func (*Transport) Write

func (t *Transport) Write(p []byte) (n int, err error)

func (*Transport) WriteString

func (t *Transport) WriteString(s string) (n int, err error)

WriteString implements Transport

Directories

Path Synopsis
Prog is the clientside component of networkTransport.
Prog is the clientside component of networkTransport.
Package protocol holds structs and other constructs that are used by the network transport for cross-network RPC calls
Package protocol holds structs and other constructs that are used by the network transport for cross-network RPC calls

Jump to

Keyboard shortcuts

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