spirrel

command module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: Unlicense Imports: 17 Imported by: 0

README

spirrel

A Golang REST API server that fetches random articles from Wikipedia and indexes them in an Elasticsearch instance, randomizing some data in the process. Use it to generate legitimate data in Elasticsearch and play around with Kibana.

Dev setup

Clone the repository, build the CLI, start an Elasticsearch instance with Docker, run the CLI:

$ git clone git@github.com:/chazapp/spirrel
$ go build -o spirrel
$ ./spirrel
NAME:
   spirrel - CLI for generating and storing articles in Elasticsearch

USAGE:
   spirrel [global options] command [command options]

COMMANDS:
   run      Run the API server
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help

## Refer to Elasticsearch guide to start a local instance in Docker

$ ./spirrel run -s http://localhost:9200 -k $ELASTICSEARCH_API_KEY

Once started, the HTTP API exposes 2 routes:

$ curl -X POST http://localhost:8080/createIndex # Creates the `articles` ES index 
$ curl -X POST http://localhost:8080/generate?count=5 # Generates $count articles from random Wikipedia entries and stores them in ES

Production deployment

A Docker container is built by this project's Github Action pipeline. An Helm Chart is also available for deployment on Kubernetes clusters

// TBD: Documentation for Elastic Operator + Create ES users + Accessing Kibana

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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