Versions in this module Expand all Collapse all v0 v0.0.1 Jun 3, 2024 Changes in this version + var ErrBatchAlreadyClosed = errors.New("batch already closed") + func Dial(ctx context.Context, dbURL string) (*pgxpool.Pool, error) + type DBTX interface + Exec func(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query func(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow func(context.Context, string, ...interface{}) pgx.Row + SendBatch func(context.Context, *pgx.Batch) pgx.BatchResults + type Endpoint struct + Domain string + Hits int64 + LastUpdate time.Time + Method string + Path string + type EndpointListParams struct + Limit int32 + Offset int32 + type Headline struct + CreatedAt time.Time + Domain string + ID int64 + IP netip.Addr + Method string + Path string + RequestID string + type HeadlineListByEndpointParams struct + Domain string + Limit int32 + Method string + Offset int32 + Path string + type HeadlineListParams struct + Limit int32 + Offset int32 + type Queries struct + func New(db DBTX) *Queries + func (q *Queries) EndpointList(ctx context.Context, arg EndpointListParams) ([]Endpoint, error) + func (q *Queries) EndpointListTop(ctx context.Context, limit int32) ([]Endpoint, error) + func (q *Queries) HeadlineList(ctx context.Context, arg HeadlineListParams) ([]Headline, error) + func (q *Queries) HeadlineListByEndpoint(ctx context.Context, arg HeadlineListByEndpointParams) ([]Headline, error) + func (q *Queries) RequestCreate(ctx context.Context, arg []RequestCreateParams) *RequestCreateBatchResults + func (q *Queries) RequestGet(ctx context.Context, id int64) (Request, error) + func (q *Queries) WithTx(tx pgx.Tx) *Queries + type Request struct + Content []byte + CreatedAt time.Time + Domain string + Headers []byte + ID int64 + IP netip.Addr + Method string + PartialContent bool + Path string + RequestID string + URL string + type RequestCreateBatchResults struct + func (b *RequestCreateBatchResults) Close() error + func (b *RequestCreateBatchResults) Exec(f func(int, error)) + type RequestCreateParams struct + Content []byte + CreatedAt time.Time + Domain string + Headers []byte + IP netip.Addr + Method string + PartialContent bool + Path string + RequestID string + URL string