Documentation ¶
Index ¶
- type Persister
- func (p Persister) DeleteCategory(ctx context.Context, id uint32) error
- func (p Persister) DeleteCollection(ctx context.Context, id uint32) error
- func (p Persister) DeletePost(ctx context.Context, id uint32) error
- func (p Persister) DeleteRecord(ctx context.Context, id uint32) error
- func (p Persister) DeleteRecordHouseholdsForPost(ctx context.Context, postID uint32) error
- func (p Persister) DeleteRecordsForPost(ctx context.Context, postID uint32) error
- func (p *Persister) GetMultipleSequenceValues(cnt int) ([]uint32, error)
- func (p *Persister) GetSequenceValue() (uint32, error)
- func (p Persister) InsertCategory(ctx context.Context, in model.CategoryIn) (*model.Category, error)
- func (p Persister) InsertCollection(ctx context.Context, in model.CollectionIn) (*model.Collection, error)
- func (p Persister) InsertPost(ctx context.Context, in model.PostIn) (*model.Post, error)
- func (p Persister) InsertRecord(ctx context.Context, in model.RecordIn) (*model.Record, error)
- func (p Persister) InsertRecordHousehold(ctx context.Context, in model.RecordHouseholdIn) (*model.RecordHousehold, error)
- func (p Persister) LoadNameVariantsData(rd io.Reader, nameType model.NameType) error
- func (p Persister) LoadPlaceData(rd io.Reader) error
- func (p Persister) LoadPlaceSettingsData(rd io.Reader) error
- func (p Persister) LoadPlaceWordData(rd io.Reader) error
- func (p Persister) RetrieveUser(ctx context.Context, in model.UserIn) (*model.User, error)
- func (p Persister) SelectCategories(ctx context.Context) ([]model.Category, error)
- func (p Persister) SelectCategoriesByID(ctx context.Context, ids []uint32) ([]model.Category, error)
- func (p Persister) SelectCollections(ctx context.Context) ([]model.Collection, error)
- func (p Persister) SelectCollectionsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Collection, error)
- func (p Persister) SelectNameVariants(ctx context.Context, nameType model.NameType, name string) (*model.NameVariants, error)
- func (p Persister) SelectOneCategory(ctx context.Context, id uint32) (*model.Category, error)
- func (p Persister) SelectOneCollection(ctx context.Context, id uint32) (*model.Collection, error)
- func (p Persister) SelectOnePost(ctx context.Context, id uint32) (*model.Post, error)
- func (p Persister) SelectOneRecord(ctx context.Context, id uint32) (*model.Record, error)
- func (p Persister) SelectOneRecordHousehold(ctx context.Context, postID uint32, householdID string) (*model.RecordHousehold, error)
- func (p Persister) SelectPlace(ctx context.Context, id uint32) (*model.Place, error)
- func (p Persister) SelectPlaceSettings(ctx context.Context) (*model.PlaceSettings, error)
- func (p Persister) SelectPlaceWord(ctx context.Context, word string) (*model.PlaceWord, error)
- func (p Persister) SelectPlaceWordsByWord(ctx context.Context, words []string) ([]model.PlaceWord, error)
- func (p Persister) SelectPlacesByFullNamePrefix(ctx context.Context, prefix string, count int) ([]model.Place, error)
- func (p Persister) SelectPlacesByID(ctx context.Context, ids []uint32) ([]model.Place, error)
- func (p Persister) SelectPosts(ctx context.Context) ([]model.Post, error)
- func (p Persister) SelectRecordHouseholdsForPost(ctx context.Context, postID uint32) ([]model.RecordHousehold, error)
- func (p Persister) SelectRecordsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Record, error)
- func (p Persister) SelectRecordsForPost(ctx context.Context, postID uint32, limit int) ([]model.Record, error)
- func (p Persister) SetThroughput(readThroughput, writeThroughput int) error
- func (p Persister) UpdateCategory(ctx context.Context, id uint32, in model.Category) (*model.Category, error)
- func (p Persister) UpdateCollection(ctx context.Context, id uint32, in model.Collection) (*model.Collection, error)
- func (p Persister) UpdatePost(ctx context.Context, id uint32, in model.Post) (*model.Post, error)
- func (p Persister) UpdateRecord(ctx context.Context, id uint32, in model.Record) (*model.Record, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Persister ¶
type Persister struct {
// contains filtered or unexported fields
}
Persister persists the model objects to DynammoDB
func NewPersister ¶
NewPersister constructs a new Persister
func (Persister) DeleteCategory ¶
DeleteCategory deletes a Category
func (Persister) DeleteCollection ¶
DeleteCollection deletes a Collection
func (Persister) DeletePost ¶
DeletePost deletes a Post
func (Persister) DeleteRecord ¶
DeleteRecord deletes a Record
func (Persister) DeleteRecordHouseholdsForPost ¶
DeleteRecordHouseholdsForPost deletes the record households associated with a Post
func (Persister) DeleteRecordsForPost ¶
DeleteRecordsForPost deletes the Records associated with a Post
func (*Persister) GetMultipleSequenceValues ¶
GetMultipleSequenceValues returns a slice of unique sequence values
func (*Persister) GetSequenceValue ¶
GetSequenceValue returns a unique sequence value
func (Persister) InsertCategory ¶
func (p Persister) InsertCategory(ctx context.Context, in model.CategoryIn) (*model.Category, error)
InsertCategory inserts a CategoryBody into the database and returns the inserted Category
func (Persister) InsertCollection ¶
func (p Persister) InsertCollection(ctx context.Context, in model.CollectionIn) (*model.Collection, error)
InsertCollection inserts a Collection into the database and returns the inserted Collection
func (Persister) InsertPost ¶
InsertPost inserts a PostBody into the database and returns the inserted Post
func (Persister) InsertRecord ¶
InsertRecord inserts a RecordIn into the database and returns the inserted Record
func (Persister) InsertRecordHousehold ¶
func (p Persister) InsertRecordHousehold(ctx context.Context, in model.RecordHouseholdIn) (*model.RecordHousehold, error)
InsertRecordHousehold inserts a RecordHouseholdIn into the database and returns a RecordHousehold
func (Persister) LoadNameVariantsData ¶
LoadNameVariantsData loads name variants data in TSV format
func (Persister) LoadPlaceData ¶
LoadPlaceData loads Place data in TSV format
func (Persister) LoadPlaceSettingsData ¶
LoadPlaceSettingsData loads place settings data in TSV format
func (Persister) LoadPlaceWordData ¶
LoadPlaceWordData loads PlaceWord data in TSV format
func (Persister) RetrieveUser ¶
RetrieveUser either retrieves a user record from the database, or creates the record if it doesn't already exist.
func (Persister) SelectCategories ¶
SelectCategories loads all the categories from the database
func (Persister) SelectCategoriesByID ¶
func (p Persister) SelectCategoriesByID(ctx context.Context, ids []uint32) ([]model.Category, error)
SelectCategoriesByID selects many categories using a list of IDs
func (Persister) SelectCollections ¶
SelectCollections loads all the collections from the database
func (Persister) SelectCollectionsByID ¶
func (p Persister) SelectCollectionsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Collection, error)
SelectCollectionsByID selects many collections from a slice of IDs
func (Persister) SelectNameVariants ¶
func (p Persister) SelectNameVariants(ctx context.Context, nameType model.NameType, name string) (*model.NameVariants, error)
SelectNameVariants selects the NameVariants object if it exists or returns ErrNoRows
func (Persister) SelectOneCategory ¶
SelectOneCategory loads a single category from the database
func (Persister) SelectOneCollection ¶
SelectOneCollection loads a single collection from the database
func (Persister) SelectOnePost ¶
SelectOnePost selects a single post by ID
func (Persister) SelectOneRecord ¶
SelectOneRecord selects a single record by ID
func (Persister) SelectOneRecordHousehold ¶
func (p Persister) SelectOneRecordHousehold(ctx context.Context, postID uint32, householdID string) (*model.RecordHousehold, error)
SelectOneRecordHousehold selects one record household
func (Persister) SelectPlace ¶
SelectPlace selects a Place object by ID
func (Persister) SelectPlaceSettings ¶
SelectPlaceSettings selects the PlaceSettings object if it exists or returns ErrNoRows
func (Persister) SelectPlaceWord ¶
SelectPlaceWord selects a PlaceWord object by word
func (Persister) SelectPlaceWordsByWord ¶
func (p Persister) SelectPlaceWordsByWord(ctx context.Context, words []string) ([]model.PlaceWord, error)
SelectPlaceWordsByWord selects multiple PlaceWord objects by word
func (Persister) SelectPlacesByFullNamePrefix ¶
func (p Persister) SelectPlacesByFullNamePrefix(ctx context.Context, prefix string, count int) ([]model.Place, error)
SelectPlacesByFullNamePrefix selects multiple Place objects by a prefix
func (Persister) SelectPlacesByID ¶
SelectPlacesByID selects multiple Place objects by ID
func (Persister) SelectPosts ¶
SelectPosts selects all posts
func (Persister) SelectRecordHouseholdsForPost ¶
func (p Persister) SelectRecordHouseholdsForPost(ctx context.Context, postID uint32) ([]model.RecordHousehold, error)
SelectRecordHouseholdsForPost selects all record households for a post
func (Persister) SelectRecordsByID ¶
func (p Persister) SelectRecordsByID(ctx context.Context, ids []uint32, enforceContextSocietyMatch bool) ([]model.Record, error)
SelectRecordsByID selects many records from a slice of IDs
func (Persister) SelectRecordsForPost ¶
func (p Persister) SelectRecordsForPost(ctx context.Context, postID uint32, limit int) ([]model.Record, error)
SelectRecordsForPost selects all records for a Post This is not currently part of the persist interface, but it's here when we need it
func (Persister) SetThroughput ¶
SetThroughput updates the Dynamo table throughput values
func (Persister) UpdateCategory ¶
func (p Persister) UpdateCategory(ctx context.Context, id uint32, in model.Category) (*model.Category, error)
UpdateCategory updates a Category in the database and returns the updated Category
func (Persister) UpdateCollection ¶
func (p Persister) UpdateCollection(ctx context.Context, id uint32, in model.Collection) (*model.Collection, error)
UpdateCollection updates a Collection in the database and returns the updated Collection
func (Persister) UpdatePost ¶
UpdatePost updates a Post in the database and returns the updated Post