elasticsearch

package module
v0.0.0-...-71cf94c Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: MIT Imports: 6 Imported by: 0

README

Crappy Code, don't use it!

So I've finally decided to learn Go seriously. It's the first time I'm diving into a new language since 2002, and I'm not a developer so expect crappy code, usual conventions violations and "there's a much better way to do it".

My main problem is I can't just follow tutorials so I needed a project to code on, hence this repo. So now you know.

Usage

package main

import (
	"fmt"
	"github.com/fdv/crappy-go-elasticsearch-pkg"
)

func main() {
	cluster := elasticsearch.Init("http://localhost", 9000)

	fmt.Println(cluster.Geturi())
	fmt.Println(cluster.Getport())
	fmt.Println(cluster.Getsettings())
	fmt.Println(cluster.Getsetting("cluster.routing.allocation.enable"))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	URI  string
	Port uint16
	URL  string
}

Cluster defines an Elasticsearch cluster

func Init

func Init(uri string, port uint16) Cluster

Init initialises an Elasticsearch cluster

func (*Cluster) Getport

func (c *Cluster) Getport() uint16

Getport returns the cluster port

func (*Cluster) Getsetting

func (c *Cluster) Getsetting(setting string) string

Getsetting returns a defined setting

func (*Cluster) Getsettings

func (c *Cluster) Getsettings() string

Getsettings returns the cluster global settings

func (*Cluster) Geturi

func (c *Cluster) Geturi() string

Geturi returns the cluster URI

func (*Cluster) Geturl

func (c *Cluster) Geturl() string

Geturl returns the cluster URL

Jump to

Keyboard shortcuts

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