Documentation ¶
Index ¶
- func API(shutdown chan os.Signal, db *sqlx.DB, log *log.Logger, ...) http.Handler
- type Account
- type Check
- type StationType
- func (st *StationType) AddStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (st *StationType) AdjustStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (st *StationType) Create(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (p *StationType) Delete(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (p *StationType) DeleteStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (st *StationType) List(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (st *StationType) ListStations(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (st *StationType) Retrieve(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (st *StationType) RetrieveStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (st *StationType) Update(ctx context.Context, w http.ResponseWriter, r *http.Request) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account holds handlers for dealing with an account.
type Check ¶
type Check struct {
// contains filtered or unexported fields
}
Check provides support for orchestration health checks.
type StationType ¶
type StationType struct {
// contains filtered or unexported fields
}
func (*StationType) AddStation ¶
func (st *StationType) AddStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
AddStation creates a new Station for a particular station_type. It looks for a JSON object in the request body. The full model is returned to the caller.
func (*StationType) AdjustStation ¶
func (st *StationType) AdjustStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
AdjustStation decodes the body of a request to update an existing station. The ID of the station is part of the request URL.
func (*StationType) Create ¶
func (st *StationType) Create(ctx context.Context, w http.ResponseWriter, r *http.Request) error
Create decodes the body of a request to create a new station type. The full station type with generated fields is sent back in the response.
func (*StationType) Delete ¶
func (p *StationType) Delete(ctx context.Context, w http.ResponseWriter, r *http.Request) error
Delete removes a single station type identified by an ID in the request URL.
func (*StationType) DeleteStation ¶
func (p *StationType) DeleteStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
DeleteStation removes a single station identified by an ID in the request URL.
func (*StationType) List ¶
func (st *StationType) List(ctx context.Context, w http.ResponseWriter, r *http.Request) error
*
- List StationTypes is a basic HTTP Handler that lists all of the station types in the HydroByte Automated Garden system.
- A Handler is also know as a "controller" in the MVC pattern. *
- The parameters must follow the signature defined in the http.HandlerFunc() adapter
- (https://golang.org/src/net/http/server.go?s=97511:97566#L2034) to convert this method into a HTTP handler type. *
- Note: If you open localhost:8000 in your browser, you may notice double requests being made. This happens because
- the browser sends a request in the background for a website favicon. More the reason to use Postman to test!
func (*StationType) ListStations ¶
func (st *StationType) ListStations(ctx context.Context, w http.ResponseWriter, r *http.Request) error
ListStations gets all sales for a particular station type.
func (*StationType) Retrieve ¶
func (st *StationType) Retrieve(ctx context.Context, w http.ResponseWriter, r *http.Request) error
Retrieve finds a station type identified by a station type ID in the request URL.
func (*StationType) RetrieveStation ¶
func (st *StationType) RetrieveStation(ctx context.Context, w http.ResponseWriter, r *http.Request) error
RetrieveStation finds a single station identified by an ID in the request URL.
func (*StationType) Update ¶
func (st *StationType) Update(ctx context.Context, w http.ResponseWriter, r *http.Request) error
Update decodes the body of a request to update an existing station type. The ID of the station type is part of the request URL.