sqlite

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

--------------------------------

func Init

func Init(sessionMode bool, ctx ...context.Context)

func Select

func Select(fileName, id string) ([]byte, error)

func Upsert

func Upsert(fileName, id string, body []byte) error

Types

type Pull

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

func New

func New(sessionMode bool, ctx ...context.Context) *Pull

func (*Pull) Add

func (p *Pull) Add(fileName string) (*SQL, error)

Add creates new connection and adds to pull

func (*Pull) Close

func (p *Pull) Close() error

func (*Pull) DeleteOld added in v0.1.1

func (p *Pull) DeleteOld() (int64, error)

func (*Pull) Get

func (p *Pull) Get(fileName string) (*SQL, error)

Add creates new connection and adds to pull

func (*Pull) Select

func (p *Pull) Select(fileName, id string) ([]byte, error)

func (*Pull) Upsert

func (p *Pull) Upsert(fileName, id string, body []byte) error

Upsert just inserts or update one record

type Record added in v0.1.5

type Record struct {
	// Args is unique key: MD5 hash from url + request
	ID string `json:"id"`

	// See github.com/iostrovok/cacheproxy/store
	Body *store.Item `json:"body"`
}

type SQL

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

func Conn

func Conn(fileName string) (*SQL, error)

func (*SQL) Close

func (s *SQL) Close() error

func (*SQL) CreateTable

func (s *SQL) CreateTable() error

CreateTable just makes new table

func (*SQL) DeleteOld added in v0.1.1

func (s *SQL) DeleteOld(requested map[string]bool) (int64, error)

func (*SQL) Open

func (s *SQL) Open() error

func (*SQL) Select

func (s *SQL) Select(id string) ([]byte, error)

func (*SQL) SelectAll added in v0.1.5

func (s *SQL) SelectAll() ([]*Record, error)

SelectAll returns all rows sorted by id

func (*SQL) SelectAllID added in v0.1.5

func (s *SQL) SelectAllID() ([]string, error)

SelectAllID returns all row id sorted by id

func (*SQL) Upsert

func (s *SQL) Upsert(id string, body []byte) error

Upsert

Jump to

Keyboard shortcuts

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