Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - type Datastore
 - type MongoDBDatastore
 - type MySQLDatastore
 - func (m *MySQLDatastore) Close()
 - func (m *MySQLDatastore) CreateUser(user *models.User) error
 - func (m *MySQLDatastore) FetchPosts(owner string) ([]socialmedia.Post, error)
 - func (m *MySQLDatastore) FindGophers(owner string, searchTerm string) ([]models.Gopher, error)
 - func (m *MySQLDatastore) FollowGopher(owner string, friend string) error
 - func (m *MySQLDatastore) FriendsList(owner string) ([]models.Gopher, error)
 - func (m *MySQLDatastore) GetGopherProfile(username string) (*models.UserProfile, error)
 - func (m *MySQLDatastore) GetUser(username string) (*models.User, error)
 - func (m *MySQLDatastore) GetUserProfile(uuid string) (*models.UserProfile, error)
 - func (m *MySQLDatastore) SavePost(owner string, title string, body string, mood int) error
 - func (m *MySQLDatastore) UnfollowGopher(owner string, friend string) error
 - func (m *MySQLDatastore) UpdateUserProfile(uuid, about, location, interests string) error
 - func (m *MySQLDatastore) UpdateUserProfileImage(uuid, profileImagePath string) error
 
- type RedisDatastore
 
Constants ¶
      View Source
      
  
const (
	MYSQL = iota
)
    Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore interface {
	CreateUser(user *models.User) error
	GetUser(username string) (*models.User, error)
	Close()
	GetUserProfile(uuid string) (*models.UserProfile, error)
	UpdateUserProfile(uuid, about, location, interests string) error
	UpdateUserProfileImage(uuid, profileImagePath string) error
	FindGophers(owner string, searchTerm string) ([]models.Gopher, error)
	FriendsList(owner string) ([]models.Gopher, error)
	FollowGopher(owner string, friend string) error
	UnfollowGopher(owner string, friend string) error
	SavePost(owner string, title string, body string, mood int) error
	FetchPosts(owner string) ([]socialmedia.Post, error)
	GetGopherProfile(username string) (*models.UserProfile, error)
}
    type MongoDBDatastore ¶
func NewMongoDBDatastore ¶
func NewMongoDBDatastore(url string) (*MongoDBDatastore, error)
func (*MongoDBDatastore) Close ¶
func (m *MongoDBDatastore) Close()
func (*MongoDBDatastore) CreateUser ¶
func (m *MongoDBDatastore) CreateUser(user *models.User) error
type MySQLDatastore ¶
func NewMySQLDatastore ¶
func NewMySQLDatastore(dataSourceName string) (*MySQLDatastore, error)
func (*MySQLDatastore) Close ¶
func (m *MySQLDatastore) Close()
func (*MySQLDatastore) CreateUser ¶
func (m *MySQLDatastore) CreateUser(user *models.User) error
func (*MySQLDatastore) FetchPosts ¶
func (m *MySQLDatastore) FetchPosts(owner string) ([]socialmedia.Post, error)
func (*MySQLDatastore) FindGophers ¶
func (*MySQLDatastore) FollowGopher ¶
func (m *MySQLDatastore) FollowGopher(owner string, friend string) error
func (*MySQLDatastore) FriendsList ¶
func (m *MySQLDatastore) FriendsList(owner string) ([]models.Gopher, error)
func (*MySQLDatastore) GetGopherProfile ¶
func (m *MySQLDatastore) GetGopherProfile(username string) (*models.UserProfile, error)
func (*MySQLDatastore) GetUser ¶
func (m *MySQLDatastore) GetUser(username string) (*models.User, error)
func (*MySQLDatastore) GetUserProfile ¶
func (m *MySQLDatastore) GetUserProfile(uuid string) (*models.UserProfile, error)
func (*MySQLDatastore) UnfollowGopher ¶
func (m *MySQLDatastore) UnfollowGopher(owner string, friend string) error
func (*MySQLDatastore) UpdateUserProfile ¶
func (m *MySQLDatastore) UpdateUserProfile(uuid, about, location, interests string) error
func (*MySQLDatastore) UpdateUserProfileImage ¶
func (m *MySQLDatastore) UpdateUserProfileImage(uuid, profileImagePath string) error
type RedisDatastore ¶
func NewRedisDatastore ¶
func NewRedisDatastore(address string) (*RedisDatastore, error)
func (*RedisDatastore) Close ¶
func (r *RedisDatastore) Close()
func (*RedisDatastore) CreateUser ¶
func (r *RedisDatastore) CreateUser(user *models.User) error
 Click to show internal directories. 
   Click to hide internal directories.