composer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composer

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

func New

func New() *Composer

NewComposer creates and returns a new instance of Composer. It initializes the Composer with an empty response map. It returns a pointer to the newly created Composer instance.

func (*Composer) Compose

func (c *Composer) Compose() (map[string]any, error)

Compose waits for all requests to finish and then returns the composed result. It does not take any parameters. It returns a map[string]any containing the composed result and an error if any occurred during composition. It returns an error if there was an issue during the composition process.

func (*Composer) Wait

func (c *Composer) Wait(ctx context.Context, parser handler.Parser, respChan <-chan []byte)

Wait listens for a response on the provided channel and processes it using the given parser. It takes a context (ctx) of type context.Context, a parser of type handler.Parser, and a response channel (respChan) of type <-chan []byte. It does not return any values but may set an error on the Composer if the context is done or if parsing the response fails.

Jump to

Keyboard shortcuts

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