schema

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schema is the schema of the SQLite store of webhooks: its tables, its queries, and the types which are read from, and written to, them

Index

Constants

View Source
const (
	// Version is the version of the schema, of the database's user_version
	Version = 2

	// ListLimit is the most rows which are listed at once
	ListLimit = 100
)

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, conn sqlite.Conn) error

Create creates the schema, in a transaction, when the database hasn't one, or upgrades it, when it's older, and sets its version. A database whose schema is newer is an error.

func NewQueries

func NewQueries() (*sqlite.Queries, error)

NewQueries returns the queries, which a connection is bound to, with WithQueries, so the types' selectors and writers use them

Types

type CallCount

type CallCount uint64

CallCount is how many calls were deleted

func (*CallCount) Scan

func (count *CallCount) Scan(sqlite.Row) error

Scan counts a call which was deleted

type CallID

type CallID uint64

CallID selects a call, by its serial number, which is got, or deleted

func (CallID) Select

func (id CallID) Select(bind *sqlite.Bind, op sqlite.Op) (string, error)

type CallInsert

type CallInsert webhook.Call

CallInsert is a call which is created

func (CallInsert) Insert

func (c CallInsert) Insert(bind *sqlite.Bind) (string, error)

Insert binds the call, which is received now, when it has no time, and returns the query which creates it

func (CallInsert) Update

func (CallInsert) Update(*sqlite.Bind) error

type CallList

type CallList webhook.CallList

CallList is the calls which are read, of a list, or one, of a get, a create, or a delete

func (*CallList) Scan

func (list *CallList) Scan(row sqlite.Row) error

func (*CallList) ScanCount

func (list *CallList) ScanCount(row sqlite.Row) error

type CallListRequest

type CallListRequest webhook.CallListRequest

CallListRequest selects the calls which are listed

func (CallListRequest) Select

func (req CallListRequest) Select(bind *sqlite.Bind, op sqlite.Op) (string, error)

type CallsBefore

type CallsBefore time.Time

CallsBefore selects the calls received before the time, which are deleted

func (CallsBefore) Select

func (before CallsBefore) Select(bind *sqlite.Bind, op sqlite.Op) (string, error)

type WebhookHash

type WebhookHash []byte

WebhookHash selects a webhook, by the hash of its token, which is got

func (WebhookHash) Select

func (hash WebhookHash) Select(bind *sqlite.Bind, op sqlite.Op) (string, error)

type WebhookID

type WebhookID uint64

WebhookID selects a webhook, by its serial number, which is got, updated, or deleted

func (WebhookID) Select

func (id WebhookID) Select(bind *sqlite.Bind, op sqlite.Op) (string, error)

type WebhookInsert

type WebhookInsert struct {
	webhook.WebhookMeta
	Hash []byte
}

WebhookInsert is a webhook which is created, with the hash of its token

func (WebhookInsert) Insert

func (w WebhookInsert) Insert(bind *sqlite.Bind) (string, error)

Insert binds the webhook, and returns the query which creates it

func (WebhookInsert) Update

func (WebhookInsert) Update(*sqlite.Bind) error

type WebhookList

type WebhookList webhook.WebhookList

WebhookList is the webhooks which are read, of a list, or one, of a get, a create, an update, or a delete

func (*WebhookList) Scan

func (list *WebhookList) Scan(row sqlite.Row) error

func (*WebhookList) ScanCount

func (list *WebhookList) ScanCount(row sqlite.Row) error

type WebhookListRequest

type WebhookListRequest webhook.WebhookListRequest

WebhookListRequest selects the webhooks which are listed

func (WebhookListRequest) Select

func (req WebhookListRequest) Select(bind *sqlite.Bind, op sqlite.Op) (string, error)

type WebhookUpdate

type WebhookUpdate webhook.WebhookRequest

WebhookUpdate is what's changed of a webhook

func (WebhookUpdate) Insert

func (WebhookUpdate) Insert(*sqlite.Bind) (string, error)

func (WebhookUpdate) Update

func (u WebhookUpdate) Update(bind *sqlite.Bind) error

Update binds what's set, and whether it is

Jump to

Keyboard shortcuts

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