Documentation ¶
Index ¶
- func DecodeEmptyRequest(_ context.Context, r *http.Request) (interface{}, error)
- func DecodeJsonEmptyRequest(_ context.Context, r *http.Request) (interface{}, error)
- func EncodeError(_ context.Context, err error, w http.ResponseWriter)
- func EncodeResponse(ctx context.Context, w http.ResponseWriter, res interface{}) error
- type ErrResponse
- type HasError
- type Number
- type Submission
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeEmptyRequest ¶
func DecodeJsonEmptyRequest ¶
func EncodeError ¶
func EncodeError(_ context.Context, err error, w http.ResponseWriter)
func EncodeResponse ¶
func EncodeResponse(ctx context.Context, w http.ResponseWriter, res interface{}) error
Types ¶
type ErrResponse ¶
type ErrResponse struct {
Error error `json:"error,omitempty"`
}
func NewErrResponse ¶
func NewErrResponse(err error) *ErrResponse
type Submission ¶
func NewSubmission ¶
func NewSubmission(user string, n int) *Submission
func (*Submission) GetNumber ¶
func (s *Submission) GetNumber() int
func (*Submission) Update ¶
func (s *Submission) Update(n Number)
Click to show internal directories.
Click to hide internal directories.