server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2016 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {

	// Wagpatch makes a PATCH request to /wagpatch.
	// Special wag patch type
	Wagpatch(ctx context.Context, i *models.PatchData) (*models.Data, error)

	// Wagpatch2 makes a PATCH request to /wagpatch2.
	// Wag patch with another argument
	Wagpatch2(ctx context.Context, i *models.Wagpatch2Input) (*models.Data, error)
}

Controller defines the interface for the wag-patch service.

type MockController

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

Mock of Controller interface

func NewMockController

func NewMockController(ctrl *gomock.Controller) *MockController

func (*MockController) EXPECT

func (_m *MockController) EXPECT() *_MockControllerRecorder

func (*MockController) Wagpatch

func (_m *MockController) Wagpatch(ctx context.Context, i *models.PatchData) (*models.Data, error)

func (*MockController) Wagpatch2

func (_m *MockController) Wagpatch2(ctx context.Context, i *models.Wagpatch2Input) (*models.Data, error)

type Server

type Server struct {
	// Handler should generally not be changed. It exposed to make testing easier.
	Handler http.Handler
	// contains filtered or unexported fields
}

Server defines a HTTP server that implements the Controller interface.

func New

func New(c Controller, addr string) *Server

New returns a Server that implements the Controller interface. It will start when "Serve" is called.

func (*Server) Serve

func (s *Server) Serve() error

Serve starts the server. It will return if an error occurs.

Jump to

Keyboard shortcuts

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