history

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ClickHouseDateFormat = "2006-01-02 15:04:05.000"

ClickHouseDateFormat - representation of date in Clickhouse, like RFC3339 but without timezone and with milliseconds

Variables

This section is empty.

Functions

This section is empty.

Types

type History

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

History object

func New

func New(path string) (*History, error)

New history object from file

func (*History) Close

func (h *History) Close() error

Close history file

func (*History) Read

func (h *History) Read() ([]*Row, error)

Read history from file

func (*History) RowsToStrArr

func (h *History) RowsToStrArr(rows []*Row) []string

RowsToStrArr - convert rows to slice of strings

func (*History) Write

func (h *History) Write(row *Row) error

Write row creation date

type Row

type Row struct {
	CreatedAt time.Time
	Query     string
}

Row of history

Jump to

Keyboard shortcuts

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