app

package
v0.0.0-...-d2e3589 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatService

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

func NewChatService

func NewChatService(
	chatRepo chat.Repository,
	publisher Publish,
	subscriber Subscribe,
) ChatService

func (ChatService) BroadcastMessage

func (c ChatService) BroadcastMessage(nctx context.Context, message *chat.Message, memberships *[]chat.Membership)

func (ChatService) CreateChannel

func (c ChatService) CreateChannel(ctx context.Context, channel dto.NewChannel) (dto.Channel, error)

func (ChatService) CreateMembership

func (c ChatService) CreateMembership(ctx context.Context, newMembership dto.NewMembership) (*dto.Membership, error)

func (ChatService) CreateUser

func (c ChatService) CreateUser(ctx context.Context, newUser dto.NewUser) (*dto.User, error)

func (ChatService) GenerateAccessToken

func (c ChatService) GenerateAccessToken(ctx context.Context, creds dto.NewToken) (*dto.TokenResponse, error)

func (ChatService) GetChannelById

func (c ChatService) GetChannelById(ctx context.Context, channelID string) (*dto.Channel, error)

func (ChatService) GetChannels

func (c ChatService) GetChannels(ctx context.Context) (*[]dto.Channel, error)

func (ChatService) GetUserById

func (c ChatService) GetUserById(ctx context.Context, userID string) (*dto.User, error)

func (ChatService) GetUsers

func (c ChatService) GetUsers(ctx context.Context) (*[]dto.User, error)

func (ChatService) HandleHello

func (c ChatService) HandleHello(ctx context.Context, payload *dto.ClientPayload) *dto.ServerResponse

get memberships getOrCreate device set current device set up pubsub subscribers

func (ChatService) HandleNewMessage

func (c ChatService) HandleNewMessage(ctx context.Context, payload *dto.ClientPayload) *dto.ServerResponse

func (ChatService) ProcessPubsubMessage

func (c ChatService) ProcessPubsubMessage(ctx context.Context, payload dto.PubMessage) *dto.ServerResponse

type Publish

type Publish interface {
	PublishToMembership(ctx context.Context, membershipID string, input dto.PubMessage) error
}

type Subscribe

type Subscribe interface {
	CreateSessionSubscriber(ctx context.Context, membershipID string)
}

Jump to

Keyboard shortcuts

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