db

package
v0.0.0-...-32e0108 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2016 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Db *sql.DB

	// Authorization
	LoginStmt *sql.Stmt

	// Registration
	RegisterStmt *sql.Stmt

	// Messages
	GetMessagesStmt      *sql.Stmt
	SendMessageStmt      *sql.Stmt
	GetMessagesUsersStmt *sql.Stmt

	// Timeline
	GetFromTimelineStmt *sql.Stmt
	AddToTimelineStmt   *sql.Stmt

	// Users
	GetUsersListStmt      *sql.Stmt
	GetFriendsList        *sql.Stmt
	GetFriendsRequestList *sql.Stmt

	// Friends
	AddFriendsRequestStmt *sql.Stmt
	ConfirmFriendshipStmt *sql.Stmt

	// Profile
	GetProfileStmt    *sql.Stmt
	AddProfileStmt    *sql.Stmt
	UpdateProfileStmt *sql.Stmt

	// City
	GetCityInfoStmt       *sql.Stmt
	GetCityInfoByNameStmt *sql.Stmt
	AddCityStmt           *sql.Stmt
)

Functions

func GetUserFriends

func GetUserFriends(userId uint64) (userIds []uint64, err error)

func GetUserFriendsRequests

func GetUserFriendsRequests(userId uint64) (userIds []uint64, err error)

func GetUserNames

func GetUserNames(userIds []string) (map[string]string, error)

user id is string for simplicity

func InitStmts

func InitStmts()

language=PostgreSQL

Types

type City

type City struct {
	Id   uint64
	Name string
	Lon  float64
	Lat  float64
}

func GetCityInfo

func GetCityInfo(id uint64) (*City, error)

func GetCityInfoByName

func GetCityInfoByName(name string) (*City, error)

Jump to

Keyboard shortcuts

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