Documentation ¶
Index ¶
- func FilenameToReader(name string) (*bytes.Reader, error)
- func Find(slice []string, val string) (int, bool)
- func GetResponse(r esRequest, c *elastic7.Client) (*esapi.Response, error)
- func JSONToReader(intf interface{}) (*bytes.Reader, error)
- func ParseBytes(b []byte, fmtExists bool, outputFmt string) (err error)
- func RequestNew(r esRequest, c *elastic7.Client) ([]byte, error)
- func SetBool(s reflect.Value, field string, a bool) bool
- func SetFormat(s reflect.Value, outputFmt string) bool
- func SetInt(s reflect.Value, field string, a int64) bool
- func SetString(s reflect.Value, field string, a string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Find ¶
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 GetResponse ¶ added in v0.1.4
func JSONToReader ¶ added in v0.1.4
Take json. Return a reader
func ParseBytes ¶
TODO - remove this in the future if not needed
// Check if the 'Format' field exists for a struct beneath a provided interface
func FormatExists(i interface{}) bool { return reflect.ValueOf(i).FieldByName("Format").IsValid() }
Convert bytes into a desired output format
func RequestNew ¶
Generic function used to execute requests and return bytes
func SetBool ¶ added in v0.1.4
Attempt to change the value of an arbitrary boolean type field Return whether the field exists and could be set
func SetFormat ¶
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.