rainbond: github.com/goodrain/rainbond/api/util Index | Files

package util

import "github.com/goodrain/rainbond/api/util"

Index

Package Files

events.go handleError.go http.go

func CanDoEvent Uses

func CanDoEvent(optType string, synType int, target, targetID string) bool

CanDoEvent check can do event or not

func CloseRequest Uses

func CloseRequest(req *http.Request)

CloseRequest close request

func CloseResponse Uses

func CloseResponse(res *http.Response)

CloseResponse close response

func CreateEvent Uses

func CreateEvent(target, optType, targetID, tenantID, reqBody, userName string, synType int) (*dbmodel.ServiceEvent, error)

CreateEvent save event

func UpdateEvent Uses

func UpdateEvent(eventID string, statusCode int)

UpdateEvent update event

type APIHandleError Uses

type APIHandleError struct {
    Code int
    Err  error
}

APIHandleError handle create err for api

func CreateAPIHandleError Uses

func CreateAPIHandleError(code int, err error) *APIHandleError

CreateAPIHandleError create APIHandleError

func CreateAPIHandleErrorFromDBError Uses

func CreateAPIHandleErrorFromDBError(msg string, err error) *APIHandleError

CreateAPIHandleErrorFromDBError from db error create APIHandleError

func CreateAPIHandleErrorf Uses

func CreateAPIHandleErrorf(code int, format string, args ...interface{}) *APIHandleError

CreateAPIHandleErrorf create handle error

func (*APIHandleError) Error Uses

func (a *APIHandleError) Error() string

func (*APIHandleError) Handle Uses

func (a *APIHandleError) Handle(r *http.Request, w http.ResponseWriter)

Handle 处理

func (*APIHandleError) String Uses

func (a *APIHandleError) String() string

Package util imports 10 packages (graph) and is imported by 12 packages. Updated 2019-10-14. Refresh now. Tools for package owners.