mock

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeEngagementRepository

type FakeEngagementRepository struct {
	GetFeedFn func(
		ctx context.Context,
		uid *string,
		isAnonymous *bool,
		flavour feedlib.Flavour,
		persistent feedlib.BooleanFilter,
		status *feedlib.Status,
		visibility *feedlib.Visibility,
		expired *feedlib.BooleanFilter,
		filterParams *helpers.FilterParams,
	) (*domain.Feed, error)

	// getting a the LATEST VERSION of a feed item from a feed
	GetFeedItemFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		itemID string,
	) (*feedlib.Item, error)

	// saving a new feed item
	SaveFeedItemFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		item *feedlib.Item,
	) (*feedlib.Item, error)

	// updating an existing feed item
	UpdateFeedItemFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		item *feedlib.Item,
	) (*feedlib.Item, error)

	// DeleteFeedItem permanently deletes a feed item and it's copies
	DeleteFeedItemFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		itemID string,
	) error

	// getting THE LATEST VERSION OF a nudge from a feed
	GetNudgeFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		nudgeID string,
	) (*feedlib.Nudge, error)

	// saving a new modified nudge
	SaveNudgeFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		nudge *feedlib.Nudge,
	) (*feedlib.Nudge, error)

	// updating an existing nudge
	UpdateNudgeFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		nudge *feedlib.Nudge,
	) (*feedlib.Nudge, error)

	// DeleteNudge permanently deletes a nudge and it's copies
	DeleteNudgeFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		nudgeID string,
	) error

	// getting THE LATEST VERSION OF a single action
	GetActionFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		actionID string,
	) (*feedlib.Action, error)

	// saving a new action
	SaveActionFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		action *feedlib.Action,
	) (*feedlib.Action, error)

	// DeleteAction permanently deletes an action and it's copies
	DeleteActionFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		actionID string,
	) error

	// PostMessage posts a message or a reply to a message/thread
	PostMessageFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		itemID string,
		message *feedlib.Message,
	) (*feedlib.Message, error)

	// GetMessage retrieves THE LATEST VERSION OF a message
	GetMessageFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		itemID string,
		messageID string,
	) (*feedlib.Message, error)

	// DeleteMessage deletes a message
	DeleteMessageFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		itemID string,
		messageID string,
	) error

	// GetMessages retrieves a message
	GetMessagesFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		itemID string,
	) ([]feedlib.Message, error)

	SaveIncomingEventFn func(
		ctx context.Context,
		event *feedlib.Event,
	) error

	SaveOutgoingEventFn func(
		ctx context.Context,
		event *feedlib.Event,
	) error

	GetNudgesFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		status *feedlib.Status,
		visibility *feedlib.Visibility,
		expired *feedlib.BooleanFilter,
	) ([]feedlib.Nudge, error)

	GetActionsFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
	) ([]feedlib.Action, error)

	GetItemsFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		persistent feedlib.BooleanFilter,
		status *feedlib.Status,
		visibility *feedlib.Visibility,
		expired *feedlib.BooleanFilter,
		filterParams *helpers.FilterParams,
	) ([]feedlib.Item, error)

	LabelsFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
	) ([]string, error)

	SaveLabelFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		label string,
	) error

	UnreadPersistentItemsFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
	) (int, error)

	UpdateUnreadPersistentItemsCountFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
	) error

	GetDefaultNudgeByTitleFn func(
		ctx context.Context,
		uid string,
		flavour feedlib.Flavour,
		title string,
	) (*feedlib.Nudge, error)

	SaveTwilioResponseFn func(
		ctx context.Context,
		data dto.Message,
	) error

	SaveNotificationFn func(
		ctx context.Context,
		firestoreClient *firestore.Client,
		notification dto.SavedNotification,
	) error

	RetrieveNotificationFn func(
		ctx context.Context,
		firestoreClient *firestore.Client,
		registrationToken string,
		newerThan time.Time,
		limit int,
	) ([]*dto.SavedNotification, error)

	SaveNPSResponseFn func(
		ctx context.Context,
		response *dto.NPSResponse,
	) error

	SaveOutgoingEmailsFn          func(ctx context.Context, payload *dto.OutgoingEmailsLog) error
	UpdateMailgunDeliveryStatusFn func(ctx context.Context, payload *dto.MailgunEvent) (*dto.OutgoingEmailsLog, error)
}

