transport

package
v0.0.0-...-6f28fd0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: ISC Imports: 9 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 {
	SendMagicLink(ctx context.Context, in nakama.SendMagicLink) error
	ParseRedirectURI(rawurl string) (*url.URL, error)
	VerifyMagicLink(ctx context.Context, email, code string, username *string) (nakama.AuthOutput, error)

	LoginFromProvider(ctx context.Context, name string, user nakama.ProvidedUser) (nakama.User, error)

	DevLogin(ctx context.Context, email string) (nakama.AuthOutput, error)

	AuthUserIDFromToken(token string) (string, error)
	AuthUser(ctx context.Context) (nakama.User, error)
	Token(ctx context.Context) (nakama.TokenOutput, error)

	CreateComment(ctx context.Context, postID, content string) (nakama.Comment, error)
	Comments(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error)
	CommentStream(ctx context.Context, postID string) (<-chan nakama.Comment, error)
	UpdateComment(ctx context.Context, in nakama.UpdateComment) (nakama.UpdatedComment, error)
	DeleteComment(ctx context.Context, commentID string) error
	ToggleCommentReaction(ctx context.Context, commentID string, in nakama.ReactionInput) ([]nakama.Reaction, error)

	Notifications(ctx context.Context, last uint64, before *string) (nakama.Notifications, error)
	NotificationStream(ctx context.Context) (<-chan nakama.Notification, error)
	HasUnreadNotifications(ctx context.Context) (bool, error)
	MarkNotificationAsRead(ctx context.Context, notificationID string) error
	MarkNotificationsAsRead(ctx context.Context) error

	Posts(ctx context.Context, last uint64, before *string, opts ...nakama.PostsOpt) (nakama.Posts, error)
	PostStream(ctx context.Context) (<-chan nakama.Post, error)
	Post(ctx context.Context, postID string) (nakama.Post, error)
	UpdatePost(ctx context.Context, postID string, in nakama.UpdatePost) (nakama.UpdatedPost, error)
	DeletePost(ctx context.Context, postID string) error
	TogglePostReaction(ctx context.Context, postID string, in nakama.ReactionInput) ([]nakama.Reaction, error)
	TogglePostSubscription(ctx context.Context, postID string) (nakama.ToggleSubscriptionOutput, error)

	CreateTimelineItem(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error)
	Timeline(ctx context.Context, last uint64, before *string) (nakama.Timeline, error)
	TimelineItemStream(ctx context.Context) (<-chan nakama.TimelineItem, error)
	DeleteTimelineItem(ctx context.Context, timelineItemID string) error

	Users(ctx context.Context, search string, first uint64, after *string) (nakama.UserProfiles, error)
	Usernames(ctx context.Context, startingWith string, first uint64, after *string) (nakama.Usernames, error)
	User(ctx context.Context, username string) (nakama.UserProfile, error)
	UpdateUser(ctx context.Context, params nakama.UpdateUserParams) error
	UpdateAvatar(ctx context.Context, r io.ReadSeeker) (string, error)
	UpdateCover(ctx context.Context, r io.ReadSeeker) (string, error)
	ToggleFollow(ctx context.Context, username string) (nakama.ToggleFollowOutput, error)
	Followers(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)
	Followees(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)

	AddWebPushSubscription(ctx context.Context, sub webpush.Subscription) error
}

Service interface.

type ServiceMock

