Documentation ¶
Index ¶
- Constants
- func GetTimeStamp() string
- func GracefulExit(context string, err error)
- func Log(context, message string, TAG int)
- func LogDebug(context, template string, args ...interface{})
- func LogError(context string, err error)
- func LogInfo(context, template string, args ...interface{})
- type FileReader
Constants ¶
View Source
const ( ErrorTAG = iota InfoTAG DebugTAG )
tag definitions
Variables ¶
This section is empty.
Functions ¶
func GracefulExit ¶
GracefulExit exits gracefully without panicking
Types ¶
type FileReader ¶
type FileReader[T any] struct { // contains filtered or unexported fields }
FileReader is a structure for reading files in batches of lines reading files in this manner alleviates the stress on memory and garbage collector
func NewFileReader ¶
func NewFileReader[T any](filename string) *FileReader[T]
NewFileReader returns a new file reader object
func (*FileReader[T]) Close ¶
func (r *FileReader[T]) Close() error
Close closes the file reader object
func (*FileReader[T]) ReadLines ¶
func (r *FileReader[T]) ReadLines(count uint64) ([]*T, error)
ReadLines reads the specified number of lines from the file (if possible) and binds each line to a specific JSON object specified by the generic parameter
Click to show internal directories.
Click to hide internal directories.