MCPcopy
hub / github.com/vulcand/vulcand / NewHTTPBackend

Function NewHTTPBackend

engine/model.go:495–504  ·  view source on GitHub ↗

NewBackend creates a new instance of the backend object

(id string, s HTTPBackendSettings)

Source from the content-addressed store, hash-verified

493
494// NewBackend creates a new instance of the backend object
495func NewHTTPBackend(id string, s HTTPBackendSettings) (*Backend, error) {
496 if _, err := s.TransportSettings(); err != nil {
497 return nil, err
498 }
499 return &Backend{
500 Id: id,
501 Type: HTTP,
502 Settings: s,
503 }, nil
504}
505
506func (b *Backend) HTTPSettings() HTTPBackendSettings {
507 return b.Settings.(HTTPBackendSettings)

Callers 15

MakeBackendFunction · 0.92
TestNewMethod · 0.92
TestNewFailureMethod · 0.92
TestCopyOnReadMethod · 0.92
TestServerUpdatesMethod · 0.92
TestUpdateMethod · 0.92
TestUpdateSameMethod · 0.92
TestUpdateBadConfigMethod · 0.92
TestBackendCRUDMethod · 0.92
TestServerCRUDMethod · 0.92
TestFrontendCRUDMethod · 0.92
TestMiddlewareCRUDMethod · 0.92

Calls 1

TransportSettingsMethod · 0.45

Tested by 15

TestNewMethod · 0.74
TestNewFailureMethod · 0.74
TestCopyOnReadMethod · 0.74
TestServerUpdatesMethod · 0.74
TestUpdateMethod · 0.74
TestUpdateSameMethod · 0.74
TestUpdateBadConfigMethod · 0.74
TestBackendCRUDMethod · 0.74
TestServerCRUDMethod · 0.74
TestFrontendCRUDMethod · 0.74
TestMiddlewareCRUDMethod · 0.74
TestBackendNewMethod · 0.68