type ServiceMock struct {
	// AddWebPushSubscriptionFunc mocks the AddWebPushSubscription method.
	AddWebPushSubscriptionFunc func(ctx context.Context, sub webpush.Subscription) error

	// AuthUserFunc mocks the AuthUser method.
	AuthUserFunc func(ctx context.Context) (nakama.User, error)

	// AuthUserIDFromTokenFunc mocks the AuthUserIDFromToken method.
	AuthUserIDFromTokenFunc func(token string) (string, error)

	// CommentStreamFunc mocks the CommentStream method.
	CommentStreamFunc func(ctx context.Context, postID string) (<-chan nakama.Comment, error)

	// CommentsFunc mocks the Comments method.
	CommentsFunc func(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error)

	// CreateCommentFunc mocks the CreateComment method.
	CreateCommentFunc func(ctx context.Context, postID string, content string) (nakama.Comment, error)

	// CreateTimelineItemFunc mocks the CreateTimelineItem method.
	CreateTimelineItemFunc func(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error)

	// DeleteCommentFunc mocks the DeleteComment method.
	DeleteCommentFunc func(ctx context.Context, commentID string) error

	// DeletePostFunc mocks the DeletePost method.
	DeletePostFunc func(ctx context.Context, postID string) error

	// DeleteTimelineItemFunc mocks the DeleteTimelineItem method.
	DeleteTimelineItemFunc func(ctx context.Context, timelineItemID string) error

	// DevLoginFunc mocks the DevLogin method.
	DevLoginFunc func(ctx context.Context, email string) (nakama.AuthOutput, error)

	// FolloweesFunc mocks the Followees method.
	FolloweesFunc func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)

	// FollowersFunc mocks the Followers method.
	FollowersFunc func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)

	// HasUnreadNotificationsFunc mocks the HasUnreadNotifications method.
	HasUnreadNotificationsFunc func(ctx context.Context) (bool, error)

	// LoginFromProviderFunc mocks the LoginFromProvider method.
	LoginFromProviderFunc func(ctx context.Context, name string, user nakama.ProvidedUser) (nakama.User, error)

	// MarkNotificationAsReadFunc mocks the MarkNotificationAsRead method.
	MarkNotificationAsReadFunc func(ctx context.Context, notificationID string) error

	// MarkNotificationsAsReadFunc mocks the MarkNotificationsAsRead method.
	MarkNotificationsAsReadFunc func(ctx context.Context) error

	// NotificationStreamFunc mocks the NotificationStream method.
	NotificationStreamFunc func(ctx context.Context) (<-chan nakama.Notification, error)

	// NotificationsFunc mocks the Notifications method.
	NotificationsFunc func(ctx context.Context, last uint64, before *string) (nakama.Notifications, error)

	// ParseRedirectURIFunc mocks the ParseRedirectURI method.
	ParseRedirectURIFunc func(rawurl string) (*url.URL, error)

	// PostFunc mocks the Post method.
	PostFunc func(ctx context.Context, postID string) (nakama.Post, error)

	// PostStreamFunc mocks the PostStream method.
	PostStreamFunc func(ctx context.Context) (<-chan nakama.Post, error)

	// PostsFunc mocks the Posts method.
	PostsFunc func(ctx context.Context, last uint64, before *string, opts ...nakama.PostsOpt) (nakama.Posts, error)

	// SendMagicLinkFunc mocks the SendMagicLink method.
	SendMagicLinkFunc func(ctx context.Context, in nakama.SendMagicLink) error

	// TimelineFunc mocks the Timeline method.
	TimelineFunc func(ctx context.Context, last uint64, before *string) (nakama.Timeline, error)

	// TimelineItemStreamFunc mocks the TimelineItemStream method.
	TimelineItemStreamFunc func(ctx context.Context) (<-chan nakama.TimelineItem, error)

	// ToggleCommentReactionFunc mocks the ToggleCommentReaction method.
	ToggleCommentReactionFunc func(ctx context.Context, commentID string, in nakama.ReactionInput) ([]nakama.Reaction, error)

	// ToggleFollowFunc mocks the ToggleFollow method.
	ToggleFollowFunc func(ctx context.Context, username string) (nakama.ToggleFollowOutput, error)

	// TogglePostReactionFunc mocks the TogglePostReaction method.
	TogglePostReactionFunc func(ctx context.Context, postID string, in nakama.ReactionInput) ([]nakama.Reaction, error)

	// TogglePostSubscriptionFunc mocks the TogglePostSubscription method.
	TogglePostSubscriptionFunc func(ctx context.Context, postID string) (nakama.ToggleSubscriptionOutput, error)

	// TokenFunc mocks the Token method.
	TokenFunc func(ctx context.Context) (nakama.TokenOutput, error)

	// UpdateAvatarFunc mocks the UpdateAvatar method.
	UpdateAvatarFunc func(ctx context.Context, r io.ReadSeeker) (string, error)

	// UpdateCommentFunc mocks the UpdateComment method.
	UpdateCommentFunc func(ctx context.Context, in nakama.UpdateComment) (nakama.UpdatedComment, error)

	// UpdateCoverFunc mocks the UpdateCover method.
	UpdateCoverFunc func(ctx context.Context, r io.ReadSeeker) (string, error)

	// UpdatePostFunc mocks the UpdatePost method.
	UpdatePostFunc func(ctx context.Context, postID string, in nakama.UpdatePost) (nakama.UpdatedPost, error)

	// UpdateUserFunc mocks the UpdateUser method.
	UpdateUserFunc func(ctx context.Context, params nakama.UpdateUserParams) error

	// UserFunc mocks the User method.
	UserFunc func(ctx context.Context, username string) (nakama.UserProfile, error)

	// UsernamesFunc mocks the Usernames method.
	UsernamesFunc func(ctx context.Context, startingWith string, first uint64, after *string) (nakama.Usernames, error)

	// UsersFunc mocks the Users method.
	UsersFunc func(ctx context.Context, search string, first uint64, after *string) (nakama.UserProfiles, error)

	// VerifyMagicLinkFunc mocks the VerifyMagicLink method.
	VerifyMagicLinkFunc func(ctx context.Context, email string, code string, username *string) (nakama.AuthOutput, error)
	// contains filtered or unexported fields
}

ServiceMock is a mock implementation of Service.

