example

package
v0.0.0-...-05962f3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Execute()
}

type Command1

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

具体命令1

func NewCommand1

func NewCommand1(name string, receiverObj *Receiver) *Command1

初始化Command1对象

func (*Command1) Execute

func (c *Command1) Execute()

具体命令1执行操作

type Command2

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

具体命令2

func NewCommand2

func NewCommand2(name string, receiverObj *Receiver) *Command2

初始化Command2对象

func (*Command2) Execute

func (c *Command2) Execute()

具体命令2执行操作

type Invoker

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

调用者类

func NewInvoker

func NewInvoker() *Invoker

初始化调用者对象

func (*Invoker) ExecuteCommand

func (c *Invoker) ExecuteCommand()

ExecuteCommand 方法用于执行命令

func (*Invoker) SetCommand

func (c *Invoker) SetCommand(cmd Command)

SetCommand 方法用于设置命令

type Receiver

type Receiver struct {
}

接收者类

func NewReceiver

func NewReceiver() *Receiver

初始化接收者对象

Jump to

Keyboard shortcuts

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