Documentation ¶
Index ¶
Constants ¶
View Source
const DeviceIDUnknown = "unknown"
DeviceIDUnknown is the default for untracked devices.
Variables ¶
View Source
var ( ErrInvalidSession = errors.New("invalid session") ErrNotFound = errors.New("session not found") )
Common errors for Session service implementations and validations.
Functions ¶
func IsInvalidSession ¶
IsInvalidSession indicates if err is ErrInvalidSession.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps common Session errors.
type QueryOptions ¶
QueryOptions is used to narrow-down session queries.
type Service ¶
type Service interface { service.Lifecycle Put(namespace string, session *Session) (*Session, error) Query(namespace string, opts QueryOptions) (List, error) }
Service for session interactions
func MemService ¶
func MemService() Service
MemService returns a memory based Service implementation.
func PostgresService ¶
PostgresService returns a Postgres based Service implementation.
type ServiceMiddleware ¶
ServiceMiddleware is a chainable behaviour modifier for Service.
func InstrumentMiddleware ¶
func InstrumentMiddleware( component, store string, errCount kitmetrics.Counter, opCount kitmetrics.Counter, opLatency *prometheus.HistogramVec, ) ServiceMiddleware
InstrumentMiddleware observes key aspects of Service operations and exposes Prometheus metrics.
func LogMiddleware ¶
func LogMiddleware(logger log.Logger, store string) ServiceMiddleware
LogMiddleware given a Logger wraps the next Service with logging capabilities.
Click to show internal directories.
Click to hide internal directories.