func TestSomethingThatUsesService(t *testing.T) {

	// make and configure a mocked Service
	mockedService := &ServiceMock{
		AddWebPushSubscriptionFunc: func(ctx context.Context, sub webpush.Subscription) error {
			panic("mock out the AddWebPushSubscription method")
		},
		AuthUserFunc: func(ctx context.Context) (nakama.User, error) {
			panic("mock out the AuthUser method")
		},
		AuthUserIDFromTokenFunc: func(token string) (string, error) {
			panic("mock out the AuthUserIDFromToken method")
		},
		CommentStreamFunc: func(ctx context.Context, postID string) (<-chan nakama.Comment, error) {
			panic("mock out the CommentStream method")
		},
		CommentsFunc: func(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error) {
			panic("mock out the Comments method")
		},
		CreateCommentFunc: func(ctx context.Context, postID string, content string) (nakama.Comment, error) {
			panic("mock out the CreateComment method")
		},
		CreateTimelineItemFunc: func(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error) {
			panic("mock out the CreateTimelineItem method")
		},
		DeleteCommentFunc: func(ctx context.Context, commentID string) error {
			panic("mock out the DeleteComment method")
		},
		DeletePostFunc: func(ctx context.Context, postID string) error {
			panic("mock out the DeletePost method")
		},
		DeleteTimelineItemFunc: func(ctx context.Context, timelineItemID string) error {
			panic("mock out the DeleteTimelineItem method")
		},
		DevLoginFunc: func(ctx context.Context, email string) (nakama.AuthOutput, error) {
			panic("mock out the DevLogin method")
		},
		FolloweesFunc: func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error) {
			panic("mock out the Followees method")
		},
		FollowersFunc: func(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error) {
			panic("mock out the Followers method")
		},
		HasUnreadNotificationsFunc: func(ctx context.Context) (bool, error) {
			panic("mock out the HasUnreadNotifications method")
		},
		LoginFromProviderFunc: func(ctx context.Context, name string, user nakama.ProvidedUser) (nakama.User, error) {
			panic("mock out the LoginFromProvider method")
		},
		MarkNotificationAsReadFunc: func(ctx context.Context, notificationID string) error {
			panic("mock out the MarkNotificationAsRead method")
		},
		MarkNotificationsAsReadFunc: func(ctx context.Context) error {
			panic("mock out the MarkNotificationsAsRead method")
		},
		NotificationStreamFunc: func(ctx context.Context) (<-chan nakama.Notification, error) {
			panic("mock out the NotificationStream method")
		},
		NotificationsFunc: func(ctx context.Context, last uint64, before *string) (nakama.Notifications, error) {
			panic("mock out the Notifications method")
		},
		ParseRedirectURIFunc: func(rawurl string) (*url.URL, error) {
			panic("mock out the ParseRedirectURI method")
		},
		PostFunc: func(ctx context.Context, postID string) (nakama.Post, error) {
			panic("mock out the Post method")
		},
		PostStreamFunc: func(ctx context.Context) (<-chan nakama.Post, error) {
			panic("mock out the PostStream method")
		},
		PostsFunc: func(ctx context.Context, last uint64, before *string, opts ...nakama.PostsOpt) (nakama.Posts, error) {
			panic("mock out the Posts method")
		},
		SendMagicLinkFunc: func(ctx context.Context, in nakama.SendMagicLink) error {
			panic("mock out the SendMagicLink method")
		},
		TimelineFunc: func(ctx context.Context, last uint64, before *string) (nakama.Timeline, error) {
			panic("mock out the Timeline method")
		},
		TimelineItemStreamFunc: func(ctx context.Context) (<-chan nakama.TimelineItem, error) {
			panic("mock out the TimelineItemStream method")
		},
		ToggleCommentReactionFunc: func(ctx context.Context, commentID string, in nakama.ReactionInput) ([]nakama.Reaction, error) {
			panic("mock out the ToggleCommentReaction method")
		},
		ToggleFollowFunc: func(ctx context.Context, username string) (nakama.ToggleFollowOutput, error) {
			panic("mock out the ToggleFollow method")
		},
		TogglePostReactionFunc: func(ctx context.Context, postID string, in nakama.ReactionInput) ([]nakama.Reaction, error) {
			panic("mock out the TogglePostReaction method")
		},
		TogglePostSubscriptionFunc: func(ctx context.Context, postID string) (nakama.ToggleSubscriptionOutput, error) {
			panic("mock out the TogglePostSubscription method")
		},
		TokenFunc: func(ctx context.Context) (nakama.TokenOutput, error) {
			panic("mock out the Token method")
		},
		UpdateAvatarFunc: func(ctx context.Context, r io.ReadSeeker) (string, error) {
			panic("mock out the UpdateAvatar method")
		},
		UpdateCommentFunc: func(ctx context.Context, in nakama.UpdateComment) (nakama.UpdatedComment, error) {
			panic("mock out the UpdateComment method")
		},
		UpdateCoverFunc: func(ctx context.Context, r io.ReadSeeker) (string, error) {
			panic("mock out the UpdateCover method")
		},
		UpdatePostFunc: func(ctx context.Context, postID string, in nakama.UpdatePost) (nakama.UpdatedPost, error) {
			panic("mock out the UpdatePost method")
		},
		UpdateUserFunc: func(ctx context.Context, params nakama.UpdateUserParams) error {
			panic("mock out the UpdateUser method")
		},
		UserFunc: func(ctx context.Context, username string) (nakama.UserProfile, error) {
			panic("mock out the User method")
		},
		UsernamesFunc: func(ctx context.Context, startingWith string, first uint64, after *string) (nakama.Usernames, error) {
			panic("mock out the Usernames method")
		},
		UsersFunc: func(ctx context.Context, search string, first uint64, after *string) (nakama.UserProfiles, error) {
			panic("mock out the Users method")
		},
		VerifyMagicLinkFunc: func(ctx context.Context, email string, code string, username *string) (nakama.AuthOutput, error) {
			panic("mock out the VerifyMagicLink method")
		},
	}

	// use mockedService in code that requires Service
	// and then make assertions.

}

func (*ServiceMock) AddWebPushSubscription

func (mock *ServiceMock) AddWebPushSubscription(ctx context.Context, sub webpush.Subscription) error

AddWebPushSubscription calls AddWebPushSubscriptionFunc.

