Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Command interface into smaller interfaces #216

Closed
wesen opened this issue Mar 16, 2023 · 0 comments
Closed

Split Command interface into smaller interfaces #216

wesen opened this issue Mar 16, 2023 · 0 comments
Labels

Comments

@wesen
Copy link
Collaborator

wesen commented Mar 16, 2023

Command currently consists of the following methods:

type Command interface {
	Run(
		ctx context.Context,
		parsedLayers map[string]*layers.ParsedParameterLayer,
		ps map[string]interface{},
		gp Processor,
	) error
	Description() *CommandDescription
}

However, this tightly couples the Description() abstraction, which is very useful on its own, from the Run() execution type. It makes sense to split out these interfaces into:

  • RunIntoGlazeProcessor
  • RunIntoWriter (for plain byte / string output)
  • Run (for just executing)
  • RunIntoStruct[T] generic which can be useful for chaining

These could potentially be extended for HTML runners, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant