Documentation ¶
Index ¶
- Constants
- Variables
- type Module
- func (m *Module[Key]) AttachTo(outputModule modules.Module, outputName, inputName string) error
- func (m *Module[Key]) Close() error
- func (m *Module[Key]) Input(name string) (*modules.Input, error)
- func (m *Module[Key]) MustInput(name string) *modules.Input
- func (m *Module[Key]) MustOutput(name string) *modules.Output
- func (*Module[Key]) Name() string
- func (m *Module[Key]) Output(name string) (*modules.Output, error)
- func (m *Module[Key]) Start(ctx context.Context)
- type Result
- type ZipFunction
- type Zippable
Constants ¶
View Source
const ( FirstInputName = "first" SecondInputName = "second" OutputName = "output" ModuleName = "zipper" )
predefined names
Variables ¶
View Source
var (
ErrNilZipFunc = errors.New("nil zip function")
)
errors
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module[Key comparable] struct { // contains filtered or unexported fields }
Module - zip module
func NewModuleWithFunc ¶
func NewModuleWithFunc[Key comparable](f ZipFunction[Key]) (*Module[Key], error)
NewModuleWithFunc - creates zip module with custom zip function
func (*Module[Key]) MustOutput ¶ added in v0.0.3
MustOutput - returns output by name
type Result ¶
type Result[Type comparable] struct { Key Type First any Second any }
Result - data structure is result of zip operation. It has two entity
type ZipFunction ¶
type ZipFunction[Type comparable] func(x Zippable[Type], y Zippable[Type]) *Result[Type]
ZipFunction - function to check can we zip two entity and if we can zip it. If function returns nil then it can't zip 2 entities
type Zippable ¶
type Zippable[Type comparable] interface { Key() Type }
Zippable - interface of data which can be zipped
Click to show internal directories.
Click to hide internal directories.