Documentation ¶
Overview ¶
Copied from https://github.com/zenazn/goji/blob/master/web/mutil/writer_proxy.go
Index ¶
- Constants
- func NewServer(args *interfaces.ServerArgs, errorRecorder *usecase.ErrorRecorder, ...) *server
- func ParseAuthorizationHeader(header string) (string, error)
- func ParseHTMLTemplates(files ...string) *template.Template
- func TemplateDir() string
- func TemplatePath(file string) string
- type OAuthServer
- type SendGridEventValues
- type WriterProxy
Constants ¶
View Source
const ( APITokenCookieName = "apiToken" TrackingIDCookieName = "trackingId" )
Variables ¶
This section is empty.
Functions ¶
func NewServer ¶
func NewServer( args *interfaces.ServerArgs, errorRecorder *usecase.ErrorRecorder, userAPITokenUsecase *usecase.UserAPIToken, ) *server
func ParseHTMLTemplates ¶
func TemplateDir ¶
func TemplateDir() string
func TemplatePath ¶
Types ¶
type OAuthServer ¶
type OAuthServer struct {
// contains filtered or unexported fields
}
func NewOAuthServer ¶
func NewOAuthServer( appLogger *zap.Logger, errorRecorder *usecase.ErrorRecorder, gaMeasurementClient ga_measurement.Client, gaMeasurementUsecase *usecase.GAMeasurement, senderHTTPClient *http.Client, userUsecase *usecase.User, userAPITokenUsecase *usecase.UserAPIToken, ) *OAuthServer
func (*OAuthServer) Setup ¶
func (s *OAuthServer) Setup(mux *goji.Mux)
type SendGridEventValues ¶
type SendGridEventValues struct { Timestamp int64 `json:"timestamp"` Event string `json:"event"` Email string `json:"email"` SGEventID string `json:"sg_event_id"` UserAgent string `json:"useragent"` URL string `json:"url"` // Only when event=click // Custom args EmailType string `json:"email_type"` UserID string `json:"user_id"` TeacherIDs string `json:"teacher_ids"` }
func (*SendGridEventValues) GetUserID ¶
func (v *SendGridEventValues) GetUserID() uint32
func (*SendGridEventValues) IsEventClick ¶
func (v *SendGridEventValues) IsEventClick() bool
func (*SendGridEventValues) IsEventOpen ¶
func (v *SendGridEventValues) IsEventOpen() bool
func (*SendGridEventValues) LogToFile ¶
func (v *SendGridEventValues) LogToFile(logger *zap.Logger)
type WriterProxy ¶
type WriterProxy interface { http.ResponseWriter // Status returns the HTTP status of the request, or 0 if one has not // yet been sent. Status() int // BytesWritten returns the total number of bytes sent to the client. BytesWritten() int // Tee causes the response body to be written to the given io.Writer in // addition to proxying the writes through. Only one io.Writer can be // tee'd to at once: setting a second one will overwrite the first. // Writes will be sent to the proxy before being written to this // io.Writer. It is illegal for the tee'd writer to be modified // concurrently with writes. Tee(io.Writer) // Unwrap returns the original proxied target. Unwrap() http.ResponseWriter }
WriterProxy is a proxy around an http.ResponseWriter that allows you to hook into various parts of the response process.
func WrapWriter ¶
func WrapWriter(w http.ResponseWriter) WriterProxy
WrapWriter wraps an http.ResponseWriter, returning a proxy that allows you to hook into various parts of the response process.
Click to show internal directories.
Click to hide internal directories.