package adapter
type Adapter interface {
Request() string
}
type Adaptee interface {
SpecificRequest() string
}
func NewAdaptee() Adaptee{
return &adapteeImpl{}
}
type adapteeImpl struct{}
func (*adapteeImpl) SpecificRequest() string{
return "this is specific method"
}
type adapterImpl struct {
Adaptee
}
func NewAdapter(a Adaptee) Adapter{
return &adapterImpl{
Adaptee: a,
}
}
func (a *adapterImpl) Request() string{
return a.SpecificRequest();
}