Documentation ¶
Index ¶
- Constants
- func Configure(production bool, name string) (*zap.SugaredLogger, error)
- func CreateFacilityForType(t reflect.Type) string
- func FindTaskID(ctx context.Context) string
- func HandlerContext(ctx context.Context, queue string, handlerType reflect.Type, ...) context.Context
- func IsIngestion(r *http.Request) bool
- func IsServiceTraceEnabled() bool
- func IsWebSocket(r *http.Request) bool
- func Logger(ctx context.Context) *zap.Logger
- func LoggingAndInfrastructure(name string) func(h http.Handler) http.Handler
- func MakeCommonPrefix() string
- func MakeShortID() string
- func Monitoring(name string, m *Metrics) func(h http.Handler) http.Handler
- func NewGoaAdapter(logger *zap.Logger) goa.LogAdapter
- func NewGoaMiddlewareAdapter(logger *zap.Logger) middleware.Logger
- func OnlyLogIf(logger *zap.SugaredLogger, verbose bool) *zap.SugaredLogger
- func PushServiceTrace(ctx context.Context, value ...string) context.Context
- func ServiceTrace(ctx context.Context) []string
- func WithDeviceID(ctx context.Context, deviceID string) context.Context
- func WithFacility(ctx context.Context, facility string) context.Context
- func WithNewTaskID(ctx context.Context, g *IdGenerator) context.Context
- func WithTaskID(ctx context.Context, taskID string) context.Context
- func WithUserID(ctx context.Context, userID int32) context.Context
- type IdGenerator
- type KeyMeta
- type Metrics
- func (m *Metrics) AuthRefreshSuccess()
- func (m *Metrics) AuthRefreshTry()
- func (m *Metrics) AuthSuccess()
- func (m *Metrics) AuthTry()
- func (m *Metrics) DailyQuery() *Timing
- func (m *Metrics) DataErrorsMissingMeta()
- func (m *Metrics) DataErrorsParsing()
- func (m *Metrics) DataErrorsUnknown()
- func (m *Metrics) DataQuery(aggregate string) *Timing
- func (m *Metrics) DataRangesQuery() *Timing
- func (m *Metrics) EmailRecoverPasswordSent()
- func (m *Metrics) EmailVerificationSent()
- func (m *Metrics) FileUpload() *Timing
- func (m *Metrics) GatherMetrics(h http.Handler) http.Handler
- func (m *Metrics) HandleMessage(jobType string) *Timing
- func (m *Metrics) Ingested(blocks, bytes int)
- func (m *Metrics) IngestionDevice(id []byte)
- func (m *Metrics) LastTimesQuery(batch int) *Timing
- func (m *Metrics) MessagePublished()
- func (m *Metrics) PileBytes(pile string, bytes int64)
- func (m *Metrics) PileHit(pile string)
- func (m *Metrics) PileMiss(pile string)
- func (m *Metrics) ReadingsViewed(readings int)
- func (m *Metrics) RecentlyMultiQuery(batch int) *Timing
- func (m *Metrics) RecordsViewed(records int)
- func (m *Metrics) TailMultiQuery(batch int) *Timing
- func (m *Metrics) TailQuery() *Timing
- func (m *Metrics) ThirdPartyLocation(provider string) *Timing
- func (m *Metrics) ThirdPartyLocationDescribe() *Timing
- func (m *Metrics) UserAdded()
- func (m *Metrics) UserID(id int32)
- func (m *Metrics) UserValidated()
- type MetricsSettings
- type PreventableStatusResponse
- func (w *PreventableStatusResponse) BufferNextWriteHeader()
- func (w *PreventableStatusResponse) FineWriteHeader()
- func (w *PreventableStatusResponse) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *PreventableStatusResponse) Write(b []byte) (int, error)
- func (w *PreventableStatusResponse) WriteHeader(code int)
- type ResponseCapture
- type Timing
Constants ¶
View Source
const (
MaximumServiceTrace = 10
)
Variables ¶
This section is empty.
Functions ¶
func CreateFacilityForType ¶
func FindTaskID ¶
func HandlerContext ¶
func IsIngestion ¶
func IsServiceTraceEnabled ¶
func IsServiceTraceEnabled() bool
func IsWebSocket ¶
func MakeCommonPrefix ¶
func MakeCommonPrefix() string
algorithm taken from goa RequestId middleware algorithm taken from https://github.com/zenazn/goji/blob/master/web/middleware/request_id.go#L44-L50
func MakeShortID ¶
func MakeShortID() string
func NewGoaAdapter ¶
func NewGoaAdapter(logger *zap.Logger) goa.LogAdapter
func NewGoaMiddlewareAdapter ¶
func NewGoaMiddlewareAdapter(logger *zap.Logger) middleware.Logger
func OnlyLogIf ¶
func OnlyLogIf(logger *zap.SugaredLogger, verbose bool) *zap.SugaredLogger
func ServiceTrace ¶
func WithNewTaskID ¶
func WithNewTaskID(ctx context.Context, g *IdGenerator) context.Context
Types ¶
type IdGenerator ¶
type IdGenerator struct {
// contains filtered or unexported fields
}
func NewIdGenerator ¶
func NewIdGenerator() *IdGenerator
func (*IdGenerator) Generate ¶
func (g *IdGenerator) Generate() string
type Metrics ¶
type Metrics struct { SC *statsd.Client Settings *MetricsSettings }
func NewMetrics ¶
func NewMetrics(ctx context.Context, ms *MetricsSettings) *Metrics
func (*Metrics) AuthRefreshSuccess ¶
func (m *Metrics) AuthRefreshSuccess()
func (*Metrics) AuthRefreshTry ¶
func (m *Metrics) AuthRefreshTry()
func (*Metrics) AuthSuccess ¶
func (m *Metrics) AuthSuccess()
func (*Metrics) DailyQuery ¶
func (*Metrics) DataErrorsMissingMeta ¶
func (m *Metrics) DataErrorsMissingMeta()
func (*Metrics) DataErrorsParsing ¶
func (m *Metrics) DataErrorsParsing()
func (*Metrics) DataErrorsUnknown ¶
func (m *Metrics) DataErrorsUnknown()
func (*Metrics) DataRangesQuery ¶
func (*Metrics) EmailRecoverPasswordSent ¶
func (m *Metrics) EmailRecoverPasswordSent()
func (*Metrics) EmailVerificationSent ¶
func (m *Metrics) EmailVerificationSent()
func (*Metrics) FileUpload ¶
func (*Metrics) HandleMessage ¶
func (*Metrics) IngestionDevice ¶
func (*Metrics) LastTimesQuery ¶
func (*Metrics) MessagePublished ¶
func (m *Metrics) MessagePublished()
func (*Metrics) ReadingsViewed ¶
func (*Metrics) RecentlyMultiQuery ¶
func (*Metrics) RecordsViewed ¶
func (*Metrics) TailMultiQuery ¶
func (*Metrics) ThirdPartyLocation ¶
func (*Metrics) ThirdPartyLocationDescribe ¶
func (*Metrics) UserValidated ¶
func (m *Metrics) UserValidated()
type MetricsSettings ¶
type PreventableStatusResponse ¶
type PreventableStatusResponse struct { http.ResponseWriter // contains filtered or unexported fields }
This is a http.ResponseWriter which allows us to circumvent the WriteHeader call that goa does before calling our encoder. Look, this sucks. I know. I just can't for the life of me figure out how to get Etagged response working for these images in another way.
func AllowWriteHeaderPrevention ¶
func AllowWriteHeaderPrevention(w http.ResponseWriter) *PreventableStatusResponse
func (*PreventableStatusResponse) BufferNextWriteHeader ¶
func (w *PreventableStatusResponse) BufferNextWriteHeader()
func (*PreventableStatusResponse) FineWriteHeader ¶
func (w *PreventableStatusResponse) FineWriteHeader()
func (*PreventableStatusResponse) Hijack ¶
func (w *PreventableStatusResponse) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*PreventableStatusResponse) Write ¶
func (w *PreventableStatusResponse) Write(b []byte) (int, error)
func (*PreventableStatusResponse) WriteHeader ¶
func (w *PreventableStatusResponse) WriteHeader(code int)
type ResponseCapture ¶
type ResponseCapture struct { http.ResponseWriter StatusCode int ContentLength int }
ResponseCapture is a http.ResponseWriter which captures the response status code and content length.
func CaptureResponse ¶
func CaptureResponse(w http.ResponseWriter) *ResponseCapture
func (*ResponseCapture) Hijack ¶
func (w *ResponseCapture) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*ResponseCapture) WriteHeader ¶
func (w *ResponseCapture) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.