handler

package
v0.0.0-...-c42b9c9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: MIT Imports: 0 Imported by: 1

Documentation

Overview

Package handler 用于接口逻辑处理

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(handler HandlerIntf) error

Run 执行函数

func RunHandler

func RunHandler(handler Handler) error

RunHandler new version of handler, have cache

Types

type Handler

type Handler interface {
	HandleInput() error
	HandleProcess() error
	UseCache() bool
	SetCache()
}

Handler hanlder接口

type HandlerBase

type HandlerBase struct {
	CacheKey string
}

HandlerBase handler共有属性

func (*HandlerBase) SetCache

func (p *HandlerBase) SetCache()

SetCache 设置缓存

func (*HandlerBase) UseCache

func (p *HandlerBase) UseCache() bool

UseCache 使用缓存

type HandlerIntf

type HandlerIntf interface {
	HandleInput() error
	HandleProcess() error
}

HandlerIntf handler接口

type RpcIntf

type RpcIntf interface {
	Request(reqBody interface{}) (interface{}, error)
}

RpcIntf Rpc接口

Jump to

Keyboard shortcuts

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