schema

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddMessageParams

type AddMessageParams struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type AddThreadMessageParams

type AddThreadMessageParams struct {
	ChannelID string
	ParentTs  string
	Ts        string
	Attrs     dto.ThreadMessageAttrs
}

type ChannelsV2

type ChannelsV2 struct {
	ID    string
	Attrs dto.ChannelAttrs
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteOldMessagesParams

type DeleteOldMessagesParams struct {
	ChannelID string
	OlderThan pgtype.Interval
}

type GetAlertsRow

type GetAlertsRow struct {
	Service  string
	Alert    string
	Priority string
}

type GetAllMessagesRow

type GetAllMessagesRow struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type GetAllOpenIncidentMessagesParams

type GetAllOpenIncidentMessagesParams struct {
	ChannelID string
	Service   string
	Alert     string
}

type GetAllOpenIncidentMessagesRow

type GetAllOpenIncidentMessagesRow struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type GetLatestServiceUpdatesParams

type GetLatestServiceUpdatesParams struct {
	QueryText      string
	Interval       pgtype.Interval
	BotID          string
	QueryEmbedding *pgvector.Vector
}

type GetLatestServiceUpdatesRow

type GetLatestServiceUpdatesRow struct {
	ChannelID    string
	Ts           string
	Attrs        []byte
	SemanticRank *int64
	LexicalRank  *int64
	CRrfScore    float64
}

type GetMessageParams

type GetMessageParams struct {
	ChannelID string
	Ts        string
}

type GetMessagesWithinTSParams

type GetMessagesWithinTSParams struct {
	ChannelID string
	StartTs   string
	EndTs     string
}

type GetMessagesWithinTSRow

type GetMessagesWithinTSRow struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
}

type GetRunbookParams

type GetRunbookParams struct {
	ServiceName string
	AlertName   string
}

type GetThreadMessagesByServiceAndAlertParams

type GetThreadMessagesByServiceAndAlertParams struct {
	Service string
	Alert   string
}

type GetThreadMessagesParams

type GetThreadMessagesParams struct {
	ChannelID string
	ParentTs  string
}

type IncidentRunbook

type IncidentRunbook struct {
	ID    int64
	Attrs dto.RunbookAttrs
}

type MessagesV2

type MessagesV2 struct {
	ChannelID string
	Ts        string
	Attrs     dto.MessageAttrs
	Embedding *pgvector.Vector
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddChannel

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

func (*Queries) AddMessage

func (q *Queries) AddMessage(ctx context.Context, arg AddMessageParams) error

func (*Queries) AddThreadMessage

func (q *Queries) AddThreadMessage(ctx context.Context, arg AddThreadMessageParams) error

func (*Queries) CreateRunbook

func (q *Queries) CreateRunbook(ctx context.Context, attrs dto.RunbookAttrs) (int64, error)

func (*Queries) DeleteOldMessages

func (q *Queries) DeleteOldMessages(ctx context.Context, arg DeleteOldMessagesParams) error

func (*Queries) GetAlerts

func (q *Queries) GetAlerts(ctx context.Context, service string) ([]GetAlertsRow, error)

func (*Queries) GetAllChannels

func (q *Queries) GetAllChannels(ctx context.Context) ([]ChannelsV2, error)

func (*Queries) GetAllMessages

func (q *Queries) GetAllMessages(ctx context.Context, channelID string) ([]GetAllMessagesRow, error)

func (*Queries) GetAllOpenIncidentMessages

func (q *Queries) GetAllOpenIncidentMessages(ctx context.Context, arg GetAllOpenIncidentMessagesParams) ([]GetAllOpenIncidentMessagesRow, error)

func (*Queries) GetChannelByName

func (q *Queries) GetChannelByName(ctx context.Context, name string) (ChannelsV2, error)

func (*Queries) GetLatestServiceUpdates

func (q *Queries) GetLatestServiceUpdates(ctx context.Context, arg GetLatestServiceUpdatesParams) ([]GetLatestServiceUpdatesRow, error)

func (*Queries) GetMessage

func (q *Queries) GetMessage(ctx context.Context, arg GetMessageParams) (MessagesV2, error)

func (*Queries) GetMessagesWithinTS

func (q *Queries) GetMessagesWithinTS(ctx context.Context, arg GetMessagesWithinTSParams) ([]GetMessagesWithinTSRow, error)

func (*Queries) GetRunbook

func (q *Queries) GetRunbook(ctx context.Context, arg GetRunbookParams) (IncidentRunbook, error)

func (*Queries) GetServices

func (q *Queries) GetServices(ctx context.Context) ([]string, error)

func (*Queries) GetThreadMessages

func (q *Queries) GetThreadMessages(ctx context.Context, arg GetThreadMessagesParams) ([]ThreadMessagesV2, error)

func (*Queries) GetThreadMessagesByServiceAndAlert

func (q *Queries) GetThreadMessagesByServiceAndAlert(ctx context.Context, arg GetThreadMessagesByServiceAndAlertParams) ([]ThreadMessagesV2, error)

func (*Queries) UpdateChannelAttrs

func (q *Queries) UpdateChannelAttrs(ctx context.Context, arg UpdateChannelAttrsParams) error

func (*Queries) UpdateMessageAttrs

func (q *Queries) UpdateMessageAttrs(ctx context.Context, arg UpdateMessageAttrsParams) error

func (*Queries) WithTx

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

type ThreadMessagesV2

type ThreadMessagesV2 struct {
	ChannelID string
	ParentTs  string
	Ts        string
	Attrs     dto.ThreadMessageAttrs
}

type UpdateChannelAttrsParams

type UpdateChannelAttrsParams struct {
	Attrs dto.ChannelAttrs
	ID    string
}

type UpdateMessageAttrsParams

type UpdateMessageAttrsParams struct {
	Attrs     dto.MessageAttrs
	Embedding *pgvector.Vector
	ChannelID string
	Ts        string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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