Documentation ¶
Index ¶
- type Store
- func (s Store) Close() error
- func (s Store) GetDoc(ctx context.Context, path string) (docshelf.Doc, error)
- func (s Store) GetGroup(ctx context.Context, id string) (docshelf.Group, error)
- func (s Store) GetPolicy(ctx context.Context, id string) (docshelf.Policy, error)
- func (s Store) GetUser(ctx context.Context, id string) (docshelf.User, error)
- func (s Store) ListDocs(ctx context.Context, query string, tags ...string) ([]docshelf.Doc, error)
- func (s Store) ListUsers(ctx context.Context) ([]docshelf.User, error)
- func (s Store) PutDoc(ctx context.Context, doc docshelf.Doc) (string, error)
- func (s Store) PutGroup(ctx context.Context, group docshelf.Group) (string, error)
- func (s Store) PutPolicy(ctx context.Context, policy docshelf.Policy) (string, error)
- func (s Store) PutUser(ctx context.Context, user docshelf.User) (string, error)
- func (s Store) RemoveDoc(ctx context.Context, path string) error
- func (s Store) RemoveGroup(ctx context.Context, id string) error
- func (s Store) RemovePolicy(ctx context.Context, id string) error
- func (s Store) RemoveUser(ctx context.Context, id string) error
- func (s Store) TagDoc(ctx context.Context, path string, tags ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store implements several docshelf interfaces using boltdb as the backend.
func New ¶
New returns a new boltdb Store. This Store can fulfill the interfaces for UserStore, GroupStore, DocStore, and PolicyStore.
func (Store) Close ¶
Close closes the bolt DB file. It currently omits the error for convenience, but that should maybe change in the future.
func (Store) GetDoc ¶
GetDoc fetches a docshelf Document from bolt. It will also read and package the Content from an underlying FileStore.
func (Store) ListDocs ¶
ListDocs fetches a slice of docshelf Document metadata from bolt. If a query is provided, then the configured docshelf.TextIndex will be used to get a set of document paths. If tags are also provided, then they will be used to further filter down the results. If no query is provided, but tags are, then the tags will filter down the entire set of documents stored.
func (Store) PutDoc ¶
PutDoc creates or updates an existing docshelf Doc in bolt. It will also store the Content in an underlying FileStore.
func (Store) PutPolicy ¶
PutPolicy creates a new docshelf Policy or updates an existing one in boltdb.
func (Store) RemoveDoc ¶
RemoveDoc removes a docshelf Doc from bolt as well as the underlying FileStore.
func (Store) RemoveGroup ¶
RemoveGroup deletes a docshelf Group from boltdb.
func (Store) RemovePolicy ¶
RemovePolicy deletes a policy from boltdb.
func (Store) RemoveUser ¶
RemoveUser marks a user as deleted in boltdb.