api

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Log smLog
	// contains filtered or unexported fields
}

func (*Context) BindPars

func (slf *Context) BindPars(destination interface{}) error

func (*Context) GetRequestBody

func (slf *Context) GetRequestBody() (string, error)
 ============================================
	Created by andy pangaribuan on 2021/05/18
	Copyright andypangaribuan. All rights reserved.
   ============================================

func (*Context) GetRequestIp

func (slf *Context) GetRequestIp() (reqIp string)

func (*Context) GetTraceId

func (slf *Context) GetTraceId() string

func (*Context) ResponseJson

func (slf *Context) ResponseJson(code int, response interface{}) error

func (*Context) ResponseJsonBlob

func (slf *Context) ResponseJsonBlob(code int, response []byte) error

func (*Context) ResponseStr

func (slf *Context) ResponseStr(code int, response string) error

func (*Context) SetRequestUserId

func (slf *Context) SetRequestUserId(uid string)

type EchoApi

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

func BuildEcho

func BuildEcho(port int, logMiddleware clog.EchoMiddleware) *EchoApi
 ============================================
	Created by andy pangaribuan on 2021/05/18
	Copyright andypangaribuan. All rights reserved.
   ============================================

noinspection GoUnusedExportedFunction

func (*EchoApi) Group added in v1.0.6

func (slf *EchoApi) Group(path string, group func(g *GroupApi))

func (*EchoApi) POST

func (slf *EchoApi) POST(path string, handler HandlerFunc)

func (*EchoApi) POSTS added in v1.0.7

func (slf *EchoApi) POSTS(endpoint map[string]HandlerFunc)

func (*EchoApi) Serve

func (slf *EchoApi) Serve()

type GroupApi added in v1.0.6

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

func (*GroupApi) Group added in v1.0.6

func (slf *GroupApi) Group(path string, group func(g *GroupApi))

func (*GroupApi) POST added in v1.0.6

func (slf *GroupApi) POST(path string, handler HandlerFunc)

func (*GroupApi) POSTS added in v1.0.7

func (slf *GroupApi) POSTS(endpoint map[string]HandlerFunc)

type HandlerFunc

type HandlerFunc func(Context) error
 ============================================
	Created by andy pangaribuan on 2021/05/18
	Copyright andypangaribuan. All rights reserved.
   ============================================

Jump to

Keyboard shortcuts

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