persistentlog

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitModels

func InitModels()

InitModels intializes the mongo models

Types

type FlowType

type FlowType string

FlowType represents the flow we are in when creating the log

const (
	// RegistrationFlow is the FlowType for registration
	RegistrationFlow FlowType = "registration"
)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is used to store logs

func NewManager

func NewManager(r *http.Request) *Manager

NewManager creates and initializes a new Manager

func (*Manager) SaveLog

func (m *Manager) SaveLog(log *PersistentLog) error

SaveLog stores a new PersistentLog entry

type PersistentLog

type PersistentLog struct {
	Timestamp time.Time
	Flow      FlowType
	Key       string
	Message   string
}

PersistentLog represents a persistent log entry stored in the database

func New

func New(key string, flow FlowType, message string) *PersistentLog

New creates a new PersistentLog

Jump to

Keyboard shortcuts

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