analytics

package
v0.0.0-...-6d4ef88 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HookAnalyticsUpdate allows modules to listen for analytics updates
	HookAnalyticsUpdate = hooks.NewHook[Analytics]("analytics.update")
)

Functions

This section is empty.

Types

type Analytics

type Analytics struct {
	WebRequests int64 `json:"webRequests"`
	Entities    int64 `json:"entities"`
}

Analytics is the analytics model

type Handler

type Handler interface {
	// Get handles web requests to get analytics
	Get(echo.Context) error

	// WebRequestMiddleware provides middleware to track all web requests
	WebRequestMiddleware(next echo.HandlerFunc) echo.HandlerFunc
}

Handler provides an HTTP handler for analytics

func NewAnalyticsHandler

func NewAnalyticsHandler(i *do.Injector) (Handler, error)

NewAnalyticsHandler provides a new analytics Handler instance

type Service

type Service interface {
	// GetAnalytics returns analytics
	GetAnalytics() (Analytics, error)

	// IncrementWebRequests increments the counter that tracks web requests
	IncrementWebRequests() error

	// IncrementEntities increments the counter that track entities
	IncrementEntities() error
}

Service provides an interface to service analytics

func NewAnalyticsService

func NewAnalyticsService(i *do.Injector) (Service, error)

NewAnalyticsService creates a new analytics Service instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL