Version: v5.10.1+incompatible Latest Latest

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT, + 1 more Imports: 14 Imported by: 0




This section is empty.


This section is empty.


func CreateCommand

func CreateCommand(cli *cli.SensuCli) *cobra.Command

CreateCommand creates generic Sensu resources.

func HelpCommand

func HelpCommand(cli *cli.SensuCli) *cobra.Command

HelpCommand defines new parent

func ParseResources

func ParseResources(in io.Reader) ([]types.Wrapper, error)

ParseResources is a rather heroic function that will parse any number of valid JSON or YAML resources. Since it attempts to be intelligent, it likely contains bugs.

The general approach is: 1. detect if the stream is JSON by sniffing the first non-whitespace byte. 2. If the stream is JSON, goto 4. 3. If the stream is YAML, split it on '---' to support multiple yaml documents. 3. Convert the YAML to JSON document-by-document. 4. Unmarshal the JSON one resource at a time.

func PutResources

func PutResources(client client.GenericClient, resources []types.Wrapper) error

PutResources uses the GenericClient to PUT a resource at the inferred URI path.

func ValidateResources

func ValidateResources(resources []types.Wrapper, namespace string) error

ValidateResources loops through a list of resources, appends a namespace if one is not already declared, and validates the resource.


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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