db

package
v0.0.0-...-28de07d Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllLinks(wrapper func(link *Link))

AllLinks takes a wrapper function that can be used to format each link in the result into the desired format for the caller

func FindVotesByLinkID

func FindVotesByLinkID(linkID string, wrapper func(vote *Vote))

func FindVotesByUserID

func FindVotesByUserID(userID string, wrapper func(vote *Vote))

Types

type AuthData

type AuthData struct {
	Email    string
	Password string
}
type Link struct {
	ID          string
	URL         string
	Description string
	PostedBy    string
}
func CreateLink(link *Link) *Link

func FindLinkByID

func FindLinkByID(id string) *Link

type User

type User struct {
	ID       string
	Name     string
	Email    string
	Password string
}

func CreateUser

func CreateUser(user *User) *User

func FindUserByEmail

func FindUserByEmail(email string) *User

func FindUserByID

func FindUserByID(id string) *User

type Vote

type Vote struct {
	ID        string
	CreatedAt string
	UserID    string
	LinkID    string
}

func CreateVote

func CreateVote(vote *Vote) *Vote

Jump to

Keyboard shortcuts

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