client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Db     *sqlx.DB
	Config *config.Config
	// contains filtered or unexported fields
}

func NewSqliteClient

func NewSqliteClient(path string, cfg *config.Config) (*Client, error)

func (*Client) Delete

func (c *Client) Delete(options DeleteOptions) error

func (*Client) Get

func (c *Client) Get(index int64) (string, error)

func (*Client) Import

func (c *Client) Import(reader io.Reader) error

func (*Client) List

func (c *Client) List(options ListOptions) ([]record.Record, error)

func (*Client) Record

func (c *Client) Record(command string) error

func (*Client) RecordWithTime

func (c *Client) RecordWithTime(command string, t time.Time) error

func (*Client) Stats

func (c *Client) Stats() (*stats.Stats, error)

func (*Client) Tidy

func (c *Client) Tidy() error

type DeleteOptions

type DeleteOptions struct {
	Ids           []int64
	UpdatedBefore *time.Time
	Pattern       string
}

type HistoryEntry

type HistoryEntry struct {
	Date    time.Time
	Command string
}

type ListOptions

type ListOptions struct {
	Pattern      string
	ByCount      bool
	Reverse      bool
	NoCount      bool
	NoLastUpdate bool
	WithId       bool
	Limit        int
}

func (*ListOptions) ToString

func (l *ListOptions) ToString(records []record.Record) string

Jump to

Keyboard shortcuts

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