remote

package
v0.0.0-...-8fec888 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RemoteHTTP = "http"
	RemoteRPC  = "rpc"
)
View Source
const (
	ParameterAddr = "addr"
)

Variables

View Source
var (
	ErrInvalidAddress = errors.New("parameter '" + ParameterAddr + "' is invalid")
)
View Source
var (
	ErrInvalidRemote = errors.New("invalid remote")
)

Functions

This section is empty.

Types

type ErrInvalidStatus

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

func (ErrInvalidStatus) Error

func (e ErrInvalidStatus) Error() string

type HTTPConfig

type HTTPConfig struct {
	Addr string `json:"addr"`
}

func GetHTTPConfig

func GetHTTPConfig(conf *config.Config) (HTTPConfig, error)

func (HTTPConfig) Validate

func (c HTTPConfig) Validate() error

type HTTPConnection

type HTTPConnection struct {
	HTTPConfig
	// contains filtered or unexported fields
}

func NewHTTPConnection

func NewHTTPConnection(config HTTPConfig) HTTPConnection

func (HTTPConnection) Close

func (c HTTPConnection) Close() error

func (HTTPConnection) Connect

func (c HTTPConnection) Connect() error

func (HTTPConnection) HandleEntry

func (c HTTPConnection) HandleEntry(e entry.Entry, options map[string]string) error

func (HTTPConnection) Start

func (c HTTPConnection) Start() error

type RPCArg

type RPCArg struct {
	Entry []byte
	Kind  int
}

type RPCConfig

type RPCConfig struct {
	Addr string `json:"addr"`
}

func GetRPCConfig

func GetRPCConfig(conf *config.Config) (RPCConfig, error)

func (RPCConfig) Validate

func (c RPCConfig) Validate() error

type RPCConnection

type RPCConnection struct {
	RPCConfig
}

func NewRPCConnection

func NewRPCConnection(config RPCConfig) (*RPCConnection, error)

func (RPCConnection) Close

func (c RPCConnection) Close() error

func (RPCConnection) Connect

func (c RPCConnection) Connect() error

func (RPCConnection) HandleEntry

func (c RPCConnection) HandleEntry(e entry.Entry, options map[string]string) (err error)

func (*RPCConnection) Start

func (c *RPCConnection) Start() error

type RPCServer

type RPCServer struct {
	RPCConfig
	// contains filtered or unexported fields
}

func (RPCServer) CloseServer

func (s RPCServer) CloseServer(args *RPCArg, reply *struct{}) error

func (RPCServer) HandleEntry

func (s RPCServer) HandleEntry(args *RPCArg, reply *struct{}) error

func (RPCServer) Ping

func (s RPCServer) Ping(args *RPCArg, reply *struct{}) error

func (RPCServer) StartServer

func (s RPCServer) StartServer() error

type Remote

type Remote interface {
	// start the remote service, this can block until the service is done
	Start() error
	// This method shuts the remote service down
	Close() error
	// connect to the remote service (make sure it is running)
	Connect() error
	// handle an entry: forward it to the remote service
	HandleEntry(entry entry.Entry, options map[string]string) error
}

A Remote provide an EntryHandler

func GetRemote

func GetRemote(config *config.Config) (remote Remote, err error)

func GetRemoteAndConnect

func GetRemoteAndConnect(config *config.Config, check bool) (remote Remote, err error)

Jump to

Keyboard shortcuts

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