abstract_factory

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

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BmwXSeriesType = 1
	BmwISeriesType = 2
)
View Source
const (
	FordSedanType = 1
	FordSuvType   = 2
)
View Source
const (
	BmwFactoryType  = 1
	FordFactoryType = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BMW

type BMW interface {
	GetSeries() string
	GetModel() string
}

type BMWFactory

type BMWFactory struct{}

func (*BMWFactory) NewVehicle

func (*BMWFactory) NewVehicle(series int) (Vehicle, error)

type BmwISeries

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

func (*BmwISeries) GetManufacturer

func (*BmwISeries) GetManufacturer() string

func (*BmwISeries) GetModel

func (i *BmwISeries) GetModel() string

func (*BmwISeries) GetSeries

func (*BmwISeries) GetSeries() string

type BmwXSeries

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

func (*BmwXSeries) GetManufacturer

func (*BmwXSeries) GetManufacturer() string

func (*BmwXSeries) GetModel

func (x *BmwXSeries) GetModel() string

func (*BmwXSeries) GetSeries

func (x *BmwXSeries) GetSeries() string

type Ford

type Ford interface {
	GetType() string
	GetModel() string
}

type FordFactory

type FordFactory struct{}

func (*FordFactory) NewVehicle

func (*FordFactory) NewVehicle(t int) (Vehicle, error)

type FordSedanSeries

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

func (*FordSedanSeries) GetManufacturer

func (*FordSedanSeries) GetManufacturer() string

func (*FordSedanSeries) GetModel

func (f *FordSedanSeries) GetModel() string

func (*FordSedanSeries) GetType

func (*FordSedanSeries) GetType() string

type FordSuvSeries

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

func (*FordSuvSeries) GetManufacturer

func (*FordSuvSeries) GetManufacturer() string

func (*FordSuvSeries) GetModel

func (f *FordSuvSeries) GetModel() string

func (*FordSuvSeries) GetType

func (*FordSuvSeries) GetType() string

type Vehicle

type Vehicle interface {
	GetManufacturer() string
}

type VehicleFactory

type VehicleFactory interface {
	NewVehicle(t int) (Vehicle, error)
}

func GetVehicleFactory

func GetVehicleFactory(brand int) (VehicleFactory, error)

Jump to

Keyboard shortcuts

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