join

package
v0.0.0-...-e3f2fdf Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package join contains the implementation of the join plugin, which generates the deriveJoin function.

The deriveJoin function joins a slice of slices into a single slice.

deriveJoin([][]T) []T
deriveJoin([]string) string

The deriveJoin function also joins two tuples, both with errors, into a single tuple with a single error.

deriveJoin(func() (T, error), error) func() (T, error)
deriveJoin(func() error, error) func() error
deriveJoin(func() (T, ..., error), error) func() (T, ..., error)

The deriveJoin function can also join channels

deriveJoin(<-chan <-chan T) <-chan T
deriveJoin(chan <-chan T) <-chan T
deriveJoin([]<-chan T) <-chan T
deriveJoin([]chan T) <-chan T

deriveJoin immediately return the output channel and start up a go routine to process the main incoming channel. It will then start up a go routine to listen on every new incoming channel and send those events to the outgoing channel.

deriveJoin(chan T, chan T, ...) <-chan T

deriveJoin with a variable number of channels as parameter will do a select over those channels, until all are closed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New is a constructor for the join code generator. This generator should be reconstructed for each package.

func NewPlugin

func NewPlugin() derive.Plugin

NewPlugin creates a new join plugin. This function returns the plugin name, default prefix and a constructor for the join code generator.

Types

This section is empty.

Jump to

Keyboard shortcuts

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