repository

package
v0.0.0-...-c4b140d Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContactNotFound = errors.New("contact not found")
View Source
var ErrLinkSuggestionNotFound = errors.New("link suggestion not found")

Functions

This section is empty.

Types

type IContact

type IContact interface {
	//Get
	GetAllContacts(context.Context, domain.UserID) ([]domain.Contact, error)

	GetContacts(ctx context.Context, uID domain.UserID, limit int, lastDocumentId *domain.ContactID) ([]domain.Contact, error)
	GetContactByID(context.Context, domain.UserID, domain.ContactID) (*domain.Contact, error)
	GetContactsByNextContact(ctx context.Context, user domain.UserID, before time.Time, limit int, lastDocumentInstant *time.Time, lastDocumentId *domain.ContactID) ([]domain.Contact, error)
	GetContactsByLastContact(ctx context.Context, user domain.UserID, after time.Time, limit int, lastDocumentInstant *time.Time, lastDocumentId *domain.ContactID) ([]domain.Contact, error)
	//Patch
	UpdateContact(context.Context, domain.UserID, domain.ContactID, *domain.Contact) error

	//Save
	SaveContact(context.Context, domain.UserID, domain.Contact) (*domain.Contact, error)

	//Delete
	DeleteContact(ctx context.Context, id domain.UserID, contactID domain.ContactID) error

	DeleteAllContacts(ctx context.Context, uID domain.UserID) error
}

type IContactLog

type IContactLog interface {
	Create(ctx context.Context, userId domain.UserID, log domain.ContactLog) (created *domain.ContactLog, err error)
	Save(ctx context.Context, userId domain.UserID, id domain.ContactLogId, update domain.ContactLog) (err error)
	GetById(ctx context.Context, userId domain.UserID, id domain.ContactLogId) (log domain.ContactLog, err error)
	GetByUnifiedId(ctx context.Context, userId domain.UserID, unifiedId domain.UnifiedId) (log []domain.ContactLog, err error)
	Get(ctx context.Context, id domain.UserID, limit int, lastDocumentId *domain.ContactLogId) ([]domain.ContactLog, error)
	Delete(ctx context.Context, userId domain.UserID, id domain.ContactLogId) error
}

type IContactSource

type IContactSource interface {
	GetByEmail(ctx context.Context, id domain.UserID, email string, source domain.Source) (cs *domain.ContactSource, err error)
	Create(ctx context.Context, id domain.UserID, source domain.ContactSource) (created *domain.ContactSource, err error)
	GetAll(ctx context.Context, id domain.UserID) (sources []domain.ContactSource, err error)
	Get(ctx context.Context, id domain.UserID, limit int, lastDocumentId *domain.ContactSourceID) (sources []domain.ContactSource, err error)
	GetById(ctx context.Context, id domain.UserID, sourceId domain.ContactSourceID) (source domain.ContactSource, err error)
	Delete(ctx context.Context, id domain.UserID, sourceId domain.ContactSourceID) error
	UpdateByMap(ctx context.Context, uID domain.UserID, cID domain.ContactSourceID, updates map[string]interface{}) (err error)
	GetByNextUpdateAt(ctx context.Context, before time.Time) (sources []domain.ContactSource, err error)
}

type IGoogleContacts

type IGoogleContacts interface {
	Create(ctx context.Context, id domain.UserID, sourceId domain.ContactSourceID, personId string, contact domain.GoogleContact) (created *domain.GoogleContact, err error)
	Get(ctx context.Context, id domain.UserID, sourceId domain.ContactSourceID, personId string) (contact domain.GoogleContact, err error)
	Update(ctx context.Context, id domain.UserID, sourceId domain.ContactSourceID, personId string, contact domain.GoogleContact) (err error)
	List(ctx context.Context, id domain.UserID, sourceId domain.ContactSourceID, limit int, lastDocumentId *string) (sources []domain.GoogleContact, err error)
}

type ILinkSuggestion

type ILinkSuggestion interface {
	Create(ctx context.Context, userId domain.UserID, suggestion domain.LinkSuggestion) (created *domain.LinkSuggestion, err error)
	Save(ctx context.Context, userId domain.UserID, id domain.LinkSuggestionID, suggestion domain.LinkSuggestion) (err error)
	GetById(ctx context.Context, userId domain.UserID, id domain.LinkSuggestionID) (link domain.LinkSuggestion, err error)
	GetByKeyValue(ctx context.Context, userId domain.UserID, key domain.LinkSuggestionKey, value string) (link domain.LinkSuggestion, err error)
	GetAll(ctx context.Context, id domain.UserID) (suggestions []domain.LinkSuggestion, err error)
	Get(ctx context.Context, id domain.UserID, limit int, lastDocumentId *domain.LinkSuggestionID) ([]domain.LinkSuggestion, error)
	Delete(ctx context.Context, userId domain.UserID, id domain.LinkSuggestionID) error
}

