Documentation ¶
Index ¶
- type Store
- 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
- type Tag
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 has methods that know how to interact with docshelf data in Dynamo.
func (Store) GetDoc ¶
GetDoc fetches a docshelf Document from dynamodb. It will also read and package the Content form an underlying FileStore.
func (Store) ListDocs ¶
ListDocs fetches a slice of docshelf Document metadata from dynamodb. 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 dynamodb. 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 dynamo.
func (Store) RemoveDoc ¶
RemoveDoc removes a docshelf Doc from dynamo as well as the underlying FileStore.
func (Store) RemoveGroup ¶
RemoveGroup deletes a docshelf Group from dynamo.
func (Store) RemovePolicy ¶
RemovePolicy deletes a policy from dynamo.
func (Store) RemoveUser ¶
RemoveUser marks a user as deleted in boltdb. TODO (erik): Right now this is pretty lazy. Should come back and write the expression to update only the DeletedAt field rather than overwriting the entire Item.