interfaces

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertUsecases

type AlertUsecases interface {
	// Alert related handlers
	HandleAlert(ctx context.Context, schema types.AlertSchema, alertData any) ([]*alert.Alert, error)
}

type Clients

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

func NewClients

func NewClients(opts ...Option) *Clients

func (*Clients) LLM

func (c *Clients) LLM() gollem.LLMClient

func (*Clients) Repository

func (c *Clients) Repository() Repository

func (*Clients) Storage

func (c *Clients) Storage() StorageClient

type EmbeddingClient

type EmbeddingClient interface {
	Embeddings(ctx context.Context, texts []string, dimensionality int) ([][]float32, error)
}

type LLMClient

type LLMClient interface {
	gollem.LLMClient
}

type LLMSession

type LLMSession interface {
	gollem.Session
}

type Option

type Option func(*Clients)

func WithLLMClient

func WithLLMClient(llm gollem.LLMClient) Option

func WithRepository

func WithRepository(repo Repository) Option

func WithStorageClient

func WithStorageClient(storage StorageClient) Option

type PolicyClient

type PolicyClient interface {
	Query(context.Context, string, any, any, ...opaq.QueryOption) error
	Sources() map[string]string
}

type Repository

type Repository interface {
	GetTicket(ctx context.Context, ticketID types.TicketID) (*ticket.Ticket, error)
	BatchGetTickets(ctx context.Context, ticketIDs []types.TicketID) ([]*ticket.Ticket, error)
	PutTicket(ctx context.Context, ticket ticket.Ticket) error
	BatchUpdateTicketsStatus(ctx context.Context, ticketIDs []types.TicketID, status types.TicketStatus) error
	GetTicketByThread(ctx context.Context, thread slack.Thread) (*ticket.Ticket, error)
	FindNearestTickets(ctx context.Context, embedding []float32, limit int) ([]*ticket.Ticket, error)
	FindNearestTicketsWithSpan(ctx context.Context, embedding []float32, begin, end time.Time, limit int) ([]*ticket.Ticket, error)
	GetTicketsByStatus(ctx context.Context, statuses []types.TicketStatus, offset, limit int) ([]*ticket.Ticket, error)
	CountTicketsByStatus(ctx context.Context, statuses []types.TicketStatus) (int, error)
	GetTicketsBySpan(ctx context.Context, begin, end time.Time) ([]*ticket.Ticket, error)
	GetTicketsByStatusAndSpan(ctx context.Context, status types.TicketStatus, begin, end time.Time) ([]*ticket.Ticket, error)

	// For comment management
	PutTicketComment(ctx context.Context, comment ticket.Comment) error
	GetTicketComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)
	GetTicketCommentsPaginated(ctx context.Context, ticketID types.TicketID, offset, limit int) ([]ticket.Comment, error)
	CountTicketComments(ctx context.Context, ticketID types.TicketID) (int, error)
	GetTicketUnpromptedComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)
	PutTicketCommentsPrompted(ctx context.Context, ticketID types.TicketID, commentIDs []types.CommentID) error

	BatchBindAlertsToTicket(ctx context.Context, alertIDs []types.AlertID, ticketID types.TicketID) error
	BindAlertToTicket(ctx context.Context, alertID types.AlertID, ticketID types.TicketID) error
	UnbindAlertFromTicket(ctx context.Context, alertID types.AlertID) error

	PutAlert(ctx context.Context, alert alert.Alert) error
	BatchPutAlerts(ctx context.Context, alerts alert.Alerts) error
	GetAlert(ctx context.Context, alertID types.AlertID) (*alert.Alert, error)
	GetLatestAlertByThread(ctx context.Context, thread slack.Thread) (*alert.Alert, error)
	SearchAlerts(ctx context.Context, path, op string, value any, limit int) (alert.Alerts, error)
	GetAlertWithoutTicket(ctx context.Context, offset, limit int) (alert.Alerts, error)
	GetAlertsBySpan(ctx context.Context, begin, end time.Time) (alert.Alerts, error)
	BatchGetAlerts(ctx context.Context, alertIDs []types.AlertID) (alert.Alerts, error)
	FindNearestAlerts(ctx context.Context, embedding []float32, limit int) (alert.Alerts, error)

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

	// For list management
	GetAlertList(ctx context.Context, listID types.AlertListID) (*alert.List, error)
	PutAlertList(ctx context.Context, list *alert.List) error
	GetAlertListByThread(ctx context.Context, thread slack.Thread) (*alert.List, error)
	GetLatestAlertListInThread(ctx context.Context, thread slack.Thread) (*alert.List, error)
	GetAlertListsInThread(ctx context.Context, thread slack.Thread) ([]*alert.List, error)

	GetAlertWithoutEmbedding(ctx context.Context) (alert.Alerts, error)

	// For authentication management
	PutToken(ctx context.Context, token *auth.Token) error
	GetToken(ctx context.Context, tokenID auth.TokenID) (*auth.Token, error)
	DeleteToken(ctx context.Context, tokenID auth.TokenID) error

	// For activity management
	PutActivity(ctx context.Context, activity *activity.Activity) error
	GetActivities(ctx context.Context, offset, limit int) ([]*activity.Activity, error)
	CountActivities(ctx context.Context) (int, error)
}

