factory

package
v0.0.0-...-6a9f61f Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block interface {
	Show()
}

Block of abstract

type BlockFactory

type BlockFactory struct{}

BlockFactory product blocks

func (*BlockFactory) GetFactory

func (f *BlockFactory) GetFactory(kind string) Factory

GetFactory return

func (*BlockFactory) ProductBlock

func (f *BlockFactory) ProductBlock(kind string) Block

ProductBlock product block of specified kind

type CircleBlock

type CircleBlock struct{ Block }

CircleBlock concrete circle block

func (*CircleBlock) Show

func (c *CircleBlock) Show()

Show display block info

type CircleBlockFactory

type CircleBlockFactory struct{ Factory }

CircleBlockFactory product circle blocks

func (*CircleBlockFactory) Product

func (c *CircleBlockFactory) Product() Block

Product create circle blocks

type Factory

type Factory interface {
	Product() Block
}

Factory of block

func GetCircleBlockFactory

func GetCircleBlockFactory() Factory

GetCircleBlockFactory return a singleton instance of CircleBlockFactory

func GetSquareBlockFactory

func GetSquareBlockFactory() Factory

GetSquareBlockFactory return a singleton instance of SquareBlockFactory

type SquareBlock

type SquareBlock struct{ Block }

SquareBlock concrete square block

func (*SquareBlock) Show

func (s *SquareBlock) Show()

Show display block info

type SquareBlockFactory

type SquareBlockFactory struct{ Factory }

SquareBlockFactory product square blocks

func (*SquareBlockFactory) Product

func (s *SquareBlockFactory) Product() Block

Product create square blocks

Jump to

Keyboard shortcuts

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