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 ¶
- func Run(kcfg *kafka.ConfigMap, opts ...Option) error
- type Option
- func ElementMaxAge(age time.Duration) Option
- func ExpirationCallback(handler storage.ExpiryHandler) Option
- func ExpiredElementHandler(hnd storage.ExpiryHandler) Option
- func ListenAddress(ip string) Option
- func MessageCounter(counter metrics.Counter) Option
- func StorageChannelBuffer(size int) Option
- func StorageWorkerCount(workers int) Option
- func WantAuth(auth service.AuthHandler, login service.LoginHandler) Option
- func WithLogger(log log.Logger) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*svr)
func ElementMaxAge ¶
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 ¶
ListenAddress is the IP address that the grpc server will listen on
func MessageCounter ¶
MessageCounter count incoming messages.
func StorageChannelBuffer ¶
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 ¶
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 ¶
WithLogger provide your own kit logger, by default logs will be written to stdout.