example

package
v0.0.0-...-db5681a Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseHandler

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

基础处理者

func (*BaseHandler) Handle

func (h *BaseHandler) Handle(handleID int) int

Handle 处理给定的 handleID

func (*BaseHandler) SetNext

func (h *BaseHandler) SetNext(handler Handler)

设置下一个处理者

type ConcreteHandler

type ConcreteHandler struct {
}

具体处理者

func (*ConcreteHandler) Handle

func (ch *ConcreteHandler) Handle(handleID int)

具体处理者的处理方法

type Handler

type Handler interface {
	SetNext(handler Handler)
	Handle(handleID int) int
}

Handler 定义了一个处理程序来处理给定的 handleID

func NewBaseHandler

func NewBaseHandler(name string, next Handler, handleID int) Handler

NewHandler 返回一个新的处理程序

Jump to

Keyboard shortcuts

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