kvstore

package module
v0.0.0-...-f206412 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: MIT Imports: 5 Imported by: 0

README

K/V store

Is a very simple open API based rest API to provide a key value store

Generation

To generate the code required this application makes use of:

Install with:

go get -u github.com/go-swagger/go-swagger/cmd/swagger
go get -u github.com/tinylib/msgp

All the generation happens based on go generate and is configured in $project_root/doc.go.

This application chooses to configure itself differently than the default generated code because it's more convenient and allows for a nicer structure. The configuration happens in $project_root/cmd/kvstored.

Install

You can install this application with the regular go means.

go get github.com/go-openapi/kvstore/cmd/...

Running

$ ./kvstored --help
Usage:
  kvstored [OPTIONS]

K/V store is a simple single node store for retrieving key/value information

Application Options:
      --scheme=            the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec
      --cleanup-timeout=   grace period for which to wait before shutting down the server (default: 10s)
      --max-header-size=   controls the maximum number of bytes the server will read parsing the request header's keys and values, including
                           the request line. It does not limit the size of the request body. (default: 1MiB)
      --socket-path=       the unix socket to listen on (default: /var/run/kvstore.sock)
      --host=              the IP to listen on (default: localhost) [$HOST]
      --port=              the port to listen on for insecure connections, defaults to a random value [$PORT]
      --listen-limit=      limit the number of outstanding requests
      --keep-alive=        sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop
                           mid-download) (default: 3m)
      --read-timeout=      maximum duration before timing out read of the request (default: 30s)
      --write-timeout=     maximum duration before timing out write of the response (default: 60s)
      --tls-host=          the IP to listen on for tls, when not specified it's the same as --host [$TLS_HOST]
      --tls-port=          the port to listen on for secure connections, defaults to a random value [$TLS_PORT]
      --tls-certificate=   the certificate to use for secure connections [$TLS_CERTIFICATE]
      --tls-key=           the private key to use for secure conections [$TLS_PRIVATE_KEY]
      --tls-listen-limit=  limit the number of outstanding requests
      --tls-keep-alive=    sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop
                           mid-download)
      --tls-read-timeout=  maximum duration before timing out read of the request
      --tls-write-timeout= maximum duration before timing out write of the response

Help Options:
  -h, --help               Show this help message

Documentation

Overview

Package kvstore represents a key/value database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime encapsulates the shared services for this application

func NewRuntime

func NewRuntime(app app.Application) (*Runtime, error)

NewRuntime creates a new application level runtime that encapsulates the shared services for this application

func (*Runtime) Config

func (r *Runtime) Config() *viper.Viper

Config returns the viper config for this application

func (*Runtime) DB

func (r *Runtime) DB() persist.Store

DB returns the persistent store

func (*Runtime) Logger

func (r *Runtime) Logger() logrus.FieldLogger

Logger gets the root logger for this application

func (*Runtime) NewLogger

func (r *Runtime) NewLogger(name string, fields logrus.Fields) logrus.FieldLogger

NewLogger creates a new named logger for this application

func (*Runtime) Tracer

func (r *Runtime) Tracer() tracing.Tracer

Tracer returns the root tracer, this is typically the only one you need

Directories

Path Synopsis
api
cmd
gen
restapi
Package restapi K/V store K/V store is a simple single node store for retrieving key/value information Schemes: http Host: localhost BasePath: / Version: 0.0.1 License: MIT https://github.com/go-openapi/kvstore/blob/master/LICENSE Contact: Ivan Porto Carrero<ivan@flanders.co.nz> Consumes: - application/json - application/octet-stream Produces: - application/json - application/octet-stream swagger:meta
Package restapi K/V store K/V store is a simple single node store for retrieving key/value information Schemes: http Host: localhost BasePath: / Version: 0.0.1 License: MIT https://github.com/go-openapi/kvstore/blob/master/LICENSE Contact: Ivan Porto Carrero<ivan@flanders.co.nz> Consumes: - application/json - application/octet-stream Produces: - application/json - application/octet-stream swagger:meta

Jump to

Keyboard shortcuts

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