queries

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOrUpdateGroupParams

type CreateOrUpdateGroupParams struct {
	ID           int64
	Greeting     nan.NullString
	Questions    queries_types.QuestionsDB
	BanUrl       nan.NullBool
	BanQuestion  nan.NullBool
	BanTimeout   nan.NullInt32
	IgnoreDomain []string
}

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 GetGroupRow

type GetGroupRow struct {
	BanQuestion  nan.NullBool
	BanUrl       nan.NullBool
	Greeting     nan.NullString
	Questions    queries_types.QuestionsDB
	BanTimeout   nan.NullInt32
	IgnoreDomain []string
}

type Group

type Group struct {
	// id.
	ID int64
	// Greeting.
	Greeting nan.NullString
	// Questions and answers.
	Questions queries_types.QuestionsDB
	// Ban by postings urls and forwards.
	BanUrl nan.NullBool
	// Ban by question.
	BanQuestion nan.NullBool
	// Ban delay after question
	BanTimeout   nan.NullInt32
	IgnoreDomain []string
}

Group data.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateOrUpdateGroup

func (q *Queries) CreateOrUpdateGroup(ctx context.Context, arg CreateOrUpdateGroupParams) error

func (*Queries) GetGroup

func (q *Queries) GetGroup(ctx context.Context, id int64) (GetGroupRow, error)

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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