gateway

package
v0.0.0-...-5e45501 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaketHTTPHandler

func MaketHTTPHandler(ctx context.Context, urls []URL, s Service, logger *logrus.Logger) http.Handler

MaketHTTPHandler creates handlers for Router

Types

type Middleware

type Middleware func(Service) Service

Middleware describes a service middleware

func LoggingMiddleware

func LoggingMiddleware(logger *logrus.Logger) Middleware

LoggingMiddleware create a new logging middleware

type Service

type Service interface {
	Send(ctx context.Context, vars map[string]string, data []byte, topic string) error
}

Service is a simple interface for sending driver locations

func NewService

func NewService(e *bus.Emitter, c *http.Client) Service

NewService factory method

type URL

type URL struct {
	Path   string `config:"path,required"`
	Method string `config:"method,required"`

	NSQ struct {
		Topic string `config:"topic"`
	}

	HTTP struct {
		Host string `config:"host"`
		Port string `config:"port"`
	}
}

URL item in config YAML

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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