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 Component

type Component interface {
	Operation()
}

组件接口

type ConcreteComponent

type ConcreteComponent struct {
}

具体组件

func (*ConcreteComponent) Operation

func (c *ConcreteComponent) Operation()

具体组件方法

type Decorator

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

装饰

func (*Decorator) Operation

func (d *Decorator) Operation()

装饰方法

func (*Decorator) SetComponent

func (d *Decorator) SetComponent(c Component)

装饰设置组件方法

type DecoratorA

type DecoratorA struct {
	Decorator
}

具体装饰器A

func (*DecoratorA) IndependentMethod

func (d *DecoratorA) IndependentMethod()

func (*DecoratorA) Operation

func (d *DecoratorA) Operation()

具体装饰器A的方法

type DecoratorB

type DecoratorB struct {
	Decorator
}

具体装饰器B

func (*DecoratorB) Operation

func (d *DecoratorB) Operation()

具体装饰器B的方法

func (*DecoratorB) String

func (d *DecoratorB) String() string

具体装饰器B的拓展方法

Jump to

Keyboard shortcuts

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