Documentation
¶
Index ¶
- type Expression
- type ExpressionInteractor
- type Storage
- func (s *Storage) DeleteExpression(ctx context.Context, id int64) error
- func (s *Storage) InsertExpression(ctx context.Context, expr *Expression) (int64, error)
- func (s *Storage) LoginUser(ctx context.Context, uname, pswrd string) (string, error)
- func (s *Storage) RegisterUser(ctx context.Context, uname, pswrd string) error
- func (s *Storage) SelectAllExpressions(ctx context.Context) ([]Expression, error)
- func (s *Storage) SelectExpressionsByID(ctx context.Context, userID int64) ([]Expression, error)
- func (s *Storage) UpdateExpression(ctx context.Context, answer, status string, id int64) error
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expression ¶
type ExpressionInteractor ¶
type ExpressionInteractor interface { InsertExpression(ctx context.Context, expr *Expression) (int64, error) SelectExpressionsByID(ctx context.Context, userID int64) ([]Expression, error) DeleteExpression(ctx context.Context, id int64) error UpdateExpression(ctx context.Context, answer, status string, id int64) error SelectAllExpressions(ctx context.Context) ([]Expression, error) }
Methods for interactions with database
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) DeleteExpression ¶
DeleteExpression - deletes expression row from database table
func (*Storage) InsertExpression ¶
InsertExpression - putting new expression into database table
func (*Storage) LoginUser ¶
LoginUser selects a user from database and generates new jwt token for him
func (*Storage) RegisterUser ¶
RegisterUser inserts a new user into database when it registers
func (*Storage) SelectAllExpressions ¶
func (s *Storage) SelectAllExpressions(ctx context.Context) ([]Expression, error)
SelectExpressions - returns all expressions slice from database table
func (*Storage) SelectExpressionsByID ¶
SelectExpressionByID - guess yourself :)
Click to show internal directories.
Click to hide internal directories.