func (*ServiceMock) AddWebPushSubscriptionCalls

func (mock *ServiceMock) AddWebPushSubscriptionCalls() []struct {
	Ctx context.Context
	Sub webpush.Subscription
}

AddWebPushSubscriptionCalls gets all the calls that were made to AddWebPushSubscription. Check the length with:

len(mockedService.AddWebPushSubscriptionCalls())

func (*ServiceMock) AuthUser

func (mock *ServiceMock) AuthUser(ctx context.Context) (nakama.User, error)

AuthUser calls AuthUserFunc.

func (*ServiceMock) AuthUserCalls

func (mock *ServiceMock) AuthUserCalls() []struct {
	Ctx context.Context
}

AuthUserCalls gets all the calls that were made to AuthUser. Check the length with:

len(mockedService.AuthUserCalls())

func (*ServiceMock) AuthUserIDFromToken

func (mock *ServiceMock) AuthUserIDFromToken(token string) (string, error)

AuthUserIDFromToken calls AuthUserIDFromTokenFunc.

func (*ServiceMock) AuthUserIDFromTokenCalls

func (mock *ServiceMock) AuthUserIDFromTokenCalls() []struct {
	Token string
}

AuthUserIDFromTokenCalls gets all the calls that were made to AuthUserIDFromToken. Check the length with:

len(mockedService.AuthUserIDFromTokenCalls())

func (*ServiceMock) CommentStream

func (mock *ServiceMock) CommentStream(ctx context.Context, postID string) (<-chan nakama.Comment, error)

CommentStream calls CommentStreamFunc.

func (*ServiceMock) CommentStreamCalls

func (mock *ServiceMock) CommentStreamCalls() []struct {
	Ctx    context.Context
	PostID string
}

CommentStreamCalls gets all the calls that were made to CommentStream. Check the length with:

len(mockedService.CommentStreamCalls())

func (*ServiceMock) Comments

func (mock *ServiceMock) Comments(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error)

Comments calls CommentsFunc.

func (*ServiceMock) CommentsCalls

func (mock *ServiceMock) CommentsCalls() []struct {
	Ctx    context.Context
	PostID string
	Last   uint64
	Before *string
}

CommentsCalls gets all the calls that were made to Comments. Check the length with:

len(mockedService.CommentsCalls())

func (*ServiceMock) CreateComment

func (mock *ServiceMock) CreateComment(ctx context.Context, postID string, content string) (nakama.Comment, error)

CreateComment calls CreateCommentFunc.

func (*ServiceMock) CreateCommentCalls

func (mock *ServiceMock) CreateCommentCalls() []struct {
	Ctx     context.Context
	PostID  string
	Content string
}

CreateCommentCalls gets all the calls that were made to CreateComment. Check the length with:

len(mockedService.CreateCommentCalls())

func (*ServiceMock) CreateTimelineItem

func (mock *ServiceMock) CreateTimelineItem(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error)

CreateTimelineItem calls CreateTimelineItemFunc.

func (*ServiceMock) CreateTimelineItemCalls

func (mock *ServiceMock) CreateTimelineItemCalls() []struct {
	Ctx       context.Context
	Content   string
	SpoilerOf *string
	Nsfw      bool
	Media     []io.ReadSeeker
}

CreateTimelineItemCalls gets all the calls that were made to CreateTimelineItem. Check the length with:

len(mockedService.CreateTimelineItemCalls())

func (*ServiceMock) DeleteComment

func (mock *ServiceMock) DeleteComment(ctx context.Context, commentID string) error

DeleteComment calls DeleteCommentFunc.

func (*ServiceMock) DeleteCommentCalls

func (mock *ServiceMock) DeleteCommentCalls() []struct {
	Ctx       context.Context
	CommentID string
}

DeleteCommentCalls gets all the calls that were made to DeleteComment. Check the length with:

len(mockedService.DeleteCommentCalls())

func (*ServiceMock) DeletePost

func (mock *ServiceMock) DeletePost(ctx context.Context, postID string) error

DeletePost calls DeletePostFunc.

func (*ServiceMock) DeletePostCalls

func (mock *ServiceMock) DeletePostCalls() []struct {
	Ctx    context.Context
	PostID string
}

DeletePostCalls gets all the calls that were made to DeletePost. Check the length with:

len(mockedService.DeletePostCalls())

func (*ServiceMock) DeleteTimelineItem

func (mock *ServiceMock) DeleteTimelineItem(ctx context.Context, timelineItemID string) error

DeleteTimelineItem calls DeleteTimelineItemFunc.

func (*ServiceMock) DeleteTimelineItemCalls

func (mock *ServiceMock) DeleteTimelineItemCalls() []struct {
	Ctx            context.Context
	TimelineItemID string
}

DeleteTimelineItemCalls gets all the calls that were made to DeleteTimelineItem. Check the length with:

len(mockedService.DeleteTimelineItemCalls())

func (*ServiceMock) DevLogin

func (mock *ServiceMock) DevLogin(ctx context.Context, email string) (nakama.AuthOutput, error)

DevLogin calls DevLoginFunc.

func (*ServiceMock) DevLoginCalls

func (mock *ServiceMock) DevLoginCalls() []struct {
	Ctx   context.Context
	Email string
}

DevLoginCalls gets all the calls that were made to DevLogin. Check the length with:

len(mockedService.DevLoginCalls())

