books

package
v0.0.0-...-de3a812 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Epoch = 2

Variables

View Source
var DB *sql.DB

Functions

func Open

func Open(sqlite string) error

Types

type Batch

type Batch struct {
	ID          string       `db:"id" json:"id"`
	Super       *string      `db:"super" json:"super"`
	Model       string       `db:"model" json:"model"`
	Body        openai.Batch `db:"body" json:"body"`
	CreatedAt   time.Time    `db:"created_at" json:"created_at"`
	UpdatedAt   *time.Time   `db:"updated_at" json:"updated_at"`
	CompletedAt *time.Time   `db:"completed_at" json:"completed_at"`
	CanceledAt  *time.Time   `db:"canceled_at" json:"canceled_at"`
}

type BatchOp

type BatchOp struct {
	Batch       string             `db:"batch" json:"batch"`
	CustomID    string             `db:"custom_id" json:"custom_id"`
	Request     openai.BatchInput  `db:"request" json:"request"`
	Response    openai.BatchOutput `db:"response" json:"response"`
	Implicit    bool               `db:"implicit" json:"implicit"`
	Deferred    bool               `db:"deferred" json:"deferred"`
	CreatedAt   time.Time          `db:"created_at" json:"created_at"`
	UpdatedAt   *time.Time         `db:"updated_at" json:"updated_at"`
	CompletedAt *time.Time         `db:"completed_at" json:"completed_at"`
	CanceledAt  *time.Time         `db:"canceled_at" json:"canceled_at"`
}

type BatchOpsCompletedParams

type BatchOpsCompletedParams struct {
	Batch  string `db:"batch" json:"batch"`
	Limit  int64  `db:"limit" json:"limit"`
	Offset int64  `db:"offset" json:"offset"`
}

type CountBatchOpsRow

type CountBatchOpsRow struct {
	Total     int64 `db:"total" json:"total"`
	Completed int64 `db:"completed" json:"completed"`
	Canceled  int64 `db:"canceled" json:"canceled"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type InsertBatchOpParams

type InsertBatchOpParams struct {
	Batch    string            `db:"batch" json:"batch"`
	CustomID string            `db:"custom_id" json:"custom_id"`
	Request  openai.BatchInput `db:"request" json:"request"`
	Implicit bool              `db:"implicit" json:"implicit"`
	Deferred bool              `db:"deferred" json:"deferred"`
}

type InsertBatchParams

type InsertBatchParams struct {
	ID    string       `db:"id" json:"id"`
	Super *string      `db:"super" json:"super"`
	Model string       `db:"model" json:"model"`
	Body  openai.Batch `db:"body" json:"body"`
}

type Keyring

type Keyring struct {
	Ring      string    `db:"ring" json:"ring"`
	Ns        string    `db:"ns" json:"ns"`
	Key       string    `db:"key" json:"key"`
	Value     []byte    `db:"value" json:"value"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

type KeyringDeleteParams

type KeyringDeleteParams struct {
	Ring string `db:"ring" json:"ring"`
	Ns   string `db:"ns" json:"ns"`
	Key  string `db:"key" json:"key"`
}

type KeyringGetParams

type KeyringGetParams struct {
	Ring string `db:"ring" json:"ring"`
	Ns   string `db:"ns" json:"ns"`
	Key  string `db:"key" json:"key"`
}

type KeyringListParams

type KeyringListParams struct {
	Ring string `db:"ring" json:"ring"`
	Ns   string `db:"ns" json:"ns"`
}

type KeyringSetParams

type KeyringSetParams struct {
	Ring  string `db:"ring" json:"ring"`
	Ns    string `db:"ns" json:"ns"`
	Key   string `db:"key" json:"key"`
	Value []byte `db:"value" json:"value"`
}

type Migration

type Migration struct {
	Epoch int64 `db:"epoch" json:"epoch"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func Session

func Session() *Queries

func (*Queries) BatchById

func (q *Queries) BatchById(ctx context.Context, id string) (Batch, error)

func (*Queries) BatchOps

func (q *Queries) BatchOps(ctx context.Context, batch string) ([]openai.BatchInput, error)

func (*Queries) BatchOpsCompleted

func (q *Queries) BatchOpsCompleted(ctx context.Context, arg BatchOpsCompletedParams) ([]openai.BatchOutput, error)

func (*Queries) CancelBatch

func (q *Queries) CancelBatch(ctx context.Context, id string) error

func (*Queries) CancelBatchOps

func (q *Queries) CancelBatchOps(ctx context.Context, id string) error

func (*Queries) CountBatchOps

func (q *Queries) CountBatchOps(ctx context.Context, batch string) (CountBatchOpsRow, error)

func (*Queries) DeleteBatchOps

func (q *Queries) DeleteBatchOps(ctx context.Context, batch string) error

func (*Queries) Epoch

func (q *Queries) Epoch(ctx context.Context) (int64, error)

func (*Queries) InsertBatch

func (q *Queries) InsertBatch(ctx context.Context, arg InsertBatchParams) error

func (*Queries) InsertBatchOp

func (q *Queries) InsertBatchOp(ctx context.Context, arg InsertBatchOpParams) error

func (*Queries) KeyringDelete

func (q *Queries) KeyringDelete(ctx context.Context, arg KeyringDeleteParams) error

func (*Queries) KeyringGet

func (q *Queries) KeyringGet(ctx context.Context, arg KeyringGetParams) ([]byte, error)

func (*Queries) KeyringList

func (q *Queries) KeyringList(ctx context.Context, arg KeyringListParams) ([]string, error)

func (*Queries) KeyringSet

func (q *Queries) KeyringSet(ctx context.Context, arg KeyringSetParams) error

func (*Queries) SubBatches

func (q *Queries) SubBatches(ctx context.Context, super *string) ([]Batch, error)

func (*Queries) SubBatchesCompleted

func (q *Queries) SubBatchesCompleted(ctx context.Context, super *string) ([]Batch, error)

func (*Queries) SubBatchesPending

func (q *Queries) SubBatchesPending(ctx context.Context, super *string) ([]Batch, error)

func (*Queries) UpdateBatch

func (q *Queries) UpdateBatch(ctx context.Context, arg UpdateBatchParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type UpdateBatchParams

type UpdateBatchParams struct {
	Body        openai.Batch `db:"body" json:"body"`
	CanceledAt  *time.Time   `db:"canceled_at" json:"canceled_at"`
	CompletedAt *time.Time   `db:"completed_at" json:"completed_at"`
	ID          string       `db:"id" json:"id"`
}

func BatchUpdates

func BatchUpdates(batch openai.Batch) (upd UpdateBatchParams)

Jump to

Keyboard shortcuts

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