api

package
v0.0.4-0...-d7aeda2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Http API server intended to serve Gravity log queries, internally the incoming queries are transformed to LQL (Logrange Query Language) and executed against Logrange database.

func NewServer

func NewServer(listenAddr string, lrClient api.Client, lrPartition string) *Server

NewServer creates api server for the given params, it has Serve() and Shutdown() lifecycle methods it's caller's responsibility to call them appropriately

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Starts serving requests on the configured port, blocking, returns error if underlying http.Server.Listen() returns err != http.ErrServerClosed

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server. It blocks until the server has shut down or context has expired.

Jump to

Keyboard shortcuts

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