common

package
v0.0.0-...-afaedbc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeEmptyRequest

func DecodeEmptyRequest(_ context.Context, r *http.Request) (interface{}, error)

func DecodeJsonEmptyRequest

func DecodeJsonEmptyRequest(_ context.Context, r *http.Request) (interface{}, error)

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 HasError

type HasError interface {
	// contains filtered or unexported methods
}

type Number

type Number int

type Submission

type Submission struct {
	User   User
	Number Number
}

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)

type User

type User string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL