psql

package
v0.0.0-...-2471ed3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository encapsulates all PostgreSQL storage mechanics.

func NewRepository

func NewRepository(connstr string) *Repository

NewRepository creates a new PostgreSQL repository.

func (*Repository) Dislike

func (r *Repository) Dislike(ctx context.Context, role babynames.Role, name string) (int, error)

Dislike flags a name as disliked for the specified role, returning the number of times the role has disliked the name.

func (*Repository) GetAndAcknowledgeUnseenMatch

func (r *Repository) GetAndAcknowledgeUnseenMatch(ctx context.Context, role babynames.Role) (string, error)

GetAndAcknowledgeUnseenMatch returns a matched name between both roles that the specified role has not yet seen. This function will flag the name as seen in the process.

func (*Repository) GetDislikedNames

func (r *Repository) GetDislikedNames(ctx context.Context, role babynames.Role) ([]babynames.DislikedName, error)

GetDislikedNames gets a list of all disliked names by the role.

func (*Repository) GetLikedNames

func (r *Repository) GetLikedNames(ctx context.Context, role babynames.Role) ([]babynames.LikedName, error)

GetLikedNames gets a list of all liked names by the role.

func (*Repository) GetMatches

func (r *Repository) GetMatches(ctx context.Context, role babynames.Role) ([]babynames.Match, error)

GetMatches gets a list of all names that are matched with the other role.

func (*Repository) GetNextName

func (r *Repository) GetNextName(ctx context.Context, role babynames.Role) (string, int, error)

GetNextName gets the next name in the queue for the role.

func (*Repository) GetPendingSuperlike

func (r *Repository) GetPendingSuperlike(ctx context.Context, role babynames.Role) (string, error)

GetPendingSuperlike gets any pending superlikes that requires the role's attention.

func (*Repository) GetStats

func (r *Repository) GetStats(ctx context.Context, role babynames.Role) (babynames.Stats, error)

GetStats retrieves the progression stats of a role.

func (*Repository) ImportNames

func (r *Repository) ImportNames(ctx context.Context, names []string) error

ImportNames imports a set of names to the database if they don't exist already.

func (*Repository) Like

func (r *Repository) Like(ctx context.Context, role babynames.Role, name string) error

Like flags a name as liked for the specified role.

func (*Repository) Superlike

func (r *Repository) Superlike(ctx context.Context, role babynames.Role, name string) error

Superlike flags a name as super-liked for the specified role.

func (*Repository) UndoDislike

func (r *Repository) UndoDislike(ctx context.Context, role babynames.Role, name string) error

UndoDislike removes a dislike for a name.

func (*Repository) UndoLike

func (r *Repository) UndoLike(ctx context.Context, role babynames.Role, name string) error

UndoLike removes a like for a name.

Jump to

Keyboard shortcuts

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