func (*ServiceMock) Followees

func (mock *ServiceMock) Followees(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)

Followees calls FolloweesFunc.

func (*ServiceMock) FolloweesCalls

func (mock *ServiceMock) FolloweesCalls() []struct {
	Ctx      context.Context
	Username string
	First    uint64
	After    *string
}

FolloweesCalls gets all the calls that were made to Followees. Check the length with:

len(mockedService.FolloweesCalls())

func (*ServiceMock) Followers

func (mock *ServiceMock) Followers(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)

Followers calls FollowersFunc.

func (*ServiceMock) FollowersCalls

func (mock *ServiceMock) FollowersCalls() []struct {
	Ctx      context.Context
	Username string
	First    uint64
	After    *string
}

FollowersCalls gets all the calls that were made to Followers. Check the length with:

len(mockedService.FollowersCalls())

func (*ServiceMock) HasUnreadNotifications

func (mock *ServiceMock) HasUnreadNotifications(ctx context.Context) (bool, error)

HasUnreadNotifications calls HasUnreadNotificationsFunc.

func (*ServiceMock) HasUnreadNotificationsCalls

func (mock *ServiceMock) HasUnreadNotificationsCalls() []struct {
	Ctx context.Context
}

HasUnreadNotificationsCalls gets all the calls that were made to HasUnreadNotifications. Check the length with:

len(mockedService.HasUnreadNotificationsCalls())

func (*ServiceMock) LoginFromProvider

func (mock *ServiceMock) LoginFromProvider(ctx context.Context, name string, user nakama.ProvidedUser) (nakama.User, error)

LoginFromProvider calls LoginFromProviderFunc.

func (*ServiceMock) LoginFromProviderCalls

func (mock *ServiceMock) LoginFromProviderCalls() []struct {
	Ctx  context.Context
	Name string
	User nakama.ProvidedUser
}

LoginFromProviderCalls gets all the calls that were made to LoginFromProvider. Check the length with:

len(mockedService.LoginFromProviderCalls())

func (*ServiceMock) MarkNotificationAsRead

func (mock *ServiceMock) MarkNotificationAsRead(ctx context.Context, notificationID string) error

MarkNotificationAsRead calls MarkNotificationAsReadFunc.

func (*ServiceMock) MarkNotificationAsReadCalls

func (mock *ServiceMock) MarkNotificationAsReadCalls() []struct {
	Ctx            context.Context
	NotificationID string
}

MarkNotificationAsReadCalls gets all the calls that were made to MarkNotificationAsRead. Check the length with:

len(mockedService.MarkNotificationAsReadCalls())

func (*ServiceMock) MarkNotificationsAsRead

func (mock *ServiceMock) MarkNotificationsAsRead(ctx context.Context) error

MarkNotificationsAsRead calls MarkNotificationsAsReadFunc.

func (*ServiceMock) MarkNotificationsAsReadCalls

func (mock *ServiceMock) MarkNotificationsAsReadCalls() []struct {
	Ctx context.Context
}

MarkNotificationsAsReadCalls gets all the calls that were made to MarkNotificationsAsRead. Check the length with:

len(mockedService.MarkNotificationsAsReadCalls())

func (*ServiceMock) NotificationStream

func (mock *ServiceMock) NotificationStream(ctx context.Context) (<-chan nakama.Notification, error)

NotificationStream calls NotificationStreamFunc.

func (*ServiceMock) NotificationStreamCalls

func (mock *ServiceMock) NotificationStreamCalls() []struct {
	Ctx context.Context
}

NotificationStreamCalls gets all the calls that were made to NotificationStream. Check the length with:

len(mockedService.NotificationStreamCalls())

func (*ServiceMock) Notifications

func (mock *ServiceMock) Notifications(ctx context.Context, last uint64, before *string) (nakama.Notifications, error)

Notifications calls NotificationsFunc.

func (*ServiceMock) NotificationsCalls

func (mock *ServiceMock) NotificationsCalls() []struct {
	Ctx    context.Context
	Last   uint64
	Before *string
}

NotificationsCalls gets all the calls that were made to Notifications. Check the length with:

len(mockedService.NotificationsCalls())

func (*ServiceMock) ParseRedirectURI

func (mock *ServiceMock) ParseRedirectURI(rawurl string) (*url.URL, error)

ParseRedirectURI calls ParseRedirectURIFunc.

func (*ServiceMock) ParseRedirectURICalls

func (mock *ServiceMock) ParseRedirectURICalls() []struct {
	Rawurl string
}

ParseRedirectURICalls gets all the calls that were made to ParseRedirectURI. Check the length with:

len(mockedService.ParseRedirectURICalls())

func (*ServiceMock) Post

func (mock *ServiceMock) Post(ctx context.Context, postID string) (nakama.Post, error)

Post calls PostFunc.

func (*ServiceMock) PostCalls

func (mock *ServiceMock) PostCalls() []struct {
	Ctx    context.Context
	PostID string
}

PostCalls gets all the calls that were made to Post. Check the length with:

len(mockedService.PostCalls())

func (*ServiceMock) PostStream

func (mock *ServiceMock) PostStream(ctx context.Context) (<-chan nakama.Post, error)

PostStream calls PostStreamFunc.

func (*ServiceMock) PostStreamCalls

func (mock *ServiceMock) PostStreamCalls() []struct {
	Ctx context.Context
}

