repository

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Firestore

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

func NewFirestore

func NewFirestore(ctx context.Context, projectID, databaseID string) (*Firestore, error)

func (*Firestore) BatchGetAlerts

func (r *Firestore) BatchGetAlerts(ctx context.Context, alertIDs []types.AlertID) (alert.Alerts, error)

func (*Firestore) BatchGetTickets

func (r *Firestore) BatchGetTickets(ctx context.Context, ticketIDs []types.TicketID) ([]*ticket.Ticket, error)

BatchGetTickets gets tickets by their IDs. If some tickets are not found, it will be ignored.

func (*Firestore) BatchPutAlerts

func (r *Firestore) BatchPutAlerts(ctx context.Context, alerts alert.Alerts) error

func (*Firestore) BatchUpdateTicketsStatus

func (r *Firestore) BatchUpdateTicketsStatus(ctx context.Context, ticketIDs []types.TicketID, status types.TicketStatus) error

func (*Firestore) BindAlertsToTicket added in v0.1.0

func (r *Firestore) BindAlertsToTicket(ctx context.Context, alertIDs []types.AlertID, ticketID types.TicketID) error

Alert-Ticket binding methods

func (*Firestore) Close

func (r *Firestore) Close() error

func (*Firestore) CountActivities

func (r *Firestore) CountActivities(ctx context.Context) (int, error)

func (*Firestore) CountAlertsWithoutTicket added in v0.1.0

func (r *Firestore) CountAlertsWithoutTicket(ctx context.Context) (int, error)

func (*Firestore) CountTicketComments

func (r *Firestore) CountTicketComments(ctx context.Context, ticketID types.TicketID) (int, error)

func (*Firestore) CountTicketsByStatus

func (r *Firestore) CountTicketsByStatus(ctx context.Context, statuses []types.TicketStatus) (int, error)

func (*Firestore) CreateTagWithID added in v0.2.0

func (r *Firestore) CreateTagWithID(ctx context.Context, tag *tag.Tag) error

func (*Firestore) DeleteTagByID added in v0.2.0

func (r *Firestore) DeleteTagByID(ctx context.Context, tagID string) error

func (*Firestore) DeleteToken

func (r *Firestore) DeleteToken(ctx context.Context, tokenID auth.TokenID) error

func (*Firestore) FindNearestAlerts

func (r *Firestore) FindNearestAlerts(ctx context.Context, embedding []float32, limit int) (alert.Alerts, error)

func (*Firestore) FindNearestTickets

func (r *Firestore) FindNearestTickets(ctx context.Context, embedding []float32, limit int) ([]*ticket.Ticket, error)

func (*Firestore) FindNearestTicketsWithSpan

func (r *Firestore) FindNearestTicketsWithSpan(ctx context.Context, embedding []float32, begin, end time.Time, limit int) ([]*ticket.Ticket, error)

func (*Firestore) FindSimilarAlerts

func (r *Firestore) FindSimilarAlerts(ctx context.Context, target alert.Alert, limit int) (alert.Alerts, error)

func (*Firestore) GetActivities

func (r *Firestore) GetActivities(ctx context.Context, offset, limit int) ([]*activity.Activity, error)

func (*Firestore) GetAlert

func (r *Firestore) GetAlert(ctx context.Context, alertID types.AlertID) (*alert.Alert, error)

func (*Firestore) GetAlertList

func (r *Firestore) GetAlertList(ctx context.Context, listID types.AlertListID) (*alert.List, error)

func (*Firestore) GetAlertListByThread

func (r *Firestore) GetAlertListByThread(ctx context.Context, thread slack.Thread) (*alert.List, error)

func (*Firestore) GetAlertListsInThread

func (r *Firestore) GetAlertListsInThread(ctx context.Context, thread slack.Thread) ([]*alert.List, error)

func (*Firestore) GetAlertWithoutEmbedding

func (r *Firestore) GetAlertWithoutEmbedding(ctx context.Context) (alert.Alerts, error)

func (*Firestore) GetAlertWithoutTicket

