dynamo

package
v0.0.0-...-c455053 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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

func NewPersister(session *session.Session, tableName string) (Persister, error)

NewPersister constructs a new Persister

func (Persister) DeleteCategory

func (p Persister) DeleteCategory(ctx context.Context, id uint32) error

DeleteCategory deletes a Category

func (Persister) DeleteCollection

func (p Persister) DeleteCollection(ctx context.Context, id uint32) error

DeleteCollection deletes a Collection

func (Persister) DeletePost

func (p Persister) DeletePost(ctx context.Context, id uint32) error

DeletePost deletes a Post

func (Persister) DeleteRecord

func (p Persister) DeleteRecord(ctx context.Context, id uint32) error

DeleteRecord deletes a Record

func (Persister) DeleteRecordHouseholdsForPost

func (p Persister) DeleteRecordHouseholdsForPost(ctx context.Context, postID uint32) error

DeleteRecordHouseholdsForPost deletes the record households associated with a Post

func (Persister) DeleteRecordsForPost

func (p Persister) DeleteRecordsForPost(ctx context.Context, postID uint32) error

DeleteRecordsForPost deletes the Records associated with a Post

func (*Persister) GetMultipleSequenceValues

func (p *Persister) GetMultipleSequenceValues(cnt int) ([]uint32, error)

GetMultipleSequenceValues returns a slice of unique sequence values

func (*Persister) GetSequenceValue

func (p *Persister) GetSequenceValue() (uint32, error)

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

func (p Persister) InsertPost(ctx context.Context, in model.PostIn) (*model.Post, error)

InsertPost inserts a PostBody into the database and returns the inserted Post

func (Persister) InsertRecord

func (p Persister) InsertRecord(ctx context.Context, in model.RecordIn) (*model.Record, error)

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

func (p Persister) LoadNameVariantsData(rd io.Reader, nameType model.NameType) error

LoadNameVariantsData loads name variants data in TSV format

func (Persister) LoadPlaceData

func (p Persister) LoadPlaceData(rd io.Reader) error

LoadPlaceData loads Place data in TSV format

func (Persister) LoadPlaceSettingsData

func (p Persister) LoadPlaceSettingsData(rd io.Reader) error

LoadPlaceSettingsData loads place settings data in TSV format

func (Persister) LoadPlaceWordData

func (p Persister) LoadPlaceWordData(rd io.Reader) error

LoadPlaceWordData loads PlaceWord data in TSV format

func (Persister) RetrieveUser

func (p Persister) RetrieveUser(ctx context.Context, in model.UserIn) (*model.User, error)

RetrieveUser either retrieves a user record from the database, or creates the record if it doesn't already exist.

func (Persister) SelectCategories

func (p Persister) SelectCategories(ctx context.Context) ([]model.Category, error)

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

func (p Persister) SelectCollections(ctx context.Context) ([]model.Collection, error)

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

func (p Persister) SelectOneCategory(ctx context.Context, id uint32) (*model.Category, error)

SelectOneCategory loads a single category from the database

func (Persister) SelectOneCollection

func (p Persister) SelectOneCollection(ctx context.Context, id uint32) (*model.Collection, error)

SelectOneCollection loads a single collection from the database

func (Persister) SelectOnePost

func (p Persister) SelectOnePost(ctx context.Context, id uint32) (*model.Post, error)

SelectOnePost selects a single post by ID

func (Persister) SelectOneRecord

func (p Persister) SelectOneRecord(ctx context.Context, id uint32) (*model.Record, error)

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

func (p Persister) SelectPlace(ctx context.Context, id uint32) (*model.Place, error)

SelectPlace selects a Place object by ID

func (Persister) SelectPlaceSettings

func (p Persister) SelectPlaceSettings(ctx context.Context) (*model.PlaceSettings, error)

SelectPlaceSettings selects the PlaceSettings object if it exists or returns ErrNoRows

func (Persister) SelectPlaceWord

func (p Persister) SelectPlaceWord(ctx context.Context, word string) (*model.PlaceWord, error)

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

func (p Persister) SelectPlacesByID(ctx context.Context, ids []uint32) ([]model.Place, error)

SelectPlacesByID selects multiple Place objects by ID

func (Persister) SelectPosts

func (p Persister) SelectPosts(ctx context.Context) ([]model.Post, error)

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

func (p Persister) SetThroughput(readThroughput, writeThroughput int) error

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

func (p Persister) UpdatePost(ctx context.Context, id uint32, in model.Post) (*model.Post, error)

UpdatePost updates a Post in the database and returns the updated Post

func (Persister) UpdateRecord

func (p Persister) UpdateRecord(ctx context.Context, id uint32, in model.Record) (*model.Record, error)

UpdateRecord updates a Record in the database and returns the updated Record

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL