Documentation ¶
Overview ¶
Package testserver provides fake Terramate Cloud endpoints for testing purposes.
Index ¶
- func DisableEndpoints(paths ...string) map[string]bool
- func EnableAllConfig() map[string]bool
- func GetDeploymentLogs(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, ...)
- func GetDeploymentLogsEvents(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, ...)
- func GetDeployments(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, ...)
- func GetDrift(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, ...)
- func GetDrifts(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, ...)
- func GetMemberships(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func GetStackDrifts(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func GetStacks(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func GetUsers(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func GetWellKnown(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, ...)
- func PatchDeployment(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func PostDeployment(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func PostDeploymentLogs(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func PostDrift(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func PutStack(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, ...)
- func Router(store *cloudstore.Data) *httprouter.Router
- func RouterAdd(store *cloudstore.Data, router *httprouter.Router, enabled map[string]bool)
- func RouterAddCustoms(router *httprouter.Router, store *cloudstore.Data, custom Custom)
- func RouterWith(store *cloudstore.Data, enabled map[string]bool) *httprouter.Router
- type Custom
- type Handler
- type Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableEndpoints ¶ added in v0.4.4
DisableEndpoints the provided path endpoints.
func EnableAllConfig ¶
EnableAllConfig returns a map that enables all cloud endpoints.
func GetDeploymentLogs ¶ added in v0.4.4
func GetDeploymentLogs(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, p httprouter.Params)
GetDeploymentLogs is the GET /deployments/.../logs handler.
func GetDeploymentLogsEvents ¶ added in v0.4.4
func GetDeploymentLogsEvents(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, p httprouter.Params)
GetDeploymentLogsEvents is the SSE GET /deployments/.../logs handler.
func GetDeployments ¶ added in v0.4.4
func GetDeployments(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, p httprouter.Params)
GetDeployments is the GET /deployments handler.
func GetDrift ¶ added in v0.4.4
func GetDrift(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, params httprouter.Params)
GetDrift implements the /v1/drifts/:orguuid/:stackid/:driftid endpoint.
func GetDrifts ¶ added in v0.4.4
func GetDrifts(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, p httprouter.Params)
GetDrifts implements the GET /drifts/:orguuid endpoint. Note: this is not a real endpoint.
func GetMemberships ¶ added in v0.4.4
func GetMemberships(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, _ httprouter.Params)
GetMemberships is the testserver GET /memberships handler.
func GetStackDrifts ¶ added in v0.4.4
func GetStackDrifts(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, params httprouter.Params)
GetStackDrifts implements the /v1/stacks/:orguuid/:stackid/drifts endpoint.
func GetStacks ¶ added in v0.4.4
func GetStacks(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, params httprouter.Params)
GetStacks is the GET /stacks handler.
func GetUsers ¶ added in v0.4.4
func GetUsers(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, _ httprouter.Params)
GetUsers implements the /v1/users endpoint.
func GetWellKnown ¶ added in v0.4.4
func GetWellKnown(store *cloudstore.Data, w http.ResponseWriter, _ *http.Request, _ httprouter.Params)
GetWellKnown implements the /.well-known/cli.json endpoint.
func PatchDeployment ¶ added in v0.4.4
func PatchDeployment(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, p httprouter.Params)
PatchDeployment is the PATCH /deployments handler.
func PostDeployment ¶ added in v0.4.4
func PostDeployment(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, p httprouter.Params)
PostDeployment is the POST /deployments handler.
func PostDeploymentLogs ¶ added in v0.4.4
func PostDeploymentLogs(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, p httprouter.Params)
PostDeploymentLogs is the POST /deployments/.../logs handler.
func PostDrift ¶ added in v0.4.4
func PostDrift(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, p httprouter.Params)
PostDrift implements the POST /v1/drifts/:orguuid endpoint.
func PutStack ¶ added in v0.4.4
func PutStack(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, p httprouter.Params)
PutStack is the PUT /stacks handler.
func Router ¶
func Router(store *cloudstore.Data) *httprouter.Router
Router returns the default fake cloud router.
func RouterAdd ¶ added in v0.4.2
func RouterAdd(store *cloudstore.Data, router *httprouter.Router, enabled map[string]bool)
RouterAdd enables endpoints in an existing router.
func RouterAddCustoms ¶ added in v0.4.2
func RouterAddCustoms(router *httprouter.Router, store *cloudstore.Data, custom Custom)
RouterAddCustoms add custom routes to the fake server. This is used by very specific test cases which requires injection of custom errors in the server.
func RouterWith ¶
func RouterWith(store *cloudstore.Data, enabled map[string]bool) *httprouter.Router
RouterWith returns the testserver router configuration only for the enabled endpoints.
Types ¶
type Handler ¶ added in v0.4.4
type Handler func(store *cloudstore.Data, w http.ResponseWriter, r *http.Request, p httprouter.Params)
Handler is the testserver handler interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cloudstore provides the in-memory store used by the fake Terramate Cloud server.
|
Package cloudstore provides the in-memory store used by the fake Terramate Cloud server. |
cmd
|
|
testserver
Package main implements the cloudmock service.
|
Package main implements the cloudmock service. |