Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func EnvMongoURI() string
- func GenerateToken(username string, secretKey string) (string, error)
- func HashPassword(password string) (string, error)
- func ParseToken(tokenStr string, secretKey string) (string, error)
- type DB
- func (db *DB) CreateChatboard(input *model.NewChatboard) (*model.Chatboard, error)
- func (db *DB) CreateComment(input *model.NewComment) (*model.Comment, error)
- func (db *DB) CreateMessage(input *model.NewMessage) (*model.Message, error)
- func (db *DB) CreatePost(input *model.NewPost) (*model.Post, error)
- func (db *DB) CreateUser(input *model.NewUser) (*model.User, error)
- func (db *DB) GetChatboards() ([]*model.Chatboard, error)
- func (db *DB) GetComments() ([]*model.Comment, error)
- func (db *DB) GetMessages() ([]*model.Message, error)
- func (db *DB) GetPosts() ([]*model.Post, error)
- func (db *DB) GetUserIdByUsername(username string) (string, error)
- func (db *DB) GetUsers() ([]*model.User, error)
- func (db *DB) SingleChatboard(ID string) (*model.Chatboard, error)
- func (db *DB) SingleComment(ID string) (*model.Comment, error)
- func (db *DB) SingleMessage(ID string) (*model.Message, error)
- func (db *DB) SinglePost(ID string) (*model.Post, error)
- func (db *DB) SingleUser(ID string) (*model.User, error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPassword hash compares raw password with it's hashed values
func GenerateToken ¶
GenerateToken generates a jwt token and assign a username to it's claims and return it
func HashPassword ¶
HashPassword hashes given password
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CreateChatboard ¶
func (*DB) CreateComment ¶
func (*DB) CreateMessage ¶
Click to show internal directories.
Click to hide internal directories.