Documentation ¶
Index ¶
- Constants
- func NewCommand() *cobra.Command
- type Addition
- type ChainHandler
- type ChainNext
- type Earth
- type Event
- type INotifier
- type IObserver
- type IPhone
- type IPhoneBuilder
- type LinkObject
- type LinkPool
- type Multiplication
- type NilChainHandler
- type Notifier
- type Observer
- type Operation
- type Operator
- type Pc
- type PcType
- type PhoneBuilder
- type PhoneColor
- type PhoneInterface
- type PhoneSim
- type PhoneSize
Constants ¶
View Source
const ( SizeBig PhoneSize = "大尺寸" SizeMiddle = "中等尺寸" SizeSmall = "小尺寸" )
View Source
const ( ColorRed PhoneColor = "红色" ColorGreen = "绿色" ColorBlue = "蓝色" )
View Source
const ( SimYiDong PhoneSim = "移动" SimLianTong = "联通" SimDianXin = "电信" )
View Source
const ( TypeLenovo PcType = "lenovo" TypeDell = "dell" TypeHp = "hp" )
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
Types ¶
type ChainHandler ¶
type ChainHandler interface { Do(ctx context.Context) error Run(ctx context.Context) error SetNext(h ChainHandler) ChainHandler }
type ChainNext ¶
type ChainNext struct {
// contains filtered or unexported fields
}
func (*ChainNext) SetNext ¶
func (n *ChainNext) SetNext(h ChainHandler) ChainHandler
type IPhoneBuilder ¶
type IPhoneBuilder struct {
// contains filtered or unexported fields
}
实现手机构建者接口的构建者
func (IPhoneBuilder) Build ¶
func (mine IPhoneBuilder) Build() PhoneInterface
func (IPhoneBuilder) Color ¶
func (mine IPhoneBuilder) Color(color PhoneColor) PhoneBuilder
func (IPhoneBuilder) SimCard ¶
func (mine IPhoneBuilder) SimCard(sim PhoneSim) PhoneBuilder
func (IPhoneBuilder) Size ¶
func (mine IPhoneBuilder) Size(size PhoneSize) PhoneBuilder
type LinkObject ¶
type LinkObject struct {
// contains filtered or unexported fields
}
func (*LinkObject) ID ¶
func (link *LinkObject) ID() int
type LinkPool ¶
type LinkPool chan *LinkObject
func (*LinkPool) Get ¶
func (pool *LinkPool) Get() *LinkObject
type Multiplication ¶
type Multiplication struct{}
type NilChainHandler ¶
type NilChainHandler struct {
ChainNext
}
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func NewNotifier() Notifier
func (*Notifier) Deregister ¶
type Observer ¶
type Observer struct { Data interface{} // contains filtered or unexported fields }
func NewObserver ¶
type PhoneBuilder ¶
type PhoneBuilder interface { Size(size PhoneSize) PhoneBuilder Color(color PhoneColor) PhoneBuilder SimCard(sim PhoneSim) PhoneBuilder Build() PhoneInterface }
手机构造接口
func NewIPhoneBuilder ¶
func NewIPhoneBuilder() PhoneBuilder
type PhoneColor ¶
type PhoneColor string
Click to show internal directories.
Click to hide internal directories.