service

package
v0.1.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeRequestToNewSession

func DecodeRequestToNewSession(r *http.Response) (*model.Session, error)

func WriteResponse

func WriteResponse(w http.ResponseWriter, object interface{}, err error)

Types

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func CreateDefaultAuthService

func CreateDefaultAuthService() *AuthService

func (*AuthService) CreateSession

func (a *AuthService) CreateSession(newSession model.NewSession) (*model.Session, error)

func (*AuthService) DoWithValidSession

func (a *AuthService) DoWithValidSession(w http.ResponseWriter, r *http.Request, doAction func(session *model.Session) (interface{}, error))

func (*AuthService) DoWithValidSessionAndUser

func (a *AuthService) DoWithValidSessionAndUser(w http.ResponseWriter, r *http.Request, userUuid uuid.UUID, doAction func() (interface{}, error))

func (*AuthService) GetSessionFromRequest

func (a *AuthService) GetSessionFromRequest(r *http.Request) *model.Session

type NotificationService

type NotificationService struct {
	// contains filtered or unexported fields
}

func CreateNotificationService

func CreateNotificationService() *NotificationService

func (*NotificationService) AcknowledgeNotifications added in v0.1.17

func (n *NotificationService) AcknowledgeNotifications(userUuid uuid.UUID, ack *model.NotificationAcknowledgement) error

func (*NotificationService) CreateFollowNotification added in v0.1.17

func (n *NotificationService) CreateFollowNotification(userUuid uuid.UUID, followingUuid uuid.UUID)

func (*NotificationService) GetNotifications added in v0.1.17

func (n *NotificationService) GetNotifications(userUuid uuid.UUID, limit int) ([]*model.Notification, error)

type PostService added in v0.1.18

type PostService struct {
	// contains filtered or unexported fields
}

func CreatePostService added in v0.1.18

func CreatePostService() *PostService

func (*PostService) UpsertPost added in v0.1.18

func (p *PostService) UpsertPost(postModel *model.Post)

type UserService added in v0.1.17

type UserService struct {
	// contains filtered or unexported fields
}

func CreateUserService added in v0.1.17

func CreateUserService() *UserService

func (*UserService) UpdateProfilePic added in v0.1.17

func (u *UserService) UpdateProfilePic(userUuid uuid.UUID, s3Key string)

func (*UserService) UpsertUser added in v0.1.17

func (u *UserService) UpsertUser(userModel *model.User)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL