Documentation ¶
Overview ¶
The digest package provides an implementation of http.RoundTripper that takes care of HTTP Digest Authentication (http://www.ietf.org/rfc/rfc2617.txt). This only implements the MD5 and "auth" portions of the RFC, but that covers the majority of avalible server side implementations including apache web server.
Example usage:
t := NewTransport("myUserName", "myP@55w0rd") req, err := http.NewRequest("GET", "http://notreal.com/path?arg=1", nil) if err != nil { return err } resp, err := t.RoundTrip(req) if err != nil { return err }
OR it can be used as a client:
c, err := t.Client() if err != nil { return err } resp, err := c.Get("http://notreal.com/path?arg=1") if err != nil { return err }
Index ¶
- Constants
- Variables
- type Config
- type MMSAPI
- func (api *MMSAPI) GetAllHosts(groupId string) ([]model.Host, error)
- func (api *MMSAPI) GetHostByName(groupId string, name string) (*model.Host, error)
- func (api *MMSAPI) GetHostDBMetric(groupId string, hostId string, metricName string, dbName string) (*model.Metric, error)
- func (api *MMSAPI) GetHostMetric(groupId string, hostId string, metricName string) (*model.Metric, error)
- type Transport
Constants ¶
View Source
const (
Delimiter = "="
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type MMSAPI ¶
type MMSAPI struct {
// contains filtered or unexported fields
}
func (*MMSAPI) GetHostByName ¶
func (*MMSAPI) GetHostDBMetric ¶
type Transport ¶
type Transport struct { Username string Password string Transport http.RoundTripper }
Transport is an implementation of http.RoundTripper that takes care of http digest authentication.
func NewTransport ¶
NewTransport creates a new digest transport using the http.DefaultTransport.
Click to show internal directories.
Click to hide internal directories.