Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
type Repository interface { Name() string NumUsers(ctx context.Context) (int64, error) Users(ctx context.Context) iter.Seq2[sako.User, error] GetUser(ctx context.Context, name string) (sako.User, error) AddUser(ctx context.Context, usr sako.User, pwd string) (sako.User, error) DelUser(ctx context.Context, uid sako.UserID) error NumEntries(ctx context.Context, uid sako.UserID, opts ...sako.FilterOptions) (int64, error) Entries(ctx context.Context, uid sako.UserID, opts ...sako.FilterOptions) iter.Seq2[sako.Entry, error] GetEntry(ctx context.Context, id sako.EntryID) (sako.Entry, error) AddEntry(ctx context.Context, e sako.Entry) (sako.Entry, error) PutEntry(ctx context.Context, e sako.Entry) error HasEntry(ctx context.Context, uid sako.UserID, hashURL string) (sako.EntryID, error) DelEntry(ctx context.Context, uid sako.UserID, id sako.EntryID) error NumTags(ctx context.Context, uid sako.UserID) (int64, error) Tags(ctx context.Context, uid sako.UserID) iter.Seq2[sako.Tag, error] GetTags(ctx context.Context, uid sako.UserID, id sako.EntryID) iter.Seq2[sako.Tag, error] AddTags(ctx context.Context, uid sako.UserID, id sako.EntryID, tags ...string) error DelTags(ctx context.Context, uid sako.UserID, id sako.EntryID, tags ...sako.TagID) error NumAnnotations(ctx context.Context, id sako.EntryID) (int64, error) Annotations(ctx context.Context, id sako.EntryID) iter.Seq2[sako.Annotation, error] GetAnnotation(ctx context.Context, id sako.AnnotationID) (sako.Annotation, error) AddAnnotation(ctx context.Context, id sako.EntryID, ann sako.Annotation) error DelAnnotation(ctx context.Context, id sako.AnnotationID) error GetTaggingRules(ctx context.Context, uid sako.UserID) ([]sako.TaggingRule, error) AddTaggingRules(ctx context.Context, uid sako.UserID, rules []sako.TaggingRule) error PutTaggingRule(ctx context.Context, uid sako.UserID, rule sako.TaggingRule) error Do(ctx context.Context, f func(tx *sql.Tx) error) error io.Closer }
Repository represents the operations available on a sako repository of articles.
func Open ¶
func Open(uri string) (Repository, error)
Open opens a repository via an already registered repository driver.
Click to show internal directories.
Click to hide internal directories.