Исходники и презентации
This commit is contained in:
21
lessons/interfaces/duck_typing_problem/main.go
Normal file
21
lessons/interfaces/duck_typing_problem/main.go
Normal file
@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import "context"
|
||||
|
||||
type UserService interface {
|
||||
Save(ctx context.Context, name string) (int64, error)
|
||||
Get(ctx context.Context, id int64) (interface{}, error)
|
||||
}
|
||||
|
||||
type UserRepository interface {
|
||||
Save(ctx context.Context, name string) (int64, error)
|
||||
Get(ctx context.Context, id int64) (interface{}, error)
|
||||
}
|
||||
|
||||
type Provider struct{}
|
||||
|
||||
func NewProvider() Provider {
|
||||
return Provider{}
|
||||
}
|
||||
|
||||
func (p *Provider) ProvideUserRepo() UserService
|
||||
Reference in New Issue
Block a user