Documentation ¶
Index ¶
Constants ¶
const ( // ResponseProtocol is the protocol responses from the external script should have ResponseProtocol = "io.choria.choria.discovery.v1.external_reply" // RequestProtocol is a protocol set in the request that the external script can validate RequestProtocol = "io.choria.choria.discovery.v1.external_request" // RequestSchema is the location to a JSON Schema for requests RequestSchema = "https://choria.io/schemas/choria/discovery/v1/external_request.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscoverOption ¶
type DiscoverOption func(o *dOpts)
DiscoverOption configures the broadcast discovery method
func Collective ¶
func Collective(c string) DiscoverOption
Collective sets the collective to discover in, else main collective is used
func Command ¶
func Command(c string) DiscoverOption
func DiscoveryOptions ¶
func DiscoveryOptions(opt map[string]string) DiscoverOption
DiscoveryOptions sets the key value pairs that make user supplied discovery options.
Supported options:
command - The command to execute instead of configured default
All options will be passed to the external command in the request, so other command specific options is supported and will be ignored by this code
func Filter ¶
func Filter(f *protocol.Filter) DiscoverOption
Filter sets the filter to use for the discovery, else a blank one is used
func Timeout ¶
func Timeout(t time.Duration) DiscoverOption
Timeout sets the discovery timeout, else the configured default is used
type External ¶
type External struct {
// contains filtered or unexported fields
}
External implements discovery via externally executed binaries
func New ¶
func New(fw client.ChoriaFramework) *External
type Request ¶
type Request struct { Protocol string `json:"protocol"` Collective string `json:"collective"` Filter *protocol.Filter `json:"filter"` Options map[string]string `json:"options"` Schema string `json:"$schema"` Timeout float64 `json:"timeout"` }
Request is the request sent to the external script on its STDIN