Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AppGraph = loom.Graph[*App]( loom.Provide(NewDB), loom.As[UserStore](NewUserStore), loom.Provide(NewUserService), loom.Provide(NewApp), )
AppGraph wires *userStore into UserStore via loom.As.
Functions ¶
func NewUserStore ¶
func NewUserStore(db *DB) *userStore
NewUserStore returns the concrete store; note it is unexported, so only the interface escapes the package.
Types ¶
type App ¶
type App struct {
Service *UserService
}
App is the assembled application.
type UserService ¶
type UserService struct {
Store UserStore
}
UserService depends on the interface, not the implementation.
func NewUserService ¶
func NewUserService(store UserStore) *UserService
NewUserService builds the service.
Click to show internal directories.
Click to hide internal directories.