Documentation ¶
Index ¶
- func Create(ctx context.Context, s store.Storer, r FlaggedResource, ownedBy uint64, ...) error
- func Delete(ctx context.Context, s store.Storer, r FlaggedResource, ownedBy uint64, ...) error
- func Load(ctx context.Context, s store.Storer, incFlags uint, userID uint64, ...) error
- func Search(ctx context.Context, s store.Storer, owner uint64, kind string, ...) ([]uint64, error)
- type FlaggedResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(ctx context.Context, s store.Storer, r FlaggedResource, ownedBy uint64, flag string) error
Create creates a new flag for the given resource
If that flag for that owner for this resource already exists, it's skipped. Access control and any other validations should be performed by the caller.
func Delete ¶
func Delete(ctx context.Context, s store.Storer, r FlaggedResource, ownedBy uint64, flag string) error
Delete removes the flag from this resource
Access control and any other validations should be performed by the caller.
This operation has two outcomes:
- if we are removing a flag defined for a specifc user, it is deleted
- if we are removing a flag defined globally (no owner), we create a new inactive flag
func Load ¶
func Load(ctx context.Context, s store.Storer, incFlags uint, userID uint64, rr ...FlaggedResource) error
Load updates the provided resources with storreed flags
1. All global flags for this resource are fetched 2. All user-specifc flags for this resource are fetched, overwriting global flags
Types ¶
Click to show internal directories.
Click to hide internal directories.