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: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Build()
}

生成器接口

type ConcreteBuilder

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

具体生成器,用于构建产品的生成器

func NewConcreteBuilder

func NewConcreteBuilder() ConcreteBuilder

初始化具体生成器对象

func (*ConcreteBuilder) Build

func (b *ConcreteBuilder) Build()

生成产品

func (*ConcreteBuilder) GetResult

func (b *ConcreteBuilder) GetResult() Product

返回在生成步骤中生成的产品

type Director

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

主管

func NewDirector

func NewDirector(builder Builder) Director

初始化主管对象

func (*Director) Construct

func (d *Director) Construct()

通过一系列步骤生成产品

type Product

type Product struct {
	Built bool
}

产品

Jump to

Keyboard shortcuts

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