Documentation ¶
Index ¶
- Constants
- func FailureMiddleware(next http.Handler) http.Handler
- type Config
- type DeleteRes
- type Router
- func (t *Router) CreateTodo(w http.ResponseWriter, r *http.Request)
- func (t *Router) DeleteTodo(w http.ResponseWriter, r *http.Request)
- func (t *Router) GetRouter() chi.Router
- func (t *Router) GetTodo(w http.ResponseWriter, r *http.Request)
- func (t *Router) ListTodos(w http.ResponseWriter, r *http.Request)
- func (t *Router) UpdateTodo(w http.ResponseWriter, r *http.Request)
- type Todo
Constants ¶
View Source
const Username = "anonymous"
Username is a temporary value for all user name fields until we get proper authentication in place
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeleteRes ¶
type DeleteRes struct {
Success bool `json:"success"`
}
DeleteRes data model.
func FromGRPCDeleteRes ¶
func FromGRPCDeleteRes(grpcRes *todomgrpb.DeleteTodoRes) *DeleteRes
FromGRPCDeleteRes returns new DeleteRes object based on gRPC DTO from the upstream todo-manager service
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is a registry of go-chi routes supported by Todo
func (*Router) CreateTodo ¶
func (t *Router) CreateTodo(w http.ResponseWriter, r *http.Request)
CreateTodo creates a new todo for a given user
func (*Router) DeleteTodo ¶
func (t *Router) DeleteTodo(w http.ResponseWriter, r *http.Request)
DeleteTodo deletes a todo with specified user and todo ID
func (*Router) GetTodo ¶
func (t *Router) GetTodo(w http.ResponseWriter, r *http.Request)
GetTodo gets a todo with specified user and todo ID
func (*Router) ListTodos ¶
func (t *Router) ListTodos(w http.ResponseWriter, r *http.Request)
ListTodos lists all todos owned by a user
func (*Router) UpdateTodo ¶
func (t *Router) UpdateTodo(w http.ResponseWriter, r *http.Request)
UpdateTodo updates a todo with specified user and todo ID
type Todo ¶
Todo data model.
func FromGRPCTodo ¶
FromGRPCTodo returns new Todo object and owner info based on gRPC DTO from the upstream todo-manager service
Click to show internal directories.
Click to hide internal directories.