Documentation ¶
Index ¶
- func AddBacklinks(ctx context.Context, content string, links []string) (newContent string, err error)
- func AddLinks(ctx context.Context, content string, links []string) (newContent string, err error)
- func AddTags(ctx context.Context, content string, tags []string) (newContent string, err error)
- func GetAddedBacklinks(old *domain.Document, new *domain.Document) (addedBacklinkIDs []int64, err error)
- func GetAddedLinks(old *domain.Document, new *domain.Document) (addedLinkIDs []int64, err error)
- func GetAddedTags(old *domain.Document, new *domain.Document) (addedTagIDs []int64, err error)
- func GetRemovedBacklinks(old *domain.Document, new *domain.Document) (removedBacklinkIDs []int64, err error)
- func GetRemovedLinks(old *domain.Document, new *domain.Document) (removedLinkIDs []int64, err error)
- func GetRemovedTags(old *domain.Document, new *domain.Document) (removedTagIDs []int64, err error)
- func RemoveBacklinks(ctx context.Context, content string, links []string) (newContent string, err error)
- func RemoveLinks(ctx context.Context, content string, links []string) (newContent string, err error)
- func RemoveTags(ctx context.Context, content string, tags []string) (newContent string, err error)
- type BacklinksHeaderNotFoundError
- type DocumentContentEntity
- type DocumentContentManager
- func (m *DocumentContentManager) Add(ctx context.Context, pathContents []tuple.T2[string, string]) error
- func (m *DocumentContentManager) AddBackLinks(ctx context.Context, pathBacklinks []tuple.T2[string, []string]) error
- func (m *DocumentContentManager) AddLinks(ctx context.Context, pathLinks []tuple.T2[string, []string]) error
- func (m *DocumentContentManager) AddTags(ctx context.Context, pathTags []tuple.T2[string, []string]) error
- func (m *DocumentContentManager) Delete(ctx context.Context, paths []string) error
- func (m *DocumentContentManager) Get(ctx context.Context, paths []string) (contents []string, err error)
- func (m *DocumentContentManager) Move(ctx context.Context, pathChanges []tuple.T2[string, string]) error
- func (m *DocumentContentManager) RemoveBackLinks(ctx context.Context, pathBacklinks []tuple.T2[string, []string]) error
- func (m *DocumentContentManager) RemoveLinks(ctx context.Context, pathLinks []tuple.T2[string, []string]) error
- func (m *DocumentContentManager) RemoveTags(ctx context.Context, pathTags []tuple.T2[string, []string]) error
- func (m *DocumentContentManager) Update(ctx context.Context, pathContents []tuple.T2[string, string]) error
- func (m *DocumentContentManager) UpdateDocumentContentsFromFilterAndUpdater(ctx context.Context, filter *domain.DocumentFilter, ...) error
- func (m *DocumentContentManager) UpdateDocumentContentsFromNewModels(ctx context.Context, newDocuments []*domain.Document, ...) error
- type DocumentManager
- func (m *DocumentManager) Add(ctx context.Context, documents []*domain.Document) error
- func (m *DocumentManager) AddType(ctx context.Context, types []string) error
- func (m *DocumentManager) CountAll(ctx context.Context) (numRecords int64, err error)
- func (m *DocumentManager) CountWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (numRecords int64, err error)
- func (m *DocumentManager) Delete(ctx context.Context, documents []*domain.Document) error
- func (m *DocumentManager) DeleteType(ctx context.Context, types []string) error
- func (m *DocumentManager) DeleteWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (numAffectedRecords int64, err error)
- func (m *DocumentManager) DoesExist(ctx context.Context, document *domain.Document) (doesExist bool, err error)
- func (m *DocumentManager) DoesExistWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (doesExist bool, err error)
- func (m *DocumentManager) GetAll(ctx context.Context) (records []*domain.Document, err error)
- func (m *DocumentManager) GetAllTypes(ctx context.Context) ([]string, error)
- func (m *DocumentManager) GetFirstWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (record *domain.Document, err error)
- func (m *DocumentManager) GetFromIDs(ctx context.Context, ids []int64) (records []*domain.Document, err error)
- func (m *DocumentManager) GetWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (records []*domain.Document, err error)
- func (m *DocumentManager) Replace(ctx context.Context, documents []*domain.Document) error
- func (m *DocumentManager) Update(ctx context.Context, documents []*domain.Document, ...) error
- func (m *DocumentManager) UpdateType(ctx context.Context, oldType string, newType string) error
- func (m *DocumentManager) UpdateWhere(ctx context.Context, documentFilter *domain.DocumentFilter, ...) (numAffectedRecords int64, err error)
- func (m *DocumentManager) Upsert(ctx context.Context, documents []*domain.Document) error
- type DocumentSyntaxError
- type EmptyEntitiesListError
- type LinksHeaderNotFoundError
- type TagsHeaderNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBacklinks ¶
func GetAddedBacklinks ¶
func GetAddedLinks ¶
func GetAddedTags ¶
func GetRemovedBacklinks ¶
func GetRemovedLinks ¶
func GetRemovedTags ¶
func RemoveBacklinks ¶
func RemoveLinks ¶
Types ¶
type BacklinksHeaderNotFoundError ¶ added in v0.6.0
type BacklinksHeaderNotFoundError struct {
Inner error
}
func (BacklinksHeaderNotFoundError) As ¶ added in v0.6.0
func (err BacklinksHeaderNotFoundError) As(target any) bool
func (BacklinksHeaderNotFoundError) Error ¶ added in v0.6.0
func (err BacklinksHeaderNotFoundError) Error() string
func (BacklinksHeaderNotFoundError) Is ¶ added in v0.6.0
func (err BacklinksHeaderNotFoundError) Is(other error) bool
func (BacklinksHeaderNotFoundError) Unwrap ¶ added in v0.6.0
func (err BacklinksHeaderNotFoundError) Unwrap() error
type DocumentContentEntity ¶ added in v0.6.0
type DocumentContentEntity string
const ( DocumentContentEntityTag DocumentContentEntity = "tag" DocumentContentEntityLink DocumentContentEntity = "link" DocumentContentEntityBacklink DocumentContentEntity = "backlink" )
type DocumentContentManager ¶
type DocumentContentManager struct { Repository repository.DocumentContentRepository Hooks *bntp.Hooks[string] Logger *log.Logger }
func NewDocumentContentManager ¶ added in v0.6.0
func NewDocumentContentManager(logger *log.Logger, hooks *bntp.Hooks[string], repository repository.DocumentContentRepository) (DocumentContentManager, error)
func (*DocumentContentManager) Add ¶
func (m *DocumentContentManager) Add(ctx context.Context, pathContents []tuple.T2[string, string]) error
TODO: Allow skipping certain hooks. TODO: Implement context handling.
func (*DocumentContentManager) AddBackLinks ¶
func (*DocumentContentManager) Delete ¶
func (m *DocumentContentManager) Delete(ctx context.Context, paths []string) error
func (*DocumentContentManager) RemoveBackLinks ¶
func (*DocumentContentManager) RemoveLinks ¶
func (*DocumentContentManager) RemoveTags ¶
func (*DocumentContentManager) UpdateDocumentContentsFromFilterAndUpdater ¶
func (m *DocumentContentManager) UpdateDocumentContentsFromFilterAndUpdater(ctx context.Context, filter *domain.DocumentFilter, updater *domain.DocumentUpdater, documentManager *DocumentManager) error
TODO: This mess needs a lot of cleaning up
func (*DocumentContentManager) UpdateDocumentContentsFromNewModels ¶
func (m *DocumentContentManager) UpdateDocumentContentsFromNewModels(ctx context.Context, newDocuments []*domain.Document, documentManager *DocumentManager) error
type DocumentManager ¶
type DocumentManager struct { Repository repository.DocumentRepository Hooks *bntp.Hooks[domain.Document] Logger *log.Logger }
func NewDocumentManager ¶
func NewDocumentManager(logger *log.Logger, hooks *bntp.Hooks[domain.Document], repository repository.DocumentRepository) (DocumentManager, error)
func (*DocumentManager) AddType ¶
func (m *DocumentManager) AddType(ctx context.Context, types []string) error
func (*DocumentManager) CountAll ¶
func (m *DocumentManager) CountAll(ctx context.Context) (numRecords int64, err error)
func (*DocumentManager) CountWhere ¶
func (m *DocumentManager) CountWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (numRecords int64, err error)
func (*DocumentManager) DeleteType ¶
func (m *DocumentManager) DeleteType(ctx context.Context, types []string) error
func (*DocumentManager) DeleteWhere ¶
func (m *DocumentManager) DeleteWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (numAffectedRecords int64, err error)
func (*DocumentManager) DoesExistWhere ¶
func (m *DocumentManager) DoesExistWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (doesExist bool, err error)
func (*DocumentManager) GetAllTypes ¶ added in v0.6.0
func (m *DocumentManager) GetAllTypes(ctx context.Context) ([]string, error)
func (*DocumentManager) GetFirstWhere ¶
func (m *DocumentManager) GetFirstWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (record *domain.Document, err error)
func (*DocumentManager) GetFromIDs ¶ added in v0.6.0
func (*DocumentManager) GetWhere ¶
func (m *DocumentManager) GetWhere(ctx context.Context, documentFilter *domain.DocumentFilter) (records []*domain.Document, err error)
func (*DocumentManager) Update ¶
func (m *DocumentManager) Update(ctx context.Context, documents []*domain.Document, documentUpdater *domain.DocumentUpdater) error
func (*DocumentManager) UpdateType ¶
func (*DocumentManager) UpdateWhere ¶
func (m *DocumentManager) UpdateWhere(ctx context.Context, documentFilter *domain.DocumentFilter, documentUpdater *domain.DocumentUpdater) (numAffectedRecords int64, err error)
type DocumentSyntaxError ¶ added in v0.6.0
type DocumentSyntaxError struct {
Inner error
}
func (DocumentSyntaxError) As ¶ added in v0.6.0
func (err DocumentSyntaxError) As(target any) bool
func (DocumentSyntaxError) Error ¶ added in v0.6.0
func (err DocumentSyntaxError) Error() string
func (DocumentSyntaxError) Is ¶ added in v0.6.0
func (err DocumentSyntaxError) Is(other error) bool
func (DocumentSyntaxError) Unwrap ¶ added in v0.6.0
func (err DocumentSyntaxError) Unwrap() error
type EmptyEntitiesListError ¶ added in v0.6.0
type EmptyEntitiesListError struct {
Entity DocumentContentEntity
}
func (EmptyEntitiesListError) As ¶ added in v0.6.0
func (err EmptyEntitiesListError) As(target any) bool
func (EmptyEntitiesListError) Error ¶ added in v0.6.0
func (err EmptyEntitiesListError) Error() string
func (EmptyEntitiesListError) Is ¶ added in v0.6.0
func (err EmptyEntitiesListError) Is(other error) bool
type LinksHeaderNotFoundError ¶ added in v0.6.0
type LinksHeaderNotFoundError struct {
Inner error
}
func (LinksHeaderNotFoundError) As ¶ added in v0.6.0
func (err LinksHeaderNotFoundError) As(target any) bool
func (LinksHeaderNotFoundError) Error ¶ added in v0.6.0
func (err LinksHeaderNotFoundError) Error() string
func (LinksHeaderNotFoundError) Is ¶ added in v0.6.0
func (err LinksHeaderNotFoundError) Is(other error) bool
func (LinksHeaderNotFoundError) Unwrap ¶ added in v0.6.0
func (err LinksHeaderNotFoundError) Unwrap() error
type TagsHeaderNotFoundError ¶ added in v0.6.0
type TagsHeaderNotFoundError struct {
Inner error
}
func (TagsHeaderNotFoundError) As ¶ added in v0.6.0
func (err TagsHeaderNotFoundError) As(target any) bool
func (TagsHeaderNotFoundError) Error ¶ added in v0.6.0
func (err TagsHeaderNotFoundError) Error() string
func (TagsHeaderNotFoundError) Is ¶ added in v0.6.0
func (err TagsHeaderNotFoundError) Is(other error) bool
func (TagsHeaderNotFoundError) Unwrap ¶ added in v0.6.0
func (err TagsHeaderNotFoundError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.