Documentation ¶
Index ¶
- type App
- type Config
- type Context
- func (ctx *Context) AuthorizationError() *UserError
- func (ctx *Context) CreateTodo(todo *model.Todo) error
- func (ctx *Context) CreateUser(user *model.User, password string) error
- func (ctx *Context) DeleteTodoById(id uint) error
- func (ctx *Context) GetTodoById(id uint) (*model.Todo, error)
- func (ctx *Context) GetUserTodos() ([]*model.Todo, error)
- func (ctx *Context) UpdateTodo(todo *model.Todo) error
- func (ctx *Context) WithLogger(logger logrus.FieldLogger) *Context
- func (ctx *Context) WithRemoteAddress(address string) *Context
- func (ctx *Context) WithUser(user *model.User) *Context
- type UserError
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
func (*App) NewContext ¶
type Config ¶
type Config struct { // A secret string used for session cookies, passwords, etc. SecretKey []byte }
func InitConfig ¶
type Context ¶
type Context struct { Logger logrus.FieldLogger RemoteAddress string Database *db.Database User *model.User }
func (*Context) AuthorizationError ¶
func (*Context) CreateUser ¶
func (*Context) DeleteTodoById ¶
func (*Context) WithLogger ¶
func (ctx *Context) WithLogger(logger logrus.FieldLogger) *Context
func (*Context) WithRemoteAddress ¶
type ValidationError ¶
type ValidationError struct {
Message string `json:"message"`
}
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.