mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: Remove interface from coderd and lift API surface (#1772)
Abstracting coderd into an interface added misdirection because the interface was never intended to be fulfilled outside of a single implementation. This lifts the abstraction, and attaches all handlers to a root struct named `*coderd.API`.
This commit is contained in:
@ -16,7 +16,7 @@ import (
|
||||
"github.com/coder/coder/codersdk"
|
||||
)
|
||||
|
||||
func (api *api) postParameter(rw http.ResponseWriter, r *http.Request) {
|
||||
func (api *API) postParameter(rw http.ResponseWriter, r *http.Request) {
|
||||
var createRequest codersdk.CreateParameterRequest
|
||||
if !httpapi.Read(rw, r, &createRequest) {
|
||||
return
|
||||
@ -63,7 +63,7 @@ func (api *api) postParameter(rw http.ResponseWriter, r *http.Request) {
|
||||
httpapi.Write(rw, http.StatusCreated, convertParameterValue(parameterValue))
|
||||
}
|
||||
|
||||
func (api *api) parameters(rw http.ResponseWriter, r *http.Request) {
|
||||
func (api *API) parameters(rw http.ResponseWriter, r *http.Request) {
|
||||
scope, scopeID, valid := readScopeAndID(rw, r)
|
||||
if !valid {
|
||||
return
|
||||
@ -89,7 +89,7 @@ func (api *api) parameters(rw http.ResponseWriter, r *http.Request) {
|
||||
httpapi.Write(rw, http.StatusOK, apiParameterValues)
|
||||
}
|
||||
|
||||
func (api *api) deleteParameter(rw http.ResponseWriter, r *http.Request) {
|
||||
func (api *API) deleteParameter(rw http.ResponseWriter, r *http.Request) {
|
||||
scope, scopeID, valid := readScopeAndID(rw, r)
|
||||
if !valid {
|
||||
return
|
||||
|
Reference in New Issue
Block a user