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 ¶
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 ¶
func New(cxt *portercontext.Context, mixins pkgmgmt.PackageManager) *MixinQuery
New creates a new instance of a MixinQuery.
func (*MixinQuery) Execute ¶
func (q *MixinQuery) Execute(ctx context.Context, 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.
Click to show internal directories.
Click to hide internal directories.