PostStreamCalls gets all the calls that were made to PostStream. Check the length with:

len(mockedService.PostStreamCalls())

func (*ServiceMock) Posts

func (mock *ServiceMock) Posts(ctx context.Context, last uint64, before *string, opts ...nakama.PostsOpt) (nakama.Posts, error)

Posts calls PostsFunc.

func (*ServiceMock) PostsCalls

func (mock *ServiceMock) PostsCalls() []struct {
	Ctx    context.Context
	Last   uint64
	Before *string
	Opts   []nakama.PostsOpt
}

PostsCalls gets all the calls that were made to Posts. Check the length with:

len(mockedService.PostsCalls())
func (mock *ServiceMock) SendMagicLink(ctx context.Context, in nakama.SendMagicLink) error

SendMagicLink calls SendMagicLinkFunc.

func (*ServiceMock) SendMagicLinkCalls

func (mock *ServiceMock) SendMagicLinkCalls() []struct {
	Ctx context.Context
	In  nakama.SendMagicLink
}

SendMagicLinkCalls gets all the calls that were made to SendMagicLink. Check the length with:

len(mockedService.SendMagicLinkCalls())

func (*ServiceMock) Timeline

func (mock *ServiceMock) Timeline(ctx context.Context, last uint64, before *string) (nakama.Timeline, error)

Timeline calls TimelineFunc.

func (*ServiceMock) TimelineCalls

func (mock *ServiceMock) TimelineCalls() []struct {
	Ctx    context.Context
	Last   uint64
	Before *string
}

TimelineCalls gets all the calls that were made to Timeline. Check the length with:

len(mockedService.TimelineCalls())

func (*ServiceMock) TimelineItemStream

func (mock *ServiceMock) TimelineItemStream(ctx context.Context) (<-chan nakama.TimelineItem, error)

TimelineItemStream calls TimelineItemStreamFunc.

func (*ServiceMock) TimelineItemStreamCalls

func (mock *ServiceMock) TimelineItemStreamCalls() []struct {
	Ctx context.Context
}

TimelineItemStreamCalls gets all the calls that were made to TimelineItemStream. Check the length with:

len(mockedService.TimelineItemStreamCalls())

func (*ServiceMock) ToggleCommentReaction

func (mock *ServiceMock) ToggleCommentReaction(ctx context.Context, commentID string, in nakama.ReactionInput) ([]nakama.Reaction, error)

ToggleCommentReaction calls ToggleCommentReactionFunc.

func (*ServiceMock) ToggleCommentReactionCalls

func (mock *ServiceMock) ToggleCommentReactionCalls() []struct {
	Ctx       context.Context
	CommentID string
	In        nakama.ReactionInput
}

ToggleCommentReactionCalls gets all the calls that were made to ToggleCommentReaction. Check the length with:

len(mockedService.ToggleCommentReactionCalls())

func (*ServiceMock) ToggleFollow

func (mock *ServiceMock) ToggleFollow(ctx context.Context, username string) (nakama.ToggleFollowOutput, error)

ToggleFollow calls ToggleFollowFunc.

func (*ServiceMock) ToggleFollowCalls

func (mock *ServiceMock) ToggleFollowCalls() []struct {
	Ctx      context.Context
	Username string
}

ToggleFollowCalls gets all the calls that were made to ToggleFollow. Check the length with:

len(mockedService.ToggleFollowCalls())

func (*ServiceMock) TogglePostReaction

func (mock *ServiceMock) TogglePostReaction(ctx context.Context, postID string, in nakama.ReactionInput) ([]nakama.Reaction, error)

TogglePostReaction calls TogglePostReactionFunc.

func (*ServiceMock) TogglePostReactionCalls

func (mock *ServiceMock) TogglePostReactionCalls() []struct {
	Ctx    context.Context
	PostID string
	In     nakama.ReactionInput
}

TogglePostReactionCalls gets all the calls that were made to TogglePostReaction. Check the length with:

len(mockedService.TogglePostReactionCalls())

func (*ServiceMock) TogglePostSubscription

func (mock *ServiceMock) TogglePostSubscription(ctx context.Context, postID string) (nakama.ToggleSubscriptionOutput, error)

TogglePostSubscription calls TogglePostSubscriptionFunc.

func (*ServiceMock) TogglePostSubscriptionCalls

func (mock *ServiceMock) TogglePostSubscriptionCalls() []struct {
	Ctx    context.Context
	PostID string
}

TogglePostSubscriptionCalls gets all the calls that were made to TogglePostSubscription. Check the length with:

len(mockedService.TogglePostSubscriptionCalls())

func (*ServiceMock) Token

func (mock *ServiceMock) Token(ctx context.Context) (nakama.TokenOutput, error)

Token calls TokenFunc.

func (*ServiceMock) TokenCalls

func (mock *ServiceMock) TokenCalls() []struct {
	Ctx context.Context
}

TokenCalls gets all the calls that were made to Token. Check the length with:

len(mockedService.TokenCalls())

func (*ServiceMock) UpdateAvatar

func (mock *ServiceMock) UpdateAvatar(ctx context.Context, r io.ReadSeeker) (string, error)

UpdateAvatar calls UpdateAvatarFunc.

func (*ServiceMock) UpdateAvatarCalls

func (mock *ServiceMock) UpdateAvatarCalls() []struct {
	Ctx context.Context
	R   io.ReadSeeker
}

