MCPcopy
hub / github.com/vulcand/vulcand / UpsertMiddleware

Method UpsertMiddleware

api/client.go:225–232  ·  view source on GitHub ↗
(fk engine.FrontendKey, m engine.Middleware, ttl time.Duration)

Source from the content-addressed store, hash-verified

223}
224
225func (c *Client) UpsertMiddleware(fk engine.FrontendKey, m engine.Middleware, ttl time.Duration) error {
226 if fk.Id == "" || m.Id == "" {
227 return fmt.Errorf("frontend id and middleware id can not be empty")
228 }
229 _, err := c.Post(
230 c.endpoint("frontends", fk.Id, "middlewares"), middlewarePack{Middleware: m, TTL: ttl.String()})
231 return err
232}
233
234func (c *Client) GetMiddleware(mk engine.MiddlewareKey) (*engine.Middleware, error) {
235 data, err := c.Get(c.endpoint("frontends", mk.FrontendKey.Id, "middlewares", mk.Id), url.Values{})

Callers

nothing calls this directly

Calls 3

PostMethod · 0.95
endpointMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected