uroncha

package module
v0.0.0-...-12d50db Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 22 Imported by: 0

README

Uroncha

Uroncha is simple API framework

IMPORTANT Still in development

I want to change gin to raw net/http package

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *logrus.Logger
View Source
var NoError = Error{
	Success: true,
	Code:    0,
	Message: "",
}

Functions

func Handle

func Handle(method, url string, validRules Rules, handler HandleFunc)

func IsDebug

func IsDebug() bool

func Run

func Run() error

Types

type Context

type Context struct {
	Req         *http.Request
	Res         http.ResponseWriter
	QueryString map[string]string
	PathParam   map[string]string
	Body        *simplejson.Json
}

func (*Context) SaveFile

func (c *Context) SaveFile(fieldName, savePath string) error

type DownloadFile

type DownloadFile struct {
	FilePath    string
	ContentType string
	FileName    string
}

type Error

type Error struct {
	Success bool   `json:"success"`
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func NewError

func NewError(err error) Error

type H

type H map[string]interface{}

type HandleFunc

type HandleFunc func(*Context) (interface{}, Error)

type Rule

type Rule = caasiu.Rule

type Rules

type Rules = caasiu.Rules

type Uroncha

type Uroncha struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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