Documentation
¶
Index ¶
- Variables
- type Chirp
- type DB
- func (db *DB) CreateChirp(body string, authorID int) (Chirp, error)
- func (db *DB) CreateUser(email, hashedPassword string) (User, error)
- func (db *DB) DeleteChirp(id int) error
- func (db *DB) GetChirp(id int) (Chirp, error)
- func (db *DB) GetChirps() ([]Chirp, error)
- func (db *DB) GetUser(id int) (User, error)
- func (db *DB) GetUserByEmail(email string) (User, error)
- func (db *DB) GetUsers() ([]User, error)
- func (db *DB) IsTokenRevoked(token string) (bool, error)
- func (db *DB) ResetDB() error
- func (db *DB) RevokeToken(token string) error
- func (db *DB) UpdateUser(id int, email, hashedPassword string) (User, error)
- func (db *DB) UpgradeChirpyRed(id int) (User, error)
- type DBStructure
- type Revocation
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("already exists")
View Source
var ErrNotExist = errors.New("resource does not exist")
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func NewDB ¶
NewDB creates a new database connection and creates the database file if it doesn't exist
func (*DB) CreateChirp ¶
CreateChirp creates a new chirp and saves it to disk
func (*DB) DeleteChirp ¶
func (*DB) RevokeToken ¶
func (*DB) UpdateUser ¶
type DBStructure ¶
type Revocation ¶
Click to show internal directories.
Click to hide internal directories.