oneweb

package module
v0.0.0-...-aa0fdce Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2017 License: MIT Imports: 10 Imported by: 0

README

oneweb

Build Status Coverage Status

A Go HTTP middleware that provides MVC-like routing, direct database query to JSON, and automated query testing

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoFuzzTestController

func AutoFuzzTestController(t TestRunner, controller interface{})

Types

type ControllerRequest

type ControllerRequest struct {
	ControllerName string
	ItemID         string
	Action         string
	ActionFilter   string
	User           *User
	Headers        map[string]string
}

type ControllerRoutingHandler

type ControllerRoutingHandler struct {
	Controllers map[string]interface{}
	// contains filtered or unexported fields
}

func NewControllerRoutingHandler

func NewControllerRoutingHandler() *ControllerRoutingHandler

func (*ControllerRoutingHandler) Handler

func (c *ControllerRoutingHandler) Handler() http.Handler

func (*ControllerRoutingHandler) RegisterController

func (c *ControllerRoutingHandler) RegisterController(name string, controller interface{}) error

type MethodTestResult

type MethodTestResult struct {
	MethodName               string
	ValidationError          error
	HasInvalidSQLQueryParams bool
	ReturnData               []interface{}
}

func FuzzTestController

func FuzzTestController(controller interface{}) []MethodTestResult

type TestRunner

type TestRunner interface {
	Error(args ...interface{})
	Logf(format string, args ...interface{})
}

type User

type User struct {
	UserID   int
	Email    string
	FullName string
	JSON     string
}

Jump to

Keyboard shortcuts

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