Documentation ¶
Overview ¶
toreqnew implements a Traffic Ops client for features in the latest version.
This should only be used if an endpoint or field needed for config gen is in the latest.
Users should always check the returned bool, and if it's false, call the vendored toreq client and set the proper defaults for the new feature(s).
All TOClient functions should check for 404 or 503 and return a bool false if so.
Index ¶
- func IsUnsupportedErr(err error) bool
- type TOClient
- func (cl *TOClient) GetCDNDeliveryServices(cdnID int) ([]atscfg.DeliveryService, net.Addr, bool, error)
- func (cl *TOClient) GetServerUpdateStatus(cacheHostName tc.CacheName) (tc.ServerUpdateStatus, net.Addr, bool, error)
- func (cl *TOClient) GetServers() ([]atscfg.Server, net.Addr, bool, error)
- func (cl *TOClient) GetTopologies() ([]tc.Topology, net.Addr, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUnsupportedErr ¶
Types ¶
type TOClient ¶
func New ¶
func New(cookies string, url *url.URL, user string, pass string, insecure bool, timeout time.Duration, userAgent string) (*TOClient, error)
New returns a TOClient with the given credentials. Note it does not actually log in or try to make a request. Rather, it assumes the cookies are valid for a session. No external communication is made.
func (*TOClient) GetCDNDeliveryServices ¶
func (cl *TOClient) GetCDNDeliveryServices(cdnID int) ([]atscfg.DeliveryService, net.Addr, bool, error)
GetCDNDeliveryServices returns the deliveryservices, whether this client's version is unsupported by the server, and any error. Note if the server returns a 404 or 503, this returns false and a nil error. Users should check the "not supported" bool, and use the vendored TOClient if it's set, and set proper defaults for the new feature(s).