UpdateAvatarCalls gets all the calls that were made to UpdateAvatar. Check the length with:

len(mockedService.UpdateAvatarCalls())

func (*ServiceMock) UpdateComment

func (mock *ServiceMock) UpdateComment(ctx context.Context, in nakama.UpdateComment) (nakama.UpdatedComment, error)

UpdateComment calls UpdateCommentFunc.

func (*ServiceMock) UpdateCommentCalls

func (mock *ServiceMock) UpdateCommentCalls() []struct {
	Ctx context.Context
	In  nakama.UpdateComment
}

UpdateCommentCalls gets all the calls that were made to UpdateComment. Check the length with:

len(mockedService.UpdateCommentCalls())

func (*ServiceMock) UpdateCover

func (mock *ServiceMock) UpdateCover(ctx context.Context, r io.ReadSeeker) (string, error)

UpdateCover calls UpdateCoverFunc.

func (*ServiceMock) UpdateCoverCalls

func (mock *ServiceMock) UpdateCoverCalls() []struct {
	Ctx context.Context
	R   io.ReadSeeker
}

UpdateCoverCalls gets all the calls that were made to UpdateCover. Check the length with:

len(mockedService.UpdateCoverCalls())

func (*ServiceMock) UpdatePost

func (mock *ServiceMock) UpdatePost(ctx context.Context, postID string, in nakama.UpdatePost) (nakama.UpdatedPost, error)

UpdatePost calls UpdatePostFunc.

func (*ServiceMock) UpdatePostCalls

func (mock *ServiceMock) UpdatePostCalls() []struct {
	Ctx    context.Context
	PostID string
	In     nakama.UpdatePost
}

UpdatePostCalls gets all the calls that were made to UpdatePost. Check the length with:

len(mockedService.UpdatePostCalls())

func (*ServiceMock) UpdateUser

func (mock *ServiceMock) UpdateUser(ctx context.Context, params nakama.UpdateUserParams) error

UpdateUser calls UpdateUserFunc.

func (*ServiceMock) UpdateUserCalls

func (mock *ServiceMock) UpdateUserCalls() []struct {
	Ctx    context.Context
	Params nakama.UpdateUserParams
}

UpdateUserCalls gets all the calls that were made to UpdateUser. Check the length with:

len(mockedService.UpdateUserCalls())

func (*ServiceMock) User

func (mock *ServiceMock) User(ctx context.Context, username string) (nakama.UserProfile, error)

User calls UserFunc.

func (*ServiceMock) UserCalls

func (mock *ServiceMock) UserCalls() []struct {
	Ctx      context.Context
	Username string
}

UserCalls gets all the calls that were made to User. Check the length with:

len(mockedService.UserCalls())

func (*ServiceMock) Usernames

func (mock *ServiceMock) Usernames(ctx context.Context, startingWith string, first uint64, after *string) (nakama.Usernames, error)

Usernames calls UsernamesFunc.

func (*ServiceMock) UsernamesCalls

func (mock *ServiceMock) UsernamesCalls() []struct {
	Ctx          context.Context
	StartingWith string
	First        uint64
	After        *string
}

UsernamesCalls gets all the calls that were made to Usernames. Check the length with:

len(mockedService.UsernamesCalls())

func (*ServiceMock) Users

func (mock *ServiceMock) Users(ctx context.Context, search string, first uint64, after *string) (nakama.UserProfiles, error)

Users calls UsersFunc.

func (*ServiceMock) UsersCalls

func (mock *ServiceMock) UsersCalls() []struct {
	Ctx    context.Context
	Search string
	First  uint64
	After  *string
}

UsersCalls gets all the calls that were made to Users. Check the length with:

len(mockedService.UsersCalls())
func (mock *ServiceMock) VerifyMagicLink(ctx context.Context, email string, code string, username *string) (nakama.AuthOutput, error)

VerifyMagicLink calls VerifyMagicLinkFunc.

func (*ServiceMock) VerifyMagicLinkCalls

func (mock *ServiceMock) VerifyMagicLinkCalls() []struct {
	Ctx      context.Context
	Email    string
	Code     string
	Username *string
}

VerifyMagicLinkCalls gets all the calls that were made to VerifyMagicLink. Check the length with:

len(mockedService.VerifyMagicLinkCalls())

type ServiceWithInstrumentation

type ServiceWithInstrumentation struct {
	Next Service
}

func (*ServiceWithInstrumentation) AddWebPushSubscription

func (mw *ServiceWithInstrumentation) AddWebPushSubscription(ctx context.Context, sub webpush.Subscription) error

func (*ServiceWithInstrumentation) AuthUser

func (*ServiceWithInstrumentation) AuthUserIDFromToken

func (mw *ServiceWithInstrumentation) AuthUserIDFromToken(token string) (string, error)

func (*ServiceWithInstrumentation) CommentStream

func (mw *ServiceWithInstrumentation) CommentStream(ctx context.Context, postID string) (<-chan nakama.Comment, error)

func (*ServiceWithInstrumentation) Comments

func (mw *ServiceWithInstrumentation) Comments(ctx context.Context, postID string, last uint64, before *string) (nakama.Comments, error)

func (*ServiceWithInstrumentation) CreateComment

func (mw *ServiceWithInstrumentation) CreateComment(ctx context.Context, postID, content string) (nakama.Comment, error)