FakeEngagementRepository is a mock engagement repository

func (*FakeEngagementRepository) DeleteAction

func (f *FakeEngagementRepository) DeleteAction(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	actionID string,
) error

DeleteAction permanently deletes an action and it's copies

func (*FakeEngagementRepository) DeleteFeedItem

func (f *FakeEngagementRepository) DeleteFeedItem(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	itemID string,
) error

DeleteFeedItem permanently deletes a feed item and it's copies

func (*FakeEngagementRepository) DeleteMessage

func (f *FakeEngagementRepository) DeleteMessage(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	itemID string,
	messageID string,
) error

DeleteMessage deletes a message

func (*FakeEngagementRepository) DeleteNudge

func (f *FakeEngagementRepository) DeleteNudge(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	nudgeID string,
) error

DeleteNudge permanently deletes a nudge and it's copies

func (*FakeEngagementRepository) GetAction

func (f *FakeEngagementRepository) GetAction(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	actionID string,
) (*feedlib.Action, error)

GetAction gets THE LATEST VERSION OF a single action

func (*FakeEngagementRepository) GetActions

func (f *FakeEngagementRepository) GetActions(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
) ([]feedlib.Action, error)

GetActions ...

func (*FakeEngagementRepository) GetDefaultNudgeByTitle

func (f *FakeEngagementRepository) GetDefaultNudgeByTitle(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	title string,
) (*feedlib.Nudge, error)

GetDefaultNudgeByTitle ...

func (*FakeEngagementRepository) GetFeed

func (f *FakeEngagementRepository) GetFeed(
	ctx context.Context,
	uid *string,
	isAnonymous *bool,
	flavour feedlib.Flavour,
	persistent feedlib.BooleanFilter,
	status *feedlib.Status,
	visibility *feedlib.Visibility,
	expired *feedlib.BooleanFilter,
	filterParams *helpers.FilterParams,
) (*domain.Feed, error)

GetFeed ...

func (*FakeEngagementRepository) GetFeedItem

func (f *FakeEngagementRepository) GetFeedItem(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	itemID string,
) (*feedlib.Item, error)

GetFeedItem ...

func (*FakeEngagementRepository) GetItems

func (f *FakeEngagementRepository) GetItems(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	persistent feedlib.BooleanFilter,
	status *feedlib.Status,
	visibility *feedlib.Visibility,
	expired *feedlib.BooleanFilter,
	filterParams *helpers.FilterParams,
) ([]feedlib.Item, error)

GetItems ...

func (*FakeEngagementRepository) GetMessage

func (f *FakeEngagementRepository) GetMessage(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	itemID string,
	messageID string,
) (*feedlib.Message, error)

GetMessage retrieves THE LATEST VERSION OF a message

func (*FakeEngagementRepository) GetMessages

func (f *FakeEngagementRepository) GetMessages(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	itemID string,
) ([]feedlib.Message, error)

GetMessages retrieves a message

func (*FakeEngagementRepository) GetNudge

func (f *FakeEngagementRepository) GetNudge(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	nudgeID string,
) (*feedlib.Nudge, error)

GetNudge gets THE LATEST VERSION OF a nudge from a feed

func (*FakeEngagementRepository) GetNudges

func (f *FakeEngagementRepository) GetNudges(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	status *feedlib.Status,
	visibility *feedlib.Visibility,
	expired *feedlib.BooleanFilter,
) ([]feedlib.Nudge, error)

GetNudges ...

func (*FakeEngagementRepository) Labels

func (f *FakeEngagementRepository) Labels(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
) ([]string, error)

Labels ...

func (*FakeEngagementRepository) PostMessage

