entryLogsHandler

package
v0.0.0-...-3cb0b0a Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: GPL-3.0 Imports: 6 Imported by: 0

README

entryLogsHandler

-- import "github.com/remotejob/simple_go_http_server/entryLogsHandler"

used to keep records slice of struc in pointer it ad new records and delete not used records in pointer keep clean Database (.csv file but it can be other backend for example redis etc..)

Usage

type EntryLog
type EntryLog struct {
	EntryLog []domains.Log
}
func NewEntryLog
func NewEntryLog() *EntryLog
func (*EntryLog) AddLastRecords
func (logs *EntryLog) AddLastRecords(file string, deltaTime time.Duration, init bool)

AddLastRecords used mostly for control database (in our case simple .csv file) it keep only needed records. 1. It used at spart up (init func) init paramaters must be set TRUE 2. Used as goroutines periodicly cleapUp Database init paramaters must be set FALSE

func (*EntryLog) AddNewHit
func (logs *EntryLog) AddNewHit(logstr string)

AddNewHit add last click click hits in pointer

func (*EntryLog) DeleteExtraRecords
func (logs *EntryLog) DeleteExtraRecords(index int)

DeleteExtraRecords so it delete not used records from slice as well used in goroutines

Documentation

Overview

Package entryLogsHandler used to keep records slice of struc in pointer, add new records and delete not used records in pointer keep clean Database (.csv file but it can be other backend for example redis etc..)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntryLog

type EntryLog struct {
	EntryLog []domains.Log
}

func NewEntryLog

func NewEntryLog() *EntryLog

func (*EntryLog) AddLastRecords

func (logs *EntryLog) AddLastRecords(file string, deltaTime time.Duration, init bool)

AddLastRecords used mostly for control database (in our case simple .csv file), it keep only needed records. 1. It used at spart up (init func) init paramaters must be set TRUE 2. Used as goroutines periodicly cleapUp Database init paramaters must be set FALSE

func (*EntryLog) AddNewHit

func (logs *EntryLog) AddNewHit(logstr string)

AddNewHit add last click click hits in pointer

func (*EntryLog) DeleteExtraRecords

func (logs *EntryLog) DeleteExtraRecords(index int)

DeleteExtraRecords so it delete not used records from slice as well used in goroutines

Jump to

Keyboard shortcuts

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