func (*ServiceWithInstrumentation) CreateTimelineItem

func (mw *ServiceWithInstrumentation) CreateTimelineItem(ctx context.Context, content string, spoilerOf *string, nsfw bool, media []io.ReadSeeker) (nakama.TimelineItem, error)

func (*ServiceWithInstrumentation) DeleteComment

func (mw *ServiceWithInstrumentation) DeleteComment(ctx context.Context, commentID string) error

func (*ServiceWithInstrumentation) DeletePost

func (mw *ServiceWithInstrumentation) DeletePost(ctx context.Context, postID string) error

func (*ServiceWithInstrumentation) DeleteTimelineItem

func (mw *ServiceWithInstrumentation) DeleteTimelineItem(ctx context.Context, timelineItemID string) error

func (*ServiceWithInstrumentation) DevLogin

func (*ServiceWithInstrumentation) Followees

func (mw *ServiceWithInstrumentation) Followees(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)

func (*ServiceWithInstrumentation) Followers

func (mw *ServiceWithInstrumentation) Followers(ctx context.Context, username string, first uint64, after *string) (nakama.UserProfiles, error)

func (*ServiceWithInstrumentation) HasUnreadNotifications

func (mw *ServiceWithInstrumentation) HasUnreadNotifications(ctx context.Context) (bool, error)

func (*ServiceWithInstrumentation) LoginFromProvider

func (mw *ServiceWithInstrumentation) LoginFromProvider(ctx context.Context, name string, user nakama.ProvidedUser) (nakama.User, error)

func (*ServiceWithInstrumentation) MarkNotificationAsRead

func (mw *ServiceWithInstrumentation) MarkNotificationAsRead(ctx context.Context, notificationID string) error

func (*ServiceWithInstrumentation) MarkNotificationsAsRead

func (mw *ServiceWithInstrumentation) MarkNotificationsAsRead(ctx context.Context) error

func (*ServiceWithInstrumentation) NotificationStream

func (mw *ServiceWithInstrumentation) NotificationStream(ctx context.Context) (<-chan nakama.Notification, error)

func (*ServiceWithInstrumentation) Notifications

func (mw *ServiceWithInstrumentation) Notifications(ctx context.Context, last uint64, before *string) (nakama.Notifications, error)

func (*ServiceWithInstrumentation) ParseRedirectURI

func (mw *ServiceWithInstrumentation) ParseRedirectURI(rawurl string) (*url.URL, error)

func (*ServiceWithInstrumentation) Post

func (*ServiceWithInstrumentation) PostStream

func (mw *ServiceWithInstrumentation) PostStream(ctx context.Context) (<-chan nakama.Post, error)

func (*ServiceWithInstrumentation) Posts

func (mw *ServiceWithInstrumentation) Posts(ctx context.Context, last uint64, before *string, opts ...nakama.PostsOpt) (nakama.Posts, error)

func (*ServiceWithInstrumentation) Timeline

func (mw *ServiceWithInstrumentation) Timeline(ctx context.Context, last uint64, before *string) (nakama.Timeline, error)

func (*ServiceWithInstrumentation) TimelineItemStream

func (mw *ServiceWithInstrumentation) TimelineItemStream(ctx context.Context) (<-chan nakama.TimelineItem, error)

func (*ServiceWithInstrumentation) ToggleCommentReaction

func (mw *ServiceWithInstrumentation) ToggleCommentReaction(ctx context.Context, commentID string, in nakama.ReactionInput) ([]nakama.Reaction, error)

func (*ServiceWithInstrumentation) ToggleFollow

func (mw *ServiceWithInstrumentation) ToggleFollow(ctx context.Context, username string) (nakama.ToggleFollowOutput, error)

func (*ServiceWithInstrumentation) TogglePostReaction

func (mw *ServiceWithInstrumentation) TogglePostReaction(ctx context.Context, postID string, in nakama.ReactionInput) ([]nakama.Reaction, error)

func (*ServiceWithInstrumentation) TogglePostSubscription

func (mw *ServiceWithInstrumentation) TogglePostSubscription(ctx context.Context, postID string) (nakama.ToggleSubscriptionOutput, error)

func (*ServiceWithInstrumentation) Token

func (*ServiceWithInstrumentation) UpdateAvatar

func (mw *ServiceWithInstrumentation) UpdateAvatar(ctx context.Context, r io.ReadSeeker) (string, error)

func (*ServiceWithInstrumentation) UpdateComment

func (*ServiceWithInstrumentation) UpdateCover

func (mw *ServiceWithInstrumentation) UpdateCover(ctx context.Context, r io.ReadSeeker) (string, error)

func (*ServiceWithInstrumentation) UpdatePost

func (*ServiceWithInstrumentation) UpdateUser

func (*ServiceWithInstrumentation) User

func (*ServiceWithInstrumentation) Usernames

func (mw *ServiceWithInstrumentation) Usernames(ctx context.Context, startingWith string, first uint64, after *string) (nakama.Usernames, error)

func (*ServiceWithInstrumentation) Users

func (mw *ServiceWithInstrumentation) Users(ctx context.Context, search string, first uint64, after *string) (nakama.UserProfiles, error)
func (mw *ServiceWithInstrumentation) VerifyMagicLink(ctx context.Context, email, code string, username *string) (nakama.AuthOutput, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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