You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
665 B
30 lines
665 B
package services
|
|
|
|
import (
|
|
"git.aiterp.net/rpdata/api/database"
|
|
"git.aiterp.net/rpdata/api/services/loaders"
|
|
)
|
|
|
|
// A Bundle contains all services.
|
|
type Bundle struct {
|
|
Tags *TagService
|
|
Characters *CharacterService
|
|
Changes *ChangeService
|
|
}
|
|
|
|
// NewBundle creates a new bundle.
|
|
func NewBundle(db database.Database) *Bundle {
|
|
bundle := &Bundle{}
|
|
|
|
bundle.Changes = &ChangeService{
|
|
changes: db.Changes(),
|
|
}
|
|
bundle.Tags = &TagService{tags: db.Tags()}
|
|
bundle.Characters = &CharacterService{
|
|
characters: db.Characters(),
|
|
loader: loaders.CharacterLoaderFromRepository(db.Characters()),
|
|
changeService: bundle.Changes,
|
|
}
|
|
|
|
return bundle
|
|
}
|