Documentation ¶
Overview ¶
Here we setup the REST handler for the service using chi.
Index ¶
- Variables
- func ErrInvalidRequest(err error) render.Renderer
- func ErrRender(err error) render.Renderer
- func NewHandler(db *gorm.DB, authProvider *auth.TokenProvider, clientId string, ...) http.Handler
- func WithUser(ctx context.Context, user *UserRequest) context.Context
- type AnnotationController
- func (c *AnnotationController) Create(w http.ResponseWriter, r *http.Request)
- func (c *AnnotationController) Delete(w http.ResponseWriter, r *http.Request)
- func (c *AnnotationController) Get(w http.ResponseWriter, r *http.Request)
- func (c *AnnotationController) List(w http.ResponseWriter, r *http.Request)
- func (c *AnnotationController) Update(w http.ResponseWriter, r *http.Request)
- type CommentController
- func (c *CommentController) Create(w http.ResponseWriter, r *http.Request)
- func (c *CommentController) Delete(w http.ResponseWriter, r *http.Request)
- func (c *CommentController) Get(w http.ResponseWriter, r *http.Request)
- func (c *CommentController) List(w http.ResponseWriter, r *http.Request)
- func (c *CommentController) Update(w http.ResponseWriter, r *http.Request)
- type ErrResponse
- type MeController
- type PolicyController
- func (c *PolicyController) Create(w http.ResponseWriter, r *http.Request)
- func (c *PolicyController) Delete(w http.ResponseWriter, r *http.Request)
- func (c *PolicyController) Get(w http.ResponseWriter, r *http.Request)
- func (c *PolicyController) ListSharedFrom(w http.ResponseWriter, r *http.Request)
- func (c *PolicyController) ListSharedWith(w http.ResponseWriter, r *http.Request)
- func (c *PolicyController) Update(w http.ResponseWriter, r *http.Request)
- type TaskController
- func (c *TaskController) Create(w http.ResponseWriter, r *http.Request)
- func (c *TaskController) Delete(w http.ResponseWriter, r *http.Request)
- func (c *TaskController) Get(w http.ResponseWriter, r *http.Request)
- func (c *TaskController) List(w http.ResponseWriter, r *http.Request)
- func (c *TaskController) Update(w http.ResponseWriter, r *http.Request)
- type UserContextKey
- type UserController
- func (c *UserController) Create(w http.ResponseWriter, r *http.Request)
- func (c *UserController) Delete(w http.ResponseWriter, r *http.Request)
- func (c *UserController) Get(w http.ResponseWriter, r *http.Request)
- func (c *UserController) Update(w http.ResponseWriter, r *http.Request)
- func (c *UserController) UserCtx(next http.Handler) http.Handler
- type UserRequest
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = &ErrResponse{HTTPStatusCode: 404, StatusText: "Resource not found."}
Functions ¶
func ErrInvalidRequest ¶
Types ¶
type AnnotationController ¶
func NewAnnotationController ¶
func NewAnnotationController(db *gorm.DB, log logr.Logger) *AnnotationController
func (*AnnotationController) Create ¶
func (c *AnnotationController) Create(w http.ResponseWriter, r *http.Request)
func (*AnnotationController) Delete ¶
func (c *AnnotationController) Delete(w http.ResponseWriter, r *http.Request)
func (*AnnotationController) Get ¶
func (c *AnnotationController) Get(w http.ResponseWriter, r *http.Request)
func (*AnnotationController) List ¶
func (c *AnnotationController) List(w http.ResponseWriter, r *http.Request)
func (*AnnotationController) Update ¶
func (c *AnnotationController) Update(w http.ResponseWriter, r *http.Request)
type CommentController ¶
func NewCommentController ¶
func NewCommentController(db *gorm.DB, log logr.Logger) *CommentController
func (*CommentController) Create ¶
func (c *CommentController) Create(w http.ResponseWriter, r *http.Request)
func (*CommentController) Delete ¶
func (c *CommentController) Delete(w http.ResponseWriter, r *http.Request)
func (*CommentController) Get ¶
func (c *CommentController) Get(w http.ResponseWriter, r *http.Request)
func (*CommentController) List ¶
func (c *CommentController) List(w http.ResponseWriter, r *http.Request)
func (*CommentController) Update ¶
func (c *CommentController) Update(w http.ResponseWriter, r *http.Request)
type ErrResponse ¶
type ErrResponse struct { Err error `json:"-"` // low-level runtime error HTTPStatusCode int `json:"-"` // http response status code StatusText string `json:"status"` // user-level status message AppCode int64 `json:"code,omitempty"` // application-specific error code ErrorText string `json:"error,omitempty"` // application-level error message, for debugging }
func (*ErrResponse) Render ¶
func (e *ErrResponse) Render(w http.ResponseWriter, r *http.Request) error
type MeController ¶
func NewMeController ¶
func NewMeController(db *gorm.DB, log logr.Logger) *MeController
func (*MeController) Get ¶
func (c *MeController) Get(w http.ResponseWriter, r *http.Request)
type PolicyController ¶
func NewPolicyController ¶
func NewPolicyController(db *gorm.DB, log logr.Logger) *PolicyController
func (*PolicyController) Create ¶
func (c *PolicyController) Create(w http.ResponseWriter, r *http.Request)
func (*PolicyController) Delete ¶
func (c *PolicyController) Delete(w http.ResponseWriter, r *http.Request)
func (*PolicyController) Get ¶
func (c *PolicyController) Get(w http.ResponseWriter, r *http.Request)
func (*PolicyController) ListSharedFrom ¶
func (c *PolicyController) ListSharedFrom(w http.ResponseWriter, r *http.Request)
func (*PolicyController) ListSharedWith ¶
func (c *PolicyController) ListSharedWith(w http.ResponseWriter, r *http.Request)
func (*PolicyController) Update ¶
func (c *PolicyController) Update(w http.ResponseWriter, r *http.Request)
type TaskController ¶
func NewTaskController ¶
func NewTaskController(db *gorm.DB, log logr.Logger) *TaskController
func (*TaskController) Create ¶
func (c *TaskController) Create(w http.ResponseWriter, r *http.Request)
func (*TaskController) Delete ¶
func (c *TaskController) Delete(w http.ResponseWriter, r *http.Request)
func (*TaskController) Get ¶
func (c *TaskController) Get(w http.ResponseWriter, r *http.Request)
func (*TaskController) List ¶
func (c *TaskController) List(w http.ResponseWriter, r *http.Request)
List returns the list of tasks for the user that authenticated for the current request
func (*TaskController) Update ¶
func (c *TaskController) Update(w http.ResponseWriter, r *http.Request)
type UserController ¶
func NewUserController ¶
func NewUserController(db *gorm.DB, log logr.Logger) *UserController
func (*UserController) Create ¶
func (c *UserController) Create(w http.ResponseWriter, r *http.Request)
func (*UserController) Delete ¶
func (c *UserController) Delete(w http.ResponseWriter, r *http.Request)
func (*UserController) Get ¶
func (c *UserController) Get(w http.ResponseWriter, r *http.Request)
func (*UserController) Update ¶
func (c *UserController) Update(w http.ResponseWriter, r *http.Request)
type UserRequest ¶
func UserFromContext ¶
func UserFromContext(ctx context.Context) (*UserRequest, error)
type UserResponse ¶
Click to show internal directories.
Click to hide internal directories.