https

package
v0.0.0-...-48e1cf4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadCommand = errors.New("error bad command")
View Source
var ErrEmptyKeyOrField = errors.New("empty key or field")
View Source
var ErrIncompleteRequest = errors.New("incomplete request")
View Source
var ErrOperationNotPermited = errors.New("operation permission denied")

Functions

func ConvertMapToJwtString

func ConvertMapToJwtString(param map[string]interface{}) (jwtString string, err error)

func CorsChecked

func CorsChecked(r *http.Request, w http.ResponseWriter) bool

func RedisHttpStart

func RedisHttpStart(path string, port int64)

listten to a port and start http server

func ToStruct

func ToStruct(r *http.Request, v interface{}) error

Parse parses the request.

Types

type HttpContext

type HttpContext struct {
	Req *http.Request
	Rsb http.ResponseWriter

	Ctx             context.Context
	RedisDataSource string
	// case get
	Cmd   string
	Key   string
	Field string

	ResponseContentType string
	// contains filtered or unexported fields
}

func NewHttpContext

func NewHttpContext(ctx context.Context, r *http.Request, w http.ResponseWriter) (httpCtx *HttpContext, err error)

func (*HttpContext) DelHandler

func (svcCtx *HttpContext) DelHandler() (result interface{}, err error)

func (*HttpContext) GetHandler

func (svcCtx *HttpContext) GetHandler() (ret interface{}, err error)

func (*HttpContext) JsonBodyBytes

func (svc *HttpContext) JsonBodyBytes() (data []byte)

func (*HttpContext) KeyFieldAtJwt

func (svc *HttpContext) KeyFieldAtJwt() (operation string, err error)

func (*HttpContext) MergeJwtField

func (svc *HttpContext) MergeJwtField(paramIn map[string]interface{})

func (*HttpContext) MsgpackBody

func (svc *HttpContext) MsgpackBody() (bytes []byte, err error)

Ensure the body is msgpack format

func (*HttpContext) MsgpackBodyBytes

func (svc *HttpContext) MsgpackBodyBytes() (data []byte)

func (*HttpContext) ParseJwtToken

func (svc *HttpContext) ParseJwtToken() (err error)

func (*HttpContext) PostHandler

func (svcCtx *HttpContext) PostHandler() (ret interface{}, err error)

func (*HttpContext) PutHandler

func (svcCtx *HttpContext) PutHandler() (data interface{}, err error)

Jump to

Keyboard shortcuts

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