func (r *Firestore) GetAlertWithoutTicket(ctx context.Context, offset, limit int) (alert.Alerts, error)

func (*Firestore) GetAlertsBySpan

func (r *Firestore) GetAlertsBySpan(ctx context.Context, begin, end time.Time) (alert.Alerts, error)

func (*Firestore) GetAlertsWithInvalidEmbedding added in v0.1.0

func (r *Firestore) GetAlertsWithInvalidEmbedding(ctx context.Context) (alert.Alerts, error)

func (*Firestore) GetLatestAlertByThread

func (r *Firestore) GetLatestAlertByThread(ctx context.Context, thread slack.Thread) (*alert.Alert, error)

func (*Firestore) GetLatestAlertListInThread

func (r *Firestore) GetLatestAlertListInThread(ctx context.Context, thread slack.Thread) (*alert.List, error)

func (*Firestore) GetLatestHistory

func (r *Firestore) GetLatestHistory(ctx context.Context, ticketID types.TicketID) (*ticket.History, error)

func (*Firestore) GetOrCreateTagByName added in v0.2.0

func (r *Firestore) GetOrCreateTagByName(ctx context.Context, name, description, color, createdBy string) (*tag.Tag, error)

GetOrCreateTagByName atomically gets an existing tag or creates a new one

func (*Firestore) GetTagByID added in v0.2.0

func (r *Firestore) GetTagByID(ctx context.Context, tagID string) (*tag.Tag, error)

func (*Firestore) GetTagByName added in v0.2.0

func (r *Firestore) GetTagByName(ctx context.Context, name string) (*tag.Tag, error)

func (*Firestore) GetTagsByIDs added in v0.2.0

func (r *Firestore) GetTagsByIDs(ctx context.Context, tagIDs []string) ([]*tag.Tag, error)

func (*Firestore) GetTicket

func (r *Firestore) GetTicket(ctx context.Context, ticketID types.TicketID) (*ticket.Ticket, error)

Ticket related methods

func (*Firestore) GetTicketByThread

func (r *Firestore) GetTicketByThread(ctx context.Context, thread slack.Thread) (*ticket.Ticket, error)

func (*Firestore) GetTicketComments

func (r *Firestore) GetTicketComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)

func (*Firestore) GetTicketCommentsPaginated

func (r *Firestore) GetTicketCommentsPaginated(ctx context.Context, ticketID types.TicketID, offset, limit int) ([]ticket.Comment, error)

func (*Firestore) GetTicketUnpromptedComments

func (r *Firestore) GetTicketUnpromptedComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)

func (*Firestore) GetTicketsBySpan

func (r *Firestore) GetTicketsBySpan(ctx context.Context, begin, end time.Time) ([]*ticket.Ticket, error)

func (*Firestore) GetTicketsByStatus

func (r *Firestore) GetTicketsByStatus(ctx context.Context, statuses []types.TicketStatus, offset, limit int) ([]*ticket.Ticket, error)

func (*Firestore) GetTicketsByStatusAndSpan

func (r *Firestore) GetTicketsByStatusAndSpan(ctx context.Context, status types.TicketStatus, begin, end time.Time) ([]*ticket.Ticket, error)

func (*Firestore) GetTicketsWithInvalidEmbedding added in v0.1.0

func (r *Firestore) GetTicketsWithInvalidEmbedding(ctx context.Context) ([]*ticket.Ticket, error)

func (*Firestore) GetToken

func (r *Firestore) GetToken(ctx context.Context, tokenID auth.TokenID) (*auth.Token, error)

func (*Firestore) IsTagNameExists added in v0.2.0

func (r *Firestore) IsTagNameExists(ctx context.Context, name string) (bool, error)

func (*Firestore) ListAllTags added in v0.2.0

func (r *Firestore) ListAllTags(ctx context.Context) ([]*tag.Tag, error)

func (*Firestore) PutActivity

func (r *Firestore) PutActivity(ctx context.Context, activity *activity.Activity) error

Activity related methods

func (*Firestore) PutAlert

