conversations

package
v0.0.0-...-500edce Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// Internal
	ListConversations() ([]core.Conversation, error)

	// conversation member only access
	LeaveConversation(userCtx, conversationID, newAdmin int) error
	ListUsersOfConversation(userCtx int, conversationID int) ([]core.UserInConversation, error)

	// Admin only access
	InviteUser(userCtx, recipient, conversationID int) error
	RevokeInvitation(userCtx, userID, conversationID int) error
	RemoveUserFromConversation(userCtx, userID, conversationID int) error
	DeleteConversation(userCtx, conversationID int) error
	SetAdminStatus(userCtx, newAdmin, conversationID int, status bool) error
	EditConversation(userCtx int, conversation core.Conversation) (core.Conversation, error)

	// Restricted access
	ListConversationsForUser(userCtx int) ([]core.Conversation, error)
	ListInvitations(userCtx int) ([]core.Invitation, error)
	DenieInvitation(userCtx, conversationID int) error
	JoinConversation(userCtx, conversationID int) (int, error)
	CreateConversation(userCtx int, title, repoURL string, initialMembers []int) (core.Conversation, error)
}

Service defines all use cases related to conversations. All users that are passed via an argument labeled userCtx are expected to be logged in.

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service, verbose bool) Service

func NewService

func NewService(conversationRepo core.ConversationRepo) Service

NewService creates and returns new Service

Jump to

Keyboard shortcuts

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