esutil

package
v0.0.0-...-906fdf7 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Des

func Des(esRes *esapi.Response) (r map[string]interface{}, err error)

Deserialize a response into a generic interface

func Find

func Find(slice []string, val string) (int, bool)

https://golangcode.com/check-if-element-exists-in-slice/ Find takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false.

func FormatExists

func FormatExists(i interface{}) bool

Check if the 'Format' field exists for a struct beneath a provided interface

func MapToYamlBytes

func MapToYamlBytes(r map[string]interface{}) (b []byte, err error)

Convert a generic interface of type map[string]interface{} to yaml bytes

func MapToYamlish

func MapToYamlish(r map[string]interface{}, s int)

Display a generic interface as yaml

func ParseBytes

func ParseBytes(b []byte, fmtExists bool, outputFmt string) (err error)

Convert bytes into a desired output format

func Request

func Request(r esRequest, c *elastic7.Client) error

Generic function used to execute requests and print results

func RequestNew

func RequestNew(r esRequest, c *elastic7.Client) ([]byte, error)

Generic function used to execute requests and return bytes

func SetFormat

func SetFormat(s reflect.Value, outputFmt string) bool

Attempt to change the 'Format' field of a struct if it exists. Return whether the field exists and could be set

Types

This section is empty.

Jump to

Keyboard shortcuts

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