Documentation
¶
Overview ¶
Package service provides a centralized service factory for database operations.
Usage:
// Initialize the factory with a database pool
pool, err := pgxpool.New(context.Background(), databaseURL)
if err != nil {
log.Fatal(err)
}
factory := service.NewFactory(pool)
// Each service call creates a fresh querier instance
tagService := factory.Tag()
tag, err := tagService.FindByID(ctx, tagID)
userService := factory.User()
user, err := userService.FindByID(ctx, userID)
Index ¶
- type Factory
- func (f *Factory) Draft() *draft.Draft
- func (f *Factory) Edit() *edit.Edit
- func (f *Factory) Fingerprint() *fingerprint.Fingerprint
- func (f *Factory) Image() *image.Image
- func (f *Factory) Invite() *invite.Invite
- func (f *Factory) ModAudit() *mod_audit.ModAuditService
- func (f *Factory) Notification() *notification.Notification
- func (f *Factory) Performer() *performer.Performer
- func (f *Factory) Scene() *scene.Scene
- func (f *Factory) Site() *site.Site
- func (f *Factory) Studio() *studio.Studio
- func (f *Factory) Tag() *tag.Tag
- func (f *Factory) User() *user.User
- func (f *Factory) UserToken() *usertoken.UserToken
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory provides access to all services with centralized database connection management
func NewFactory ¶
NewFactory creates a new service factory with the given database pool and email manager
func (*Factory) Fingerprint ¶ added in v0.9.0
func (f *Factory) Fingerprint() *fingerprint.Fingerprint
Fingerprint returns a Fingerprint clustering service instance
func (*Factory) ModAudit ¶ added in v0.8.0
func (f *Factory) ModAudit() *mod_audit.ModAuditService
ModAudit returns a ModAuditService instance
func (*Factory) Notification ¶
func (f *Factory) Notification() *notification.Notification
Notification returns a NotificationService instance
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fingerprint provides services for fingerprint clustering and analysis.
|
Package fingerprint provides services for fingerprint clustering and analysis. |
Click to show internal directories.
Click to hide internal directories.