apiHandler

package
Version: v0.0.0-...-68c2de3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIHandlerFactory apiHandlerFactory

ApiHandlerFactory use for create api handlers

Functions

This section is empty.

Types

type ColumnsAPIHandler

type ColumnsAPIHandler struct {
	HandlerBase
}

ColumnsAPIHandler use to handle API request

func (*ColumnsAPIHandler) List

func (handler *ColumnsAPIHandler) List(request *http.Request, param map[string]string) (int, interface{})

Get logic of Column Handler

type ContentAPIHandler

type ContentAPIHandler struct {
	TableName string
	HandlerBase
}

ContentAPIHandler use to handle API request

func CreateContentHandler

func CreateContentHandler(tableName string) *ContentAPIHandler

CreateContentHandler create Content API handler with table name

func (*ContentAPIHandler) Create

func (handler *ContentAPIHandler) Create(request *http.Request, data map[string]string) (int, interface{})

Create create content

func (*ContentAPIHandler) Delete

func (handler *ContentAPIHandler) Delete(request *http.Request, key string) (int, interface{})

Delete content action

func (*ContentAPIHandler) Detail

func (handler *ContentAPIHandler) Detail(request *http.Request, keyValue string) (int, interface{})

func (*ContentAPIHandler) List

func (handler *ContentAPIHandler) List(request *http.Request, param map[string]string) (int, interface{})

Get logic of content

func (*ContentAPIHandler) Update

func (handler *ContentAPIHandler) Update(request *http.Request, keyValue string, data map[string]string) (int, interface{})

Create Update content

type HandlerBase

type HandlerBase interface {
	List(request *http.Request, param map[string]string) (int, interface{})
	Detail(request *http.Request, key string) (int, interface{})
	Create(request *http.Request, data map[string]string) (int, interface{})
	Update(request *http.Request, keyValue string, data map[string]string) (int, interface{})
	Delete(request *http.Request, key string) (int, interface{})
}

HandlerBase base class for all api handlers

type MenuAPIHandler struct {
	HandlerBase
}

MenuAPIHandler use to handle API request

func (handler *MenuAPIHandler) List(request *http.Request, param map[string]string) (int, interface{})

Get logic of Menu Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL