storage

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a storage client

func NewPostgresStore

func NewPostgresStore() (*Store, error)

NewPostgresStore creates a postgres client

func (*Store) AddTransactions

func (store *Store) AddTransactions(item *venmo.FeedItem) error

AddTransactions adds a transaction to the db

func (*Store) Flush

func (store *Store) Flush() error

Flush flushes the store buffer

func (*Store) SampleUsersWithFacebookResultsWithoutProfile added in v0.1.2

func (store *Store) SampleUsersWithFacebookResultsWithoutProfile(n int) ([]User, error)

SampleUsersWithFacebookResultsWithoutProfile samples users

func (*Store) SampleUsersWithPeekYouMatchWithoutProfile added in v0.1.2

func (store *Store) SampleUsersWithPeekYouMatchWithoutProfile(n int) ([]User, error)

SampleUsersWithPeekYouMatchWithoutProfile samples users

func (*Store) SampleUsersWithoutBingResults added in v0.0.4

func (store *Store) SampleUsersWithoutBingResults(n int) ([]User, error)

SampleUsersWithoutBingResults samples users

func (*Store) SampleUsersWithoutDDGResults added in v0.0.5

func (store *Store) SampleUsersWithoutDDGResults(n int) ([]User, error)

SampleUsersWithoutDDGResults samples users

func (*Store) SampleUsersWithoutFacebookResults added in v0.0.6

func (store *Store) SampleUsersWithoutFacebookResults(n int) ([]User, error)

SampleUsersWithoutFacebookResults samples users

func (*Store) SampleUsersWithoutPeekYouResults added in v0.1.1

func (store *Store) SampleUsersWithoutPeekYouResults(n int) ([]User, error)

SampleUsersWithoutPeekYouResults samples users

func (*Store) UpdateUser added in v0.0.4

func (store *Store) UpdateUser(user *User) error

UpdateUser updates a user

type Transaction

type Transaction struct {
	ID          int
	Message     string `pg:"type:'varchar'"`
	Story       string `pg:"type:'varchar'"`
	Type        string `pg:"type:'varchar'"`
	Created     string `pg:"type:'timestamp'"`
	Updated     string `pg:"type:'timestamp'"`
	ActorUserID int
	RecipientID int
}

Transaction is postgres transaction

type User

type User struct {

	// Venmo Fields
	ID           int
	Transactions []Transaction `pg:"many2many:user_to_transactions"`
	Username     string        `pg:"type:'varchar'"`
	PictureURL   string        `pg:"type:'varchar'"`
	Name         string        `pg:"type:'varchar'"`
	FirstName    string        `pg:"type:'varchar'"`
	LastName     string        `pg:"type:'varchar'"`
	Created      string        `pg:"type:'timestamp'"`
	IsBusiness   bool          `pg:"type:'boolean',default:false"`
	Cancelled    bool          `pg:"type:'boolean',default:false"`
	ExternalID   string        `pg:"type:'varchar'"`

	// Research Fields
	BingResults     map[string]interface{} `pg:"type:'json'"`
	DDGResults      string                 `pg:"type:'text'"`
	FacebookResults map[string]interface{} `pg:"type:'json'"`
	FacebookProfile map[string]interface{} `pg:"type:'json'"`
	PeekYouResults  map[string]interface{} `pg:"type:'json'"`
	// contains filtered or unexported fields
}

User is a postgres user

type UserToTransaction

type UserToTransaction struct {
	UserID        int
	TransactionID int
	IsActor       bool `pg:"type:'boolean'"`
}

UserToTransaction is relation between users and transactions

Jump to

Keyboard shortcuts

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