controller

package
v0.0.0-...-89f0842 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPError

func NewHTTPError(code int, msg string) httpError

Types

type AssetsController

type AssetsController struct {
}

func NewAssetsController

func NewAssetsController() *AssetsController

func (*AssetsController) Name

func (c *AssetsController) Name() string

func (*AssetsController) RegisterHandlers

func (c *AssetsController) RegisterHandlers(server MuxServer)

type Controller

type Controller interface {
	Name() string
	RegisterHandlers(MuxServer)
}

type HTTPError

type HTTPError interface {
	error
	Code() int
}

type IndexController

type IndexController struct {
	// contains filtered or unexported fields
}

func NewIndexController

func NewIndexController(repo service.TweetRepo, instanceName string) *IndexController

func (*IndexController) AvatarURL

func (c *IndexController) AvatarURL(handle string) string

func (*IndexController) Handle

func (c *IndexController) Handle(w http.ResponseWriter, r *http.Request)

func (*IndexController) Name

func (c *IndexController) Name() string

func (*IndexController) RegisterHandlers

func (c *IndexController) RegisterHandlers(server MuxServer)

func (*IndexController) TimeSince

func (c *IndexController) TimeSince(input time.Time) string

type MuxServer

type MuxServer interface {
	http.Handler
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}

type ReadyController

type ReadyController struct {
	// contains filtered or unexported fields
}

func NewReadyController

func NewReadyController(svc service.Service, instanceName string) *ReadyController

func (*ReadyController) Handle

func (c *ReadyController) Handle(w http.ResponseWriter, r *http.Request)

func (*ReadyController) Name

func (c *ReadyController) Name() string

func (*ReadyController) RegisterHandlers

func (c *ReadyController) RegisterHandlers(server MuxServer)

type TweetController

type TweetController struct {
	// contains filtered or unexported fields
}

func NewTweetController

func NewTweetController(repo service.TweetRepo) *TweetController

func (*TweetController) Get

func (*TweetController) Handle

func (c *TweetController) Handle(w http.ResponseWriter, r *http.Request)

func (*TweetController) Name

func (c *TweetController) Name() string

func (*TweetController) Post

func (*TweetController) RegisterHandlers

func (c *TweetController) RegisterHandlers(server MuxServer)

Jump to

Keyboard shortcuts

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