type SlackClient

type SlackClient interface {
	PostMessageContext(ctx context.Context, channelID string, options ...slack.MsgOption) (string, string, error)
	UpdateMessageContext(ctx context.Context, channelID, timestamp string, options ...slack.MsgOption) (string, string, string, error)
	AuthTest() (*slack.AuthTestResponse, error)
	GetTeamInfo() (*slack.TeamInfo, error)
	OpenView(triggerID string, view slack.ModalViewRequest) (*slack.ViewResponse, error)
	UpdateView(view slack.ModalViewRequest, externalID, hash, viewID string) (*slack.ViewResponse, error)
	UploadFileV2Context(ctx context.Context, params slack.UploadFileV2Parameters) (*slack.FileSummary, error)
	GetUserInfo(userID string) (*slack.User, error)
	GetUsersInfo(users ...string) (*[]slack.User, error)
	GetConversationInfo(input *slack.GetConversationInfoInput) (*slack.Channel, error)
	GetUserGroups(options ...slack.GetUserGroupsOption) ([]slack.UserGroup, error)
	GetBotInfoContext(ctx context.Context, parameters slack.GetBotInfoParameters) (*slack.Bot, error)
}

type SlackEventUsecases

type SlackEventUsecases interface {
	// Slack event handlers
	HandleSlackMessage(ctx context.Context, slackMsg slack.Message) error
	HandleSlackAppMention(ctx context.Context, slackMsg slack.Message) error
}

type SlackInteractionUsecases

type SlackInteractionUsecases interface {
	// Slack interaction handlers
	HandleSlackInteractionViewSubmission(ctx context.Context, user slack.User, callbackID slack.CallbackID, metadata string, values slack.StateValue) error
	HandleSlackInteractionBlockActions(ctx context.Context, user slack.User, slackThread slack.Thread, actionID slack.ActionID, value, triggerID string) error
	HandleSalvageRefresh(ctx context.Context, user slack.User, metadata string, values slack.StateValue, viewID string) error
}

type SlackThreadService

type SlackThreadService interface {
	Reply(ctx context.Context, message string)
	NewStateFunc(ctx context.Context, message string) func(ctx context.Context, msg string)
}

type StorageClient

type StorageClient interface {
	PutObject(ctx context.Context, object string) io.WriteCloser
	GetObject(ctx context.Context, object string) (io.ReadCloser, error)
	Close(ctx context.Context)
}

type Tool

type Tool interface {
	Name() string
	Flags() []cli.Flag
	Configure(ctx context.Context) error
	LogValue() slog.Value
	Helper() *cli.Command
	Prompt(ctx context.Context) (string, error)
	gollem.ToolSet
}

type UserUsecases

type UserUsecases interface {
	// User related handlers
	GetUserIcon(ctx context.Context, userID string) ([]byte, string, error)
	GetUserProfile(ctx context.Context, userID string) (string, error)
}

Jump to

Keyboard shortcuts

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