Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Err string
}
type Notification ¶
type Notification struct { ID *int64 `json:"id,omitempty"` UserID string `json:"user_id"` Message string `json:"message"` }
User defines the structure for the user
type NotificationManager ¶
type NotificationManager interface { AddNotification(ctx context.Context, notification Notification) error FindNotificationByID(ctx context.Context, notificationID int64) (*Notification, error) }
type Notifications ¶
type Notifications []Notification
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(client *storage.MySQLStorage) (*Repository, error)
func (*Repository) AddNotification ¶
func (r *Repository) AddNotification(notification *Notification) error
func (*Repository) GetNotificationsByUserID ¶
func (r *Repository) GetNotificationsByUserID(userID int64) (*Notifications, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewNotificationService ¶
func NewNotificationService(repository *Repository) *Service
func (*Service) CreateNotificationHandler ¶
func (s *Service) CreateNotificationHandler(w http.ResponseWriter, r *http.Request)
func (*Service) GetNotificationsByUserID ¶
func (s *Service) GetNotificationsByUserID(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.