Documentation
¶
Index ¶
- Variables
- type Chirp
- type DB
- func (db *DB) CheckToken(token string) error
- func (db *DB) CreateChirp(body string, user_id int) (Chirp, error)
- func (db *DB) CreateUser(email string, password string) (User, error)
- func (db *DB) DeleteChirp(chirp_id int, user_id int) error
- func (db *DB) GetChirp(id int) (Chirp, error)
- func (db *DB) GetChirps() ([]Chirp, error)
- func (db *DB) GetChirpsByUser(user_id int, sort_by string) ([]Chirp, error)
- func (db *DB) GetChirpsFiltered(filter func(Chirp) bool) ([]Chirp, error)
- func (db *DB) GetChirpsFilteredAndSorted(filter func(Chirp) bool, cmp func(Chirp, Chirp) int) ([]Chirp, error)
- func (db *DB) GetChirpsOrderedBy(sort_by string) ([]Chirp, error)
- func (db *DB) GetUser(id int) (User, error)
- func (db *DB) GetUsers() ([]User, error)
- func (db *DB) LogInUser(email string, password string) (User, error)
- func (db *DB) RevokeToken(token string) error
- func (db *DB) UpdateUser(id int, email string, password string) (User, error)
- func (db *DB) UpgradeUser(user_id int) error
- type DBSchema
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidPassword = errors.New("Invalid password")
View Source
var ErrUserNotFound = errors.New("User not found")
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CheckToken ¶
func (*DB) GetChirpsByUser ¶
func (*DB) GetChirpsFiltered ¶
func (*DB) GetChirpsFilteredAndSorted ¶
func (*DB) RevokeToken ¶
func (*DB) UpdateUser ¶
func (*DB) UpgradeUser ¶
Click to show internal directories.
Click to hide internal directories.