Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoScaler ¶
type AutoScaler struct { Spec *AutoScalerSpec Status *AutoScalerStatus Mode CopyMode }
func DeepCopyWithSerialization ¶
func DeepCopyWithSerialization(a *AutoScaler) AutoScaler
func NewAutoScaler ¶
func NewAutoScaler(min, max int, target float32) *AutoScaler
func (*AutoScaler) UpdateStatus ¶
func (a *AutoScaler) UpdateStatus() AutoScaler
type AutoScalerSpec ¶
type AutoScalerStatus ¶
type Director ¶
type Director struct {
// contains filtered or unexported fields
}
Director encapsulates the robot builder and builds the robot by the correct maker based on the currently set builder. This decouples the inner creation logics and functions from the client.
func NewDirector ¶
func NewDirector(m RobotMaker) *Director
func (*Director) SetRobotMaker ¶
func (d *Director) SetRobotMaker(m RobotMaker)
type EmployeeBuilder ¶
type EmployeeBuilder struct {
// contains filtered or unexported fields
}
func NewEmployeeBuilder ¶
func NewEmployeeBuilder() *EmployeeBuilder
func (*EmployeeBuilder) Build ¶
func (c *EmployeeBuilder) Build() Employee
func (*EmployeeBuilder) WithAddress ¶
func (c *EmployeeBuilder) WithAddress(address string) *EmployeeBuilder
func (*EmployeeBuilder) WithCompany ¶
func (c *EmployeeBuilder) WithCompany(company string) *EmployeeBuilder
func (*EmployeeBuilder) WithName ¶
func (c *EmployeeBuilder) WithName(name string) *EmployeeBuilder
type Parking ¶
type Parking interface { ParkVehicle() UnParkVehicle() DisplayFreeSlots() }
func NewParking ¶
func NewParking(parkType ParkingType, store Repository) Parking
NewParking is the factory method that makes store be passed as an external dependency which can be mocked. It is the single function that would be used by all clients for creating all kinds of parking: onstreet, mall, etc..
type Repository ¶
type Repository interface { Create() Update() }
Repository is the external dependency of Parking
type Robot ¶
type Robot struct {
// contains filtered or unexported fields
}
Robot Component: Product
type RobotBuilder ¶
type RobotBuilder interface { BuildRobotHead() BuildRobotTorso() BuildRobotLegs() BuildRobotArms() Build() Robot }
RobotBuilder defines what the robot has Component: BuilderInterface
func NewRobotBuilder ¶
func NewRobotBuilder(robotMaker RobotMaker) RobotBuilder
type ScrollBar ¶
type ScrollBar interface {
Scroll()
}
ScrollBar is an interface to specify what a scrollbar could be
type Window ¶
type Window interface {
Open()
}
Window is an interface to specify what a scrollbar could be
type WindowKitFactory ¶
type WindowKitFactory interface { // CreateScrollBar does the work and creates a ScrollBar CreateScrollBar() ScrollBar // CreateWindow does the work and creates a Window CreateWindow() Window }
WindowKitFactory is an abstract factory interface for creating user interface toolkit, it prevents the clients from commiting to a implementation of the interface.
func NewMotifFactory ¶
func NewMotifFactory() WindowKitFactory
NewMotifFactory creates the factory for creating Motif type of WindowKit
func NewOpenLookFactory ¶
func NewOpenLookFactory() WindowKitFactory
NewOpenLookFactory creates the factory for creating OpenLook type of WindowKit
func NewWindowKitFactory ¶
func NewWindowKitFactory(t WindowKitType) (WindowKitFactory, error)
NewWindowKitFactory creates the factory for the specified WindowKit, using that WindowKit factory we can create the window kit.