server

package
v0.0.0-...-070f372 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package server contains the time series database functionality so that it can easily be included in other processes. For example, gots gets it's configuration settings from environment variables. If you wanted to get your configuration settings from some other source such as Consul or the command line, you could include this package and create your own process to host it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(kcfg *kafka.ConfigMap, opts ...Option) error

Run starts processing time series messages and exposes them via grpc endpoint. Run is a blocking call.

Types

type Option

type Option func(*svr)

func ElementMaxAge

func ElementMaxAge(age time.Duration) Option

ElementMaxAge set the age at which time series elements will be discarded

func ExpirationCallback

func ExpirationCallback(handler storage.ExpiryHandler) Option

ExpirationCallback provide a function to handle time series elements when they have reached their expiration date

func ExpiredElementHandler

func ExpiredElementHandler(hnd storage.ExpiryHandler) Option

ExpiredElementHandler function to handle expired time series elements.

func ListenAddress

func ListenAddress(ip string) Option

ListenAddress is the IP address that the grpc server will listen on

func MessageCounter

func MessageCounter(counter metrics.Counter) Option

MessageCounter count incoming messages.

func StorageChannelBuffer

func StorageChannelBuffer(size int) Option

StorageChannelBuffer is the number of elements that can be backed up in a channel that feeds a storage worker. This can help throughput by asynchronously processing incoming Kafka messages.

func StorageWorkerCount

func StorageWorkerCount(workers int) Option

StorageWorkerCount set the number of goroutines that will process incoming time series elements

func WantAuth

func WantAuth(auth service.AuthHandler, login service.LoginHandler) Option

WantAuth enables authentication for the server. A login handler takes a user name and password and if authorized returns a token that will be passed to the server in subsequent requests from the client. The auth handler receives this token and uses it to authorize requests. Typically the this would be a JWT token.

func WithLogger

func WithLogger(log log.Logger) Option

WithLogger provide your own kit logger, by default logs will be written to stdout.

Jump to

Keyboard shortcuts

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