type INote

type INote interface {
	//Get
	GetNoteByID(ctx context.Context, uID domain.UserID, cID domain.UnifiedId, nID domain.NoteID) (*domain.Note, error)
	GetAllNotes(context.Context, domain.UserID, domain.UnifiedId) ([]domain.Note, error)
	GetNotes(ctx context.Context, userId domain.UserID, contactId domain.UnifiedId, limit int, lastDocumentId *domain.NoteID) ([]domain.Note, error)

	//Patch
	UpdateNote(context.Context, domain.UserID, domain.UnifiedId, domain.NoteID, domain.Note) error

	//Save
	SaveNote(context.Context, domain.UserID, domain.UnifiedId, domain.Note) (note *domain.Note, err error)

	//Delete
	DeleteNote(context.Context, domain.UserID, domain.UnifiedId, domain.NoteID) error
	DeleteAllNotes(context.Context, domain.UserID, domain.UnifiedId) (err error)
}

type ITag

type ITag interface {
	//Get
	GetTagByID(ctx context.Context, uID domain.UserID, cID domain.UnifiedId, nID domain.TagID) (*domain.Tag, error)
	GetAllTags(context.Context, domain.UserID, domain.UnifiedId) ([]domain.Tag, error)
	GetTags(ctx context.Context, userId domain.UserID, contactId domain.UnifiedId, limit int, lastDocumentId *domain.TagID) ([]domain.Tag, error)

	//Patch
	UpdateTag(context.Context, domain.UserID, domain.UnifiedId, domain.TagID, domain.Tag) error

	//Save
	SaveTag(context.Context, domain.UserID, domain.UnifiedId, domain.Tag) (note *domain.Tag, err error)

	//Delete
	DeleteTag(context.Context, domain.UserID, domain.UnifiedId, domain.TagID) error
	DeleteAllTags(context.Context, domain.UserID, domain.UnifiedId) error
}

type IUnified

type IUnified interface {
	//Get
	GetAllContacts(context.Context, domain.UserID) ([]domain.Unified, error)

	GetContacts(ctx context.Context, uID domain.UserID, limit int, lastDocumentId *domain.UnifiedId) ([]domain.Unified, error)
	GetContactByID(context.Context, domain.UserID, domain.UnifiedId) (*domain.Unified, error)
	GetByIDs(ctx context.Context, uID domain.UserID, unifiedIds []domain.UnifiedId) (users []domain.Unified, err error)

	GetContactsByNextContact(ctx context.Context, user domain.UserID, before time.Time, limit int, lastDocumentInstant *time.Time, lastDocumentId *domain.UnifiedId) ([]domain.Unified, error)
	GetContactsByLastContact(ctx context.Context, user domain.UserID, after time.Time, limit int, lastDocumentInstant *time.Time, lastDocumentId *domain.UnifiedId) ([]domain.Unified, error)
	GetContactByOrigin(ctx context.Context, uID domain.UserID, origin domain.ContactOrigin) (unified domain.Unified, err error)
	GetContactBySearchTerms(ctx context.Context, uID domain.UserID, terms []string) (contacts []domain.Unified, err error)
	//Patch
	UpdateContact(context.Context, domain.UserID, domain.UnifiedId, *domain.Unified) error

	//Save
	SaveContact(context.Context, domain.UserID, domain.Unified) (*domain.Unified, error)

	//Delete
	DeleteContact(ctx context.Context, id domain.UserID, contactID domain.UnifiedId) error

	DeleteAllContacts(ctx context.Context, uID domain.UserID) error

	BulkDeleteContacts(ctx context.Context, uID domain.UserID, contactIDs []domain.UnifiedId) (err error)
	BulkUpdateContacts(ctx context.Context, uID domain.UserID, updates map[domain.UnifiedId]*domain.Unified) (err error)
}

type IUser

type IUser interface {
	//Get
	GetUserByID(context.Context, domain.UserID) (*domain.User, error)

	//Patch
	UpdateUser(context.Context, domain.UserID, domain.User) error

	//Save
	SaveUser(context.Context, domain.UserID, domain.User) (created *domain.User, err error)

	//Delete
	DeleteUser(ctx context.Context, uID domain.UserID) error
}

Jump to

Keyboard shortcuts

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