Documentation ¶
Index ¶
- type ApiError
- type ApiFunc
- type ApiServer
- type ApiSuccess
- type PostgresStore
- func (s *PostgresStore) AdminDeleteUserById(id int) error
- func (s *PostgresStore) AdminUpdateUserById(id int, user *models.AdminUpdateUser) error
- func (s *PostgresStore) DeleteUserById(id int) error
- func (s *PostgresStore) GetUsers() ([]*models.User, error)
- func (s *PostgresStore) GetUsersById(id int) (*models.User, error)
- func (s *PostgresStore) Init() error
- func (s *PostgresStore) UpdateLastLogin(id int) error
- func (s *PostgresStore) UpdateUserById(id int, user *models.UpdateUser) error
- func (s *PostgresStore) UserLogin(username string) (*models.UserNhash, error)
- func (s *PostgresStore) UserSignUp(user *models.RegisterUser) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiFunc ¶
type ApiFunc func(http.ResponseWriter, *http.Request) error // signature of our handler
type ApiServer ¶
type ApiServer struct {
// contains filtered or unexported fields
}
func NewApiServer ¶
type ApiSuccess ¶
type ApiSuccess struct {
Success string `json:"success"`
}
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewPostgresStore() (*PostgresStore, error)
func (*PostgresStore) AdminDeleteUserById ¶
func (s *PostgresStore) AdminDeleteUserById(id int) error
func (*PostgresStore) AdminUpdateUserById ¶
func (s *PostgresStore) AdminUpdateUserById(id int, user *models.AdminUpdateUser) error
func (*PostgresStore) DeleteUserById ¶
func (s *PostgresStore) DeleteUserById(id int) error
func (*PostgresStore) GetUsersById ¶
func (s *PostgresStore) GetUsersById(id int) (*models.User, error)
func (*PostgresStore) Init ¶
func (s *PostgresStore) Init() error
func (*PostgresStore) UpdateLastLogin ¶
func (s *PostgresStore) UpdateLastLogin(id int) error
func (*PostgresStore) UpdateUserById ¶
func (s *PostgresStore) UpdateUserById(id int, user *models.UpdateUser) error
func (*PostgresStore) UserLogin ¶
func (s *PostgresStore) UserLogin(username string) (*models.UserNhash, error)
func (*PostgresStore) UserSignUp ¶
func (s *PostgresStore) UserSignUp(user *models.RegisterUser) error
type Storage ¶
type Storage interface { UserSignUp(*models.RegisterUser) error UserLogin(string) (*models.UserNhash, error) AdminUpdateUserById(int, *models.AdminUpdateUser) error AdminDeleteUserById(int) error GetUsers() ([]*models.User, error) GetUsersById(int) (*models.User, error) DeleteUserById(int) error UpdateUserById(int, *models.UpdateUser) error UpdateLastLogin(int) error }
creating new interface which handles all server related queries
Source Files ¶
Click to show internal directories.
Click to hide internal directories.