cmd

package
v0.0.0-...-1aaf8f9 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMappingVersions

func NewMappingVersions(fileDir string) (map[string]*MappingVersion, error)

Types

type Config

type Config struct {
	ElasticConnection struct {
		Host string `yaml:"host"`
		Port string `yaml:"port"`
	} `yaml:"es_connection"`
	ElasticIndices []struct {
		Name     string             `yaml:"name"`
		Searches []SearchDefinition `yaml:"searches"`
	} `yaml:"es_indices"`
}

Config is a representation of the main configuration file.

func NewConfig

func NewConfig(filename string) (*Config, error)

NewConfig loads the configuration structure from a file.

func (*Config) ElasticURL

func (c *Config) ElasticURL() string

ElasticURL returns the HTTP URL used to connect to the ES cluster.

func (*Config) SearchDefinitionByMapping

func (c *Config) SearchDefinitionByMapping(mappingName string) (*SearchDefinition, error)

func (*Config) SearchDefinitionByName

func (c *Config) SearchDefinitionByName(name string) (*SearchDefinition, error)

type MappingVersion

type MappingVersion struct {
	Filename string
	Contents []byte
}

func LatestMappingVersion

func LatestMappingVersion(fileDir, baseName string) (*MappingVersion, error)

func NewMappingVersion

func NewMappingVersion(fileDir, filename string) (*MappingVersion, error)

func (*MappingVersion) ElasticMapping

func (m *MappingVersion) ElasticMapping() string

type PutFn

type PutFn func(index string, isScoped bool, mappingName string, mappingContents []byte) error

type Runner

type Runner struct {
	OptionAll     bool
	OptionIndex   string
	OptionMapping string
	OptionSearch  string
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner() *Runner

func (*Runner) Create

func (r *Runner) Create(c *cli.Context) error

func (*Runner) CreateAll

func (r *Runner) CreateAll() error

func (*Runner) CreateOne

func (r *Runner) CreateOne(search string) error

func (*Runner) Pull

func (r *Runner) Pull(c *cli.Context) error

func (*Runner) PullAll

func (r *Runner) PullAll() error

func (*Runner) PullForIndex

func (r *Runner) PullForIndex(index string) error

func (*Runner) PullMapping

func (r *Runner) PullMapping(mappingName string) error

func (*Runner) Update

func (r *Runner) Update(c *cli.Context) error

func (*Runner) UpdateAll

func (r *Runner) UpdateAll() error

func (*Runner) UpdateOne

func (r *Runner) UpdateOne(search string) error

type SearchDefinition

type SearchDefinition struct {
	Name    string `yaml:"name"`
	Index   string `yaml:"-"`
	Scoped  bool   `yaml:"scoped"`
	Mapping string `yaml:"mapping"`
}

Jump to

Keyboard shortcuts

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