abstract_factory

package
v0.0.0-...-4cd6851 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LuxuryCarType   = 1
	FamiliarCarType = 2
)
View Source
const (
	SportMotorbikeType  = 1
	CruiseMotorbikeType = 2
)
View Source
const (
	CarFactoryType       = 1
	MotorbikeFactoryType = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Car

type Car interface {
	GetDoors() int
}

type CarFactory

type CarFactory struct{}

func (*CarFactory) GetVehicle

func (c *CarFactory) GetVehicle(v int) (Vehicle, error)

type CruiseMotorbike

type CruiseMotorbike struct{}

func (*CruiseMotorbike) GetSeats

func (c *CruiseMotorbike) GetSeats() int

func (*CruiseMotorbike) GetType

func (c *CruiseMotorbike) GetType() int

func (*CruiseMotorbike) GetWheels

func (c *CruiseMotorbike) GetWheels() int

type FamiliarCar

type FamiliarCar struct{}

func (*FamiliarCar) GetDoors

func (l *FamiliarCar) GetDoors() int

func (*FamiliarCar) GetSeats

func (l *FamiliarCar) GetSeats() int

func (*FamiliarCar) GetWheels

func (l *FamiliarCar) GetWheels() int

type LuxuryCar

type LuxuryCar struct{}

func (*LuxuryCar) GetDoors

func (l *LuxuryCar) GetDoors() int

func (*LuxuryCar) GetSeats

func (l *LuxuryCar) GetSeats() int

func (*LuxuryCar) GetWheels

func (l *LuxuryCar) GetWheels() int

type Motorbike

type Motorbike interface {
	GetType() int
}

type MotorbikeFactory

type MotorbikeFactory struct{}

func (*MotorbikeFactory) GetVehicle

func (m *MotorbikeFactory) GetVehicle(v int) (Vehicle, error)

type SportMotorbike

type SportMotorbike struct{}

func (*SportMotorbike) GetSeats

func (s *SportMotorbike) GetSeats() int

func (*SportMotorbike) GetType

func (s *SportMotorbike) GetType() int

func (*SportMotorbike) GetWheels

func (s *SportMotorbike) GetWheels() int

type Vehicle

type Vehicle interface {
	GetWheels() int
	GetSeats() int
}

type VehicleFactory

type VehicleFactory interface {
	GetVehicle(v int) (Vehicle, error)
}

func GetVehicleFactory

func GetVehicleFactory(f int) (VehicleFactory, error)

Jump to

Keyboard shortcuts

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