queries

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	InitialAckTimeout     int64   `json:"initial_ack_timeout"`
	SubsequentAckTimeouts []int64 `json:"subsequent_ack_timeouts"`
}

func (*Config) Scan

func (c *Config) Scan(src interface{}) error

func (Config) SubsequentAckTimeoutsStr

func (c Config) SubsequentAckTimeoutsStr() string

func (Config) Value

func (c Config) Value() (driver.Value, error)

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 Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) FindQueue

func (q *Queries) FindQueue(ctx context.Context, queueID string) (*Queue, error)

func (*Queries) SaveQueue

func (q *Queries) SaveQueue(ctx context.Context, arg SaveQueueParams) error

func (*Queries) UpsertQueue

func (q *Queries) UpsertQueue(ctx context.Context, arg UpsertQueueParams) error

func (*Queries) WithTx

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

type Queue

type Queue struct {
	QueueID          string
	ChannelID        string
	ChannelName      string
	TeamDomain       string
	TeamID           string
	UserList         string
	RequireAckBefore int64
	AckedBy          string
	Config           Config
}

func (*Queue) AddUser

func (q *Queue) AddUser(userID string) error

func (*Queue) GetFirstUser

func (q *Queue) GetFirstUser() string

func (*Queue) GetUsersInLine

func (q *Queue) GetUsersInLine() []string

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

func (*Queue) RemoveUser

func (q *Queue) RemoveUser(userID string) (bool, error)

func (*Queue) SkipTurn

func (q *Queue) SkipTurn(userId string) (bool, error)

func (*Queue) ToSaveParams

func (q *Queue) ToSaveParams() SaveQueueParams

type SaveQueueParams

type SaveQueueParams struct {
	ChannelID        string
	ChannelName      string
	TeamDomain       string
	TeamID           string
	UserList         string
	RequireAckBefore int64
	AckedBy          string
	Config           Config
	QueueID          string
}

type UpsertQueueParams

type UpsertQueueParams struct {
	QueueID     string
	ChannelID   string
	ChannelName string
	TeamDomain  string
	TeamID      string
	UserList    string
	Config      Config
}

type UserAlreadyInQueueError

type UserAlreadyInQueueError string

func (UserAlreadyInQueueError) Error

func (u UserAlreadyInQueueError) Error() string

Jump to

Keyboard shortcuts

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