Documentation ¶
Index ¶
- func InitRepositoryProvider(databaseProvider string)
- type FavoritesDBStore
- func (p *FavoritesDBStore) Delete(userGUID string, guid string) error
- func (p *FavoritesDBStore) DeleteFromEndpoint(endpointGUID string) error
- func (p *FavoritesDBStore) List(userGUID string) ([]*UserFavoriteRecord, error)
- func (p *FavoritesDBStore) Save(favoriteRecord UserFavoriteRecord) (*UserFavoriteRecord, error)
- func (p *FavoritesDBStore) SetMetadata(userGUID string, guid string, metadata string) error
- type FavoritesStore
- type UserFavoriteRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRepositoryProvider ¶
func InitRepositoryProvider(databaseProvider string)
InitRepositoryProvider - One time init for the given DB Provider
Types ¶
type FavoritesDBStore ¶
type FavoritesDBStore struct {
// contains filtered or unexported fields
}
FavoritesDBStore is a DB-backed User Favorites repository
func (*FavoritesDBStore) Delete ¶
func (p *FavoritesDBStore) Delete(userGUID string, guid string) error
Delete will delete a User Favorite from the datastore
func (*FavoritesDBStore) DeleteFromEndpoint ¶
func (p *FavoritesDBStore) DeleteFromEndpoint(endpointGUID string) error
DeleteFromEndpoint will remove all favorites for a given endpoint guid
func (*FavoritesDBStore) List ¶
func (p *FavoritesDBStore) List(userGUID string) ([]*UserFavoriteRecord, error)
List - Returns a list of all user favorites
func (*FavoritesDBStore) Save ¶
func (p *FavoritesDBStore) Save(favoriteRecord UserFavoriteRecord) (*UserFavoriteRecord, error)
Save will persist a User Favorite to a datastore
func (*FavoritesDBStore) SetMetadata ¶
func (p *FavoritesDBStore) SetMetadata(userGUID string, guid string, metadata string) error
SetMetadata will set the metadata for a User Favorite from the datastore
type FavoritesStore ¶
type FavoritesStore interface { List(userGUID string) ([]*UserFavoriteRecord, error) Delete(userGUID string, guid string) error Save(favoriteRecord UserFavoriteRecord) (*UserFavoriteRecord, error) SetMetadata(userGUID string, guid string, metadata string) error DeleteFromEndpoint(endpointGUID string) error }
FavoritesStore is the user favorites repository
func NewFavoritesDBStore ¶
func NewFavoritesDBStore(dcp *sql.DB) (FavoritesStore, error)
NewFavoritesDBStore will create a new instance of the FavoritesDBStore
type UserFavoriteRecord ¶
Click to show internal directories.
Click to hide internal directories.