example

package
v0.0.0-...-8d22ec3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 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 Adaptee

type Adaptee struct {
}

定义被适配的类

func (*Adaptee) SpecificExecute

func (a *Adaptee) SpecificExecute()

定义了用于执行的方法SpecificExecute()

type Adapter

type Adapter struct {
	*Adaptee
}

Adapter 是新接口 Target 的适配器,继承了 Adaptee 类

func (*Adapter) Execute

func (a *Adapter) Execute()

实现 Target 接口,同时继承了 Adaptee 类

type ObjectAdaptee

type ObjectAdaptee struct {
}

适配者类

func (*ObjectAdaptee) SpecificExecute

func (b *ObjectAdaptee) SpecificExecute()

适配者类的方法

type ObjectAdapter

type ObjectAdapter struct {
	Adaptee ObjectAdaptee
}

适配器类

func (*ObjectAdapter) Execute

func (p *ObjectAdapter) Execute()

适配器类的方法

type ObjectTarget

type ObjectTarget interface {
	Execute()
}

目标接口

type Target

type Target interface {
	Execute()
}

目标接口

Jump to

Keyboard shortcuts

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