v0.3.2 Latest Latest

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 11 Imported by: 0




This section is empty.


This section is empty.


func ProcessedFileHandler

func ProcessedFileHandler(acknowledger chan transmit.Serializable, fragCollector garbage.FragmentCollector) func(socket Socket, conn net.Conn)

ProcessedFileHandler is a handler for a socket that receives processed files from the transformation step

func SendFileHandler

func SendFileHandler(fragCollector garbage.FragmentCollector) func(socket Socket, conn net.Conn)

SendFileHandler is a handler function for a socket that sends files to the transformation step


type ConnHandler

type ConnHandler func(Socket, net.Conn)

ConnHandler is a handler function ran in a goroutine upon a socket accepting a new connection

type Pipe

type Pipe struct {
	SocketFrom Socket
	SocketTo   Socket
	FromTarget chan transmit.Serializable
	ToTarget   chan transmit.Serializable

Pipe represents a bidirectional connection between an iterum sidecar and transformation step ToTarget and FromTarget refer to the channels in the two sockets Messages supposed to go towards Target can be put on ToTarget and message from the Target are put on FromTarget

func NewPipe

func NewPipe(fromFile, toFile string, fromChannel, toChannel chan transmit.Serializable, fromHandler, toHandler ConnHandler) Pipe

NewPipe creates and initiates a new Pipe

func (Pipe) Start

func (p Pipe) Start(wg *sync.WaitGroup)

Start calls start on both of the pipe's sockets

type Socket

type Socket struct {
	Listener net.Listener
	Channel  chan transmit.Serializable
	// contains filtered or unexported fields

Socket is a structure holding a listener, accepting connections Channel is a channel that external things can post messages on take from that are supposed to be sent to or from the connections

func NewSocket

func NewSocket(socketPath string, channel chan transmit.Serializable, handler ConnHandler) (socket Socket, err error)

NewSocket sets up a listener at the given socketPath and links the passed channel with the given bufferSize. It returns an error on failure

func (Socket) Start

func (socket Socket) Start(wg *sync.WaitGroup)

Start asychronously calls StartBlocking via Gorouting

func (Socket) StartBlocking

func (socket Socket) StartBlocking()

StartBlocking enters an endless loop accepting connections and calling the handler function in a goroutine

func (*Socket) Stop added in v0.1.3

func (socket *Socket) Stop() error

Stop tries to close the listener of the socket and returns an error on failure

Jump to

Keyboard shortcuts

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