shim

package module
v0.0.0-...-f92bd77 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

README

MCollective Compatibility Shim Helper

For interacting with Ruby Agents, Compound discovery filters, Data Plugins and more the Golang Choria libraries relies on a helper script that interact over STDIN and STDOUT with the old Ruby infrastructure.

This library provides a helper to interact with that shim.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvokeAction

func InvokeAction(ctx context.Context, req *Request, reply interface{}, timeout int, shim string, shimcfg string) error

InvokeAction runs a action found within a ruby agent

func ParseCompoundFilter

func ParseCompoundFilter(ctx context.Context, filter string, shim string, shimcfg string) (string, error)

ParseCompoundFilter parses a compound filter and return the JSON representation of it

func ValidateCompoundCallStack

func ValidateCompoundCallStack(ctx context.Context, cs string, timeout int, shim string, shimcfg string) (bool, error)

ValidateCompoundCallStack validates a callstack like those produced by ParseCompoundFilter against the current node

func ValidateCompoundFilter

func ValidateCompoundFilter(ctx context.Context, filter string, timeout int, shim string, shimcfg string) (bool, error)

ValidateCompoundFilter validates a compound filter string against the current node

Types

type Request

type Request struct {
	Agent      string       `json:"agent"`
	Action     string       `json:"action"`
	RequestID  string       `json:"requestid"`
	SenderID   string       `json:"senderid"`
	CallerID   string       `json:"callerid"`
	Collective string       `json:"collective"`
	TTL        int          `json:"ttl"`
	Time       int64        `json:"msgtime"`
	Body       *RequestBody `json:"body"`
}

Request is the request being published to the shim runner

type RequestBody

type RequestBody struct {
	Agent  string          `json:"agent"`
	Action string          `json:"action"`
	Data   json.RawMessage `json:"data"`
	Caller string          `json:"caller"`
}

RequestBody is the body passed to the

type ValidateReply

type ValidateReply struct {
	Matched bool `json:"matched"`
}

ValidateReply is the reply when validating a compound filter

Jump to

Keyboard shortcuts

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