Documentation ¶
Index ¶
- func CreateDB(db *sql.DB) error
- type Database
- type Handler
- func (h *Handler) Create(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func (h *Handler) Destroy(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- func (h *Handler) Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (h *Handler) Show(w http.ResponseWriter, r *http.Request, p httprouter.Params)
- type PgDatabase
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Database interface {
// contains filtered or unexported methods
}
Database is an interface for retrieving Subscriptions
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler() *Handler
func (*Handler) Create ¶
func (h *Handler) Create(w http.ResponseWriter, r *http.Request, p httprouter.Params)
Create is a REST API for creating a new subscription, based on the JSON payload
func (*Handler) Destroy ¶
func (h *Handler) Destroy(w http.ResponseWriter, r *http.Request, p httprouter.Params)
Destroy is a REST API for destroying an subscription, based on the subscription id
func (*Handler) Index ¶
func (h *Handler) Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Index is a REST API for listing all registered subscriptions
func (*Handler) Show ¶
func (h *Handler) Show(w http.ResponseWriter, r *http.Request, p httprouter.Params)
Show is a REST API for listing a single subscription, found by id
type PgDatabase ¶
type PgDatabase struct{}
PgDatabase is a structure that implements the Database interface and interacts with Postgres db
Click to show internal directories.
Click to hide internal directories.