func (r *Firestore) PutAlert(ctx context.Context, a alert.Alert) error

func (*Firestore) PutAlertList

func (r *Firestore) PutAlertList(ctx context.Context, list *alert.List) error

func (*Firestore) PutHistory

func (r *Firestore) PutHistory(ctx context.Context, ticketID types.TicketID, history *ticket.History) error

func (*Firestore) PutTicket

func (r *Firestore) PutTicket(ctx context.Context, t ticket.Ticket) error

func (*Firestore) PutTicketComment

func (r *Firestore) PutTicketComment(ctx context.Context, comment ticket.Comment) error

func (*Firestore) PutTicketCommentsPrompted

func (r *Firestore) PutTicketCommentsPrompted(ctx context.Context, ticketID types.TicketID, commentIDs []types.CommentID) error

func (*Firestore) PutToken

func (r *Firestore) PutToken(ctx context.Context, token *auth.Token) error

Token related methods

func (*Firestore) RemoveTagFromAllAlerts added in v0.2.0

func (r *Firestore) RemoveTagFromAllAlerts(ctx context.Context, name string) error

func (*Firestore) RemoveTagFromAllTickets added in v0.2.0

func (r *Firestore) RemoveTagFromAllTickets(ctx context.Context, name string) error

func (*Firestore) RemoveTagIDFromAllAlerts added in v0.2.0

func (r *Firestore) RemoveTagIDFromAllAlerts(ctx context.Context, tagID string) error

func (*Firestore) RemoveTagIDFromAllTickets added in v0.2.0

func (r *Firestore) RemoveTagIDFromAllTickets(ctx context.Context, tagID string) error

func (*Firestore) SearchAlerts

func (r *Firestore) SearchAlerts(ctx context.Context, path, op string, value any, limit int) (alert.Alerts, error)

func (*Firestore) UnbindAlertFromTicket

func (r *Firestore) UnbindAlertFromTicket(ctx context.Context, alertID types.AlertID) error

func (*Firestore) UpdateTag added in v0.2.0

func (r *Firestore) UpdateTag(ctx context.Context, tag *tag.Tag) error

type Memory

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

func NewMemory

func NewMemory() *Memory

func (*Memory) BatchGetAlerts

func (r *Memory) BatchGetAlerts(ctx context.Context, alertIDs []types.AlertID) (alert.Alerts, error)

func (*Memory) BatchGetTickets

func (r *Memory) BatchGetTickets(ctx context.Context, ticketIDs []types.TicketID) ([]*ticket.Ticket, error)

func (*Memory) BatchPutAlerts

func (r *Memory) BatchPutAlerts(ctx context.Context, alerts alert.Alerts) error

func (*Memory) BatchUpdateTicketsStatus

func (r *Memory) BatchUpdateTicketsStatus(ctx context.Context, ticketIDs []types.TicketID, status types.TicketStatus) error

func (*Memory) BindAlertsToTicket added in v0.1.0

func (r *Memory) BindAlertsToTicket(ctx context.Context, alertIDs []types.AlertID, ticketID types.TicketID) error

func (*Memory) CountActivities

func (r *Memory) CountActivities(ctx context.Context) (int, error)

func (*Memory) CountAlertsWithoutTicket added in v0.1.0

func (r *Memory) CountAlertsWithoutTicket(ctx context.Context) (int, error)

func (*Memory) CountTicketComments

func (r *Memory) CountTicketComments(ctx context.Context, ticketID types.TicketID) (int, error)

func (*Memory) CountTicketsByStatus

func (r *Memory) CountTicketsByStatus(ctx context.Context, statuses []types.TicketStatus) (int, error)

func (*Memory) CreateTagWithID added in v0.2.0

func (r *Memory) CreateTagWithID(ctx context.Context, tag *tag.Tag) error

func (*Memory) DeleteTagByID added in v0.2.0

func (r *Memory) DeleteTagByID(ctx context.Context, tagID string) error

func (*Memory) DeleteToken

func (r *Memory) DeleteToken(ctx context.Context, tokenID auth.TokenID) error

