func NewXSentryAuth(r *http.Request) *XSentryAuth {
	var xSentryAuth XSentryAuth
	xSentryAuth.sentry_key = r.URL.Query().Get("sentry_key")
	headerValues := header.ParseList(r.Header, "X-Sentry-Auth")
	for _, v := range headerValues {
		sp := strings.SplitN(v, "=", 2)
		if len(sp) != 2 {
			return &xSentryAuth
		}
		switch sp[0] {
		case "sentry_key":
			xSentryAuth.sentry_key = sp[1]
		case "sentry_secret":
			xSentryAuth.sentry_secret = sp[1]
		}
	}
	return &xSentryAuth
}
// The sentry public key can be sent in two ways, using the "X-Sentry-Auth"
// header, or as a query argument.  The header takes precendence.
The sentry public key can be sent in two ways, using the "X-Sentry-Auth"
header, or as a query argument.  The header takes precendence.
// The sentry public key can be sent in two ways using the " X - Sentry - Auth " // header or as a query argument . The header takes precendence .
func NewXSentryAuth(r *http.Request) *XSentryAuth {
	var xSentryAuth XSentryAuth
	xSentryAuth.sentry_key = r.URL.Query().Get("sentry_key")
	headerValues := header.ParseList(r.Header, "X-Sentry-Auth")
	for _, v := range headerValues {
		sp := strings.SplitN(v, "=", 2)
		if len(sp) != 2 {
			return &xSentryAuth
		}
		switch sp[0] {
		case "sentry_key":
			xSentryAuth.sentry_key = sp[1]
		case "sentry_secret":
			xSentryAuth.sentry_secret = sp[1]
		}
	}
	return &xSentryAuth
}
func NewXSentryAuth ( r * http . Request ) * XSentryAuth { var xSentryAuth XSentryAuth xSentryAuth . sentry_key = r . URL . Query ( ) . Get ( " " ) headerValues := header . ParseList ( r . Header , " " ) for _ , v := range headerValues { sp := strings . SplitN ( v , " " , 2 ) if len ( sp ) != 2 { return & xSentryAuth } switch sp [ 0 ] { case " " : xSentryAuth . sentry_key = sp [ 1 ] case " " : xSentryAuth . sentry_secret = sp [ 1 ] } } return & xSentryAuth }
The sentry public key can be sent in two ways, using the "X-Sentry-Auth"
header, or as a query argument.
The sentry public key can be sent in two ways using the " X - Sentry - Auth " header or as a query argument .