es

package
v0.0.0-...-6725017 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*elastic.Client
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(address, index, mappingPath string) *Client

NewClient creates an elastic search client and adds an index named fighters that will use the mapping variable to set the layout of its body if it doesn't already exist.

func (*Client) AddFighter

func (c *Client) AddFighter(f fight.Fighter) (err error)

AddFighter adds a fighter to the elasticsearch index c := es.NewClient(address, mappingPath, index) err := c.AddFighter(f)

func (*Client) GetFighters

func (c *Client) GetFighters() (fightersStruct fight.Fighters, err error)

GetFighters ... queries the fighters index to unmarshal and store every fighter from the elastic search index to an array. Then passes a struct containing the array to a function that will print out a battle message.

Jump to

Keyboard shortcuts

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