query

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInput

type BuildInput struct {
	Config  interface{}            `yaml:"config,omitempty"`
	Actions map[string]interface{} `yaml:"actions"`
}

type ManifestGenerator

type ManifestGenerator struct {
	Manifest *manifest.Manifest
}

ManifestGenerator generates mixin input from the manifest contents associated with each mixin.

func NewManifestGenerator

func NewManifestGenerator(m *manifest.Manifest) *ManifestGenerator

func (ManifestGenerator) BuildInput

func (g ManifestGenerator) BuildInput(mixinName string) ([]byte, error)

func (ManifestGenerator) ListMixins

func (g ManifestGenerator) ListMixins() []string

type MixinInputGenerator

type MixinInputGenerator interface {
	// ListMixins provides the list of mixin names to query over.
	ListMixins() []string

	// BuildInput generates the input to send to the specified mixin given its name.
	BuildInput(mixinName string) ([]byte, error)
}

MixinInputGenerator provides data about the mixins to the MixinQuery for it to execute upon.

type MixinQuery

type MixinQuery struct {
	*portercontext.Context

	// RequireMixinResponse indicates if every mixin must return a successful response.
	// Set to true for required mixin commands that need every mixin to respond to.
	// Set to false for optional mixin commands that every mixin may not have implemented.
	RequireAllMixinResponses bool

	// LogMixinStderr to the supplied contexts Stdout (Context.Out)
	LogMixinErrors bool

	Mixins pkgmgmt.PackageManager
}

MixinQuery allows us to send a command to a bunch of mixins and collect their response.

func New

New creates a new instance of a MixinQuery.

func (*MixinQuery) Execute

func (q *MixinQuery) Execute(cmd string, inputGenerator MixinInputGenerator) (map[string]string, error)

Execute the specified command using an input generator. For example, the ManifestGenerator will iterate over the mixins in a manifest and send them their config and the steps associated with their mixin.

Jump to

Keyboard shortcuts

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