Documentation
¶
Overview ¶
Package manager coordinates the various boxes and indexes of a Zettelstore.
Index ¶
- func Connect(u *url.URL, authManager auth.BaseManager, cdata *ConnectData) (box.ManagedBox, error)
- func NewZidMapper(fetcher zidfetcher) *zidMapper
- func Register(scheme string, create createFunc)
- type ConnectData
- type ErrInvalidScheme
- type Manager
- func (mgr *Manager) AllowRenameZettel(ctx context.Context, zid id.Zid) bool
- func (mgr *Manager) CanCreateZettel(ctx context.Context) bool
- func (mgr *Manager) CanDeleteZettel(ctx context.Context, zid id.Zid) bool
- func (mgr *Manager) CanUpdateZettel(ctx context.Context, zettel zettel.Zettel) bool
- func (mgr *Manager) CreateZettel(ctx context.Context, zettel zettel.Zettel) (id.Zid, error)
- func (mgr *Manager) DeleteZettel(ctx context.Context, zid id.Zid) error
- func (mgr *Manager) Dump(w io.Writer)
- func (mgr *Manager) Enrich(ctx context.Context, m *meta.Meta, boxNumber int)
- func (mgr *Manager) FetchZids(ctx context.Context) (*id.Set, error)
- func (mgr *Manager) GetAllZettel(ctx context.Context, zid id.Zid) ([]zettel.Zettel, error)
- func (mgr *Manager) GetMeta(ctx context.Context, zid id.Zid) (*meta.Meta, error)
- func (mgr *Manager) GetZettel(ctx context.Context, zid id.Zid) (zettel.Zettel, error)
- func (mgr *Manager) HasZettel(ctx context.Context, zid id.Zid) bool
- func (mgr *Manager) Location() string
- func (mgr *Manager) ReIndex(ctx context.Context, zid id.Zid) error
- func (mgr *Manager) ReadStats(st *box.Stats)
- func (mgr *Manager) Refresh(ctx context.Context) error
- func (mgr *Manager) RegisterObserver(f box.UpdateFunc)
- func (mgr *Manager) RenameZettel(ctx context.Context, curZid, newZid id.Zid) error
- func (mgr *Manager) SearchContains(s string) *id.Set
- func (mgr *Manager) SearchEqual(word string) *id.Set
- func (mgr *Manager) SearchPrefix(prefix string) *id.Set
- func (mgr *Manager) SearchSuffix(suffix string) *id.Set
- func (mgr *Manager) SelectMeta(ctx context.Context, metaSeq []*meta.Meta, q *query.Query) ([]*meta.Meta, error)
- func (mgr *Manager) Start(ctx context.Context) error
- func (mgr *Manager) State() box.StartState
- func (mgr *Manager) Stop(ctx context.Context)
- func (mgr *Manager) UpdateZettel(ctx context.Context, zettel zettel.Zettel) error
- type Mapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect(u *url.URL, authManager auth.BaseManager, cdata *ConnectData) (box.ManagedBox, error)
Connect returns a handle to the specified box.
func NewZidMapper ¶ added in v0.18.0
func NewZidMapper(fetcher zidfetcher) *zidMapper
NewZidMapper creates a new ZipMapper.
Types ¶
type ConnectData ¶
type ConnectData struct { Number int // number of the box, starting with 1. Config config.Config Enricher box.Enricher Notify chan<- box.UpdateInfo Mapper Mapper }
ConnectData contains all administration related values.
type ErrInvalidScheme ¶
type ErrInvalidScheme struct{ Scheme string }
ErrInvalidScheme is returned if there is no box with the given scheme.
func (*ErrInvalidScheme) Error ¶
func (err *ErrInvalidScheme) Error() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a coordinating box.
func New ¶
func New(boxURIs []*url.URL, authManager auth.BaseManager, rtConfig config.Config) (*Manager, error)
New creates a new managing box.
func (*Manager) AllowRenameZettel ¶
AllowRenameZettel returns true, if box will not disallow renaming the zettel.
func (*Manager) CanCreateZettel ¶
CanCreateZettel returns true, if box could possibly create a new zettel.
func (*Manager) CanDeleteZettel ¶
CanDeleteZettel returns true, if box could possibly delete the given zettel.
func (*Manager) CanUpdateZettel ¶
CanUpdateZettel returns true, if box could possibly update the given zettel.
func (*Manager) CreateZettel ¶
CreateZettel creates a new zettel.
func (*Manager) DeleteZettel ¶
DeleteZettel removes the zettel from the box.
func (*Manager) GetAllZettel ¶
GetAllZettel retrieves a specific zettel from all managed boxes.
func (*Manager) RegisterObserver ¶
func (mgr *Manager) RegisterObserver(f box.UpdateFunc)
RegisterObserver registers an observer that will be notified if a zettel was found to be changed.
func (*Manager) RenameZettel ¶
RenameZettel changes the current zid to a new zid.
func (*Manager) SearchContains ¶
SearchContains returns all zettel that contains the given string. The string must be normalized through Unicode NKFD, trimmed and not empty.
func (*Manager) SearchEqual ¶
SearchEqual returns all zettel that contains the given exact word. The word must be normalized through Unicode NKFD, trimmed and not empty.
func (*Manager) SearchPrefix ¶
SearchPrefix returns all zettel that have a word with the given prefix. The prefix must be normalized through Unicode NKFD, trimmed and not empty.
func (*Manager) SearchSuffix ¶
SearchSuffix returns all zettel that have a word with the given suffix. The suffix must be normalized through Unicode NKFD, trimmed and not empty.
func (*Manager) SelectMeta ¶
func (mgr *Manager) SelectMeta(ctx context.Context, metaSeq []*meta.Meta, q *query.Query) ([]*meta.Meta, error)
SelectMeta returns all zettel meta data that match the selection criteria. The result is ordered by descending zettel id.
func (*Manager) Start ¶
Start the box. Now all other functions of the box are allowed. Starting an already started box is not allowed.
func (*Manager) State ¶ added in v0.11.0
func (mgr *Manager) State() box.StartState
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package mapstore stored the index in main memory via a Go map.
|
Package mapstore stored the index in main memory via a Go map. |
Package store contains general index data for storing a zettel index.
|
Package store contains general index data for storing a zettel index. |