func (f *FakeEngagementRepository) PostMessage(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	itemID string,
	message *feedlib.Message,
) (*feedlib.Message, error)

PostMessage posts a message or a reply to a message/thread

func (*FakeEngagementRepository) RetrieveNotification

func (f *FakeEngagementRepository) RetrieveNotification(
	ctx context.Context,
	firestoreClient *firestore.Client,
	registrationToken string,
	newerThan time.Time,
	limit int,
) ([]*dto.SavedNotification, error)

RetrieveNotification retrieves a notification

func (*FakeEngagementRepository) SaveAction

func (f *FakeEngagementRepository) SaveAction(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	action *feedlib.Action,
) (*feedlib.Action, error)

SaveAction saves a new action

func (*FakeEngagementRepository) SaveFeedItem

func (f *FakeEngagementRepository) SaveFeedItem(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	item *feedlib.Item,
) (*feedlib.Item, error)

SaveFeedItem ...

func (*FakeEngagementRepository) SaveIncomingEvent

func (f *FakeEngagementRepository) SaveIncomingEvent(
	ctx context.Context,
	event *feedlib.Event,
) error

SaveIncomingEvent ...

func (*FakeEngagementRepository) SaveLabel

func (f *FakeEngagementRepository) SaveLabel(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	label string,
) error

SaveLabel ...

func (*FakeEngagementRepository) SaveNPSResponse

func (f *FakeEngagementRepository) SaveNPSResponse(
	ctx context.Context,
	response *dto.NPSResponse,
) error

SaveNPSResponse saves a NPS response

func (*FakeEngagementRepository) SaveNotification

func (f *FakeEngagementRepository) SaveNotification(
	ctx context.Context,
	firestoreClient *firestore.Client,
	notification dto.SavedNotification,
) error

SaveNotification saves a notification

func (*FakeEngagementRepository) SaveNudge

func (f *FakeEngagementRepository) SaveNudge(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	nudge *feedlib.Nudge,
) (*feedlib.Nudge, error)

SaveNudge saves a new modified nudge

func (*FakeEngagementRepository) SaveOutgoingEmails

func (f *FakeEngagementRepository) SaveOutgoingEmails(ctx context.Context, payload *dto.OutgoingEmailsLog) error

SaveOutgoingEmails ...

func (*FakeEngagementRepository) SaveOutgoingEvent

func (f *FakeEngagementRepository) SaveOutgoingEvent(
	ctx context.Context,
	event *feedlib.Event,
) error

SaveOutgoingEvent ...

func (*FakeEngagementRepository) SaveTwilioResponse

func (f *FakeEngagementRepository) SaveTwilioResponse(
	ctx context.Context,
	data dto.Message,
) error

SaveTwilioResponse saves the callback data for future analysis

func (*FakeEngagementRepository) UnreadPersistentItems

func (f *FakeEngagementRepository) UnreadPersistentItems(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
) (int, error)

UnreadPersistentItems ...

func (*FakeEngagementRepository) UpdateFeedItem

func (f *FakeEngagementRepository) UpdateFeedItem(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	item *feedlib.Item,
) (*feedlib.Item, error)

UpdateFeedItem ...

func (*FakeEngagementRepository) UpdateMailgunDeliveryStatus

func (f *FakeEngagementRepository) UpdateMailgunDeliveryStatus(ctx context.Context, payload *dto.MailgunEvent) (*dto.OutgoingEmailsLog, error)

UpdateMailgunDeliveryStatus ...

func (*FakeEngagementRepository) UpdateNudge

func (f *FakeEngagementRepository) UpdateNudge(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
	nudge *feedlib.Nudge,
) (*feedlib.Nudge, error)

UpdateNudge updates an existing nudge

func (*FakeEngagementRepository) UpdateUnreadPersistentItemsCount

func (f *FakeEngagementRepository) UpdateUnreadPersistentItemsCount(
	ctx context.Context,
	uid string,
	flavour feedlib.Flavour,
) error

UpdateUnreadPersistentItemsCount ...

Jump to

Keyboard shortcuts

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