Documentation ¶
Index ¶
- func CreateCommand(cli *cli.SensuCli) *cobra.Command
- func HelpCommand(cli *cli.SensuCli) *cobra.Command
- func ParseResources(in io.Reader) ([]types.Wrapper, error)
- func PutResources(client client.GenericClient, resources []types.Wrapper) error
- func ValidateResources(resources []types.Wrapper, namespace string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCommand ¶
CreateCommand creates generic Sensu resources.
func HelpCommand ¶
HelpCommand defines new parent
func ParseResources ¶
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.
Types ¶
This section is empty.