server

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(ctx context.Context, rsService store.RulesetService, cfg Config) http.Handler

NewHandler creates an http handler to serve the rules engine API.

Types

type Config

type Config struct {
	Logger       *zerolog.Logger
	Timeout      time.Duration
	WatchTimeout time.Duration
}

Config contains the API configuration.

type Server

type Server struct {
	Mux *http.ServeMux // Can be used to add handlers to the server.
	// contains filtered or unexported fields
}

Server is an HTTP server serving the Regula API.

func New

func New(service store.RulesetService, cfg Config) *Server

New creates a Server instance.

func (*Server) Run

func (s *Server) Run(ctx context.Context, addr string) error

Run runs the server on the chosen address. The given context must be used to gracefully stop the server.

Jump to

Keyboard shortcuts

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