NewBackend creates a new instance of the backend object
(id string, s HTTPBackendSettings)
| 493 | |
| 494 | // NewBackend creates a new instance of the backend object |
| 495 | func 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 | |
| 506 | func (b *Backend) HTTPSettings() HTTPBackendSettings { |
| 507 | return b.Settings.(HTTPBackendSettings) |