func (*Memory) FindNearestAlerts

func (r *Memory) FindNearestAlerts(ctx context.Context, embedding []float32, limit int) (alert.Alerts, error)

func (*Memory) FindNearestTickets

func (r *Memory) FindNearestTickets(ctx context.Context, embedding []float32, limit int) ([]*ticket.Ticket, error)

func (*Memory) FindNearestTicketsWithSpan

func (r *Memory) FindNearestTicketsWithSpan(ctx context.Context, embedding []float32, begin, end time.Time, limit int) ([]*ticket.Ticket, error)

func (*Memory) FindSimilarAlerts

func (r *Memory) FindSimilarAlerts(ctx context.Context, target alert.Alert, limit int) (alert.Alerts, error)

func (*Memory) GetActivities

func (r *Memory) GetActivities(ctx context.Context, offset, limit int) ([]*activity.Activity, error)

func (*Memory) GetAlert

func (r *Memory) GetAlert(ctx context.Context, alertID types.AlertID) (*alert.Alert, error)

func (*Memory) GetAlertList

func (r *Memory) GetAlertList(ctx context.Context, listID types.AlertListID) (*alert.List, error)

func (*Memory) GetAlertListByThread

func (r *Memory) GetAlertListByThread(ctx context.Context, thread slack.Thread) (*alert.List, error)

func (*Memory) GetAlertListsInThread

func (r *Memory) GetAlertListsInThread(ctx context.Context, thread slack.Thread) ([]*alert.List, error)

func (*Memory) GetAlertWithoutEmbedding

func (r *Memory) GetAlertWithoutEmbedding(ctx context.Context) (alert.Alerts, error)

func (*Memory) GetAlertWithoutTicket

func (r *Memory) GetAlertWithoutTicket(ctx context.Context, offset, limit int) (alert.Alerts, error)

func (*Memory) GetAlertsBySpan

func (r *Memory) GetAlertsBySpan(ctx context.Context, begin, end time.Time) (alert.Alerts, error)

func (*Memory) GetAlertsWithInvalidEmbedding added in v0.1.0

func (r *Memory) GetAlertsWithInvalidEmbedding(ctx context.Context) (alert.Alerts, error)

func (*Memory) GetAllCallCounts

func (r *Memory) GetAllCallCounts() map[string]int

GetAllCallCounts returns a copy of all call counts

func (*Memory) GetCallCount

func (r *Memory) GetCallCount(methodName string) int

GetCallCount returns the number of times a method has been called

func (*Memory) GetLatestAlertByThread

func (r *Memory) GetLatestAlertByThread(ctx context.Context, thread slack.Thread) (*alert.Alert, error)

func (*Memory) GetLatestAlertListInThread

func (r *Memory) GetLatestAlertListInThread(ctx context.Context, thread slack.Thread) (*alert.List, error)

func (*Memory) GetLatestHistory

func (r *Memory) GetLatestHistory(ctx context.Context, ticketID types.TicketID) (*ticket.History, error)

func (*Memory) GetOrCreateTagByName added in v0.2.0

func (r *Memory) GetOrCreateTagByName(ctx context.Context, name, description, color, createdBy string) (*tag.Tag, error)

GetOrCreateTagByName atomically gets an existing tag or creates a new one

func (*Memory) GetTagByID added in v0.2.0

func (r *Memory) GetTagByID(ctx context.Context, tagID string) (*tag.Tag, error)

func (*Memory) GetTagByName added in v0.2.0

func (r *Memory) GetTagByName(ctx context.Context, name string) (*tag.Tag, error)

func (*Memory) GetTagsByIDs added in v0.2.0

func (r *Memory) GetTagsByIDs(ctx context.Context, tagIDs []string) ([]*tag.Tag, error)

func (*Memory) GetTicket

func (r *Memory) GetTicket(ctx context.Context, ticketID types.TicketID) (*ticket.Ticket, error)

func (*Memory) GetTicketByThread

func (r *Memory) GetTicketByThread(ctx context.Context, thread slack.Thread) (*ticket.Ticket, error)

func (*Memory) GetTicketComments

func (r *Memory) GetTicketComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)

func (*Memory) GetTicketCommentsPaginated

func (r *Memory) GetTicketCommentsPaginated(ctx context.Context, ticketID types.TicketID, offset, limit int) ([]ticket.Comment, error)

func (*Memory) GetTicketUnpromptedComments

func (r *Memory) GetTicketUnpromptedComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)

func (*Memory) GetTicketsBySpan

func (r *Memory) GetTicketsBySpan(ctx context.Context, start, end time.Time) ([]*ticket.Ticket, error)

func (*Memory) GetTicketsByStatus

func (r *Memory) GetTicketsByStatus(ctx context.Context, statuses []types.TicketStatus, offset, limit int) ([]*ticket.Ticket, error)

func (*Memory) GetTicketsByStatusAndSpan

func (r *Memory) GetTicketsByStatusAndSpan(ctx context.Context, status types.TicketStatus, begin, end time.Time) ([]*ticket.Ticket, error)

func (*Memory) GetTicketsWithInvalidEmbedding added in v0.1.0

func (r *Memory) GetTicketsWithInvalidEmbedding(ctx context.Context) ([]*ticket.Ticket, error)

func (*Memory) GetToken

func (r *Memory) GetToken(ctx context.Context, tokenID auth.TokenID) (*auth.Token, error)

func (*Memory) IsTagNameExists added in v0.2.0

func (r *Memory) IsTagNameExists(ctx context.Context, name string) (bool, error)

func (*Memory) ListAllTags added in v0.2.0

func (r *Memory) ListAllTags(ctx context.Context) ([]*tag.Tag, error)

func (*Memory) PutActivity

func (r *Memory) PutActivity(ctx context.Context, activity *activity.Activity) error

Activity related methods

func (*Memory) PutAlert

func (r *Memory) PutAlert(ctx context.Context, alert alert.Alert) error

func (*Memory) PutAlertList

func (r *Memory) PutAlertList(ctx context.Context, list *alert.List) error

func (*Memory) PutHistory

func (r *Memory) PutHistory(ctx context.Context, ticketID types.TicketID, history *ticket.History) error

func (*Memory) PutTicket

func (r *Memory) PutTicket(ctx context.Context, t ticket.Ticket) error

func (*Memory) PutTicketComment

func (r *Memory) PutTicketComment(ctx context.Context, comment ticket.Comment) error

func (*Memory) PutTicketCommentsPrompted

func (r *Memory) PutTicketCommentsPrompted(ctx context.Context, ticketID types.TicketID, commentIDs []types.CommentID) error

func (*Memory) PutToken

func (r *Memory) PutToken(ctx context.Context, token *auth.Token) error

Token related methods

func (*Memory) RemoveTagFromAllAlerts added in v0.2.0

func (r *Memory) RemoveTagFromAllAlerts(ctx context.Context, name string) error

func (*Memory) RemoveTagFromAllTickets added in v0.2.0

func (r *Memory) RemoveTagFromAllTickets(ctx context.Context, name string) error

func (*Memory) RemoveTagIDFromAllAlerts added in v0.2.0

func (r *Memory) RemoveTagIDFromAllAlerts(ctx context.Context, tagID string) error

func (*Memory) RemoveTagIDFromAllTickets added in v0.2.0

func (r *Memory) RemoveTagIDFromAllTickets(ctx context.Context, tagID string) error

func (*Memory) ResetCallCounts

func (r *Memory) ResetCallCounts()

ResetCallCounts clears all call counters

func (*Memory) SearchAlerts

func (r *Memory) SearchAlerts(ctx context.Context, path, op string, value any, limit int) (alert.Alerts, error)

func (*Memory) UnbindAlertFromTicket

func (r *Memory) UnbindAlertFromTicket(ctx context.Context, alertID types.AlertID) error

func (*Memory) UpdateTag added in v0.2.0

func (r *Memory) UpdateTag(ctx context.Context, tag *tag.Tag) error

Jump to

Keyboard shortcuts

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