inbox

package
v0.0.0-...-63545c7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DisableAdvisoryLock     = false
	UseBlockingAdvisoryLock = true
)

Functions

func NewInboxGRPCHandler

func NewInboxGRPCHandler(watchSvc InboxWatchService) pb.InboxServiceServer

func NewInboxMessageHandler

func NewInboxMessageHandler(inboxMessage InboxMessageService, generic services.GenericService, agentOwnership AgentOwnershipChecker) *inboxMessageHandler

func NewMockInboxMessageDao

func NewMockInboxMessageDao() *inboxMessageDaoMock

func PresentInboxMessage

func PresentInboxMessage(inboxMessage *InboxMessage) openapi.InboxMessage

Types

type AgentOwnershipChecker

type AgentOwnershipChecker interface {
	VerifyAgentProject(ctx context.Context, agentID, projectID string) *errors.ServiceError
}

type InboxMessage

type InboxMessage struct {
	api.Meta
	AgentId     string  `json:"agent_id"`
	FromAgentId *string `json:"from_agent_id"`
	FromName    *string `json:"from_name"`
	Body        string  `json:"body"`
	Read        *bool   `json:"read"`
}

func ConvertInboxMessage

func ConvertInboxMessage(inboxMessage openapi.InboxMessage) *InboxMessage

func (*InboxMessage) BeforeCreate

func (d *InboxMessage) BeforeCreate(tx *gorm.DB) error

type InboxMessageDao

type InboxMessageDao interface {
	Get(ctx context.Context, id string) (*InboxMessage, error)
	Create(ctx context.Context, inboxMessage *InboxMessage) (*InboxMessage, error)
	Replace(ctx context.Context, inboxMessage *InboxMessage) (*InboxMessage, error)
	Delete(ctx context.Context, id string) error
	FindByIDs(ctx context.Context, ids []string) (InboxMessageList, error)
	All(ctx context.Context) (InboxMessageList, error)
	UnreadByAgentID(ctx context.Context, agentID string) (InboxMessageList, error)
}

func NewInboxMessageDao

func NewInboxMessageDao(sessionFactory *db.SessionFactory) InboxMessageDao

type InboxMessageIndex

type InboxMessageIndex map[string]*InboxMessage

type InboxMessageList

type InboxMessageList []*InboxMessage

func (InboxMessageList) Index

type InboxMessagePatchRequest

type InboxMessagePatchRequest struct {
	Read *bool `json:"read,omitempty"`
}

type InboxMessageService

type InboxMessageService interface {
	Get(ctx context.Context, id string) (*InboxMessage, *errors.ServiceError)
	Create(ctx context.Context, inboxMessage *InboxMessage) (*InboxMessage, *errors.ServiceError)
	Replace(ctx context.Context, inboxMessage *InboxMessage) (*InboxMessage, *errors.ServiceError)
	Delete(ctx context.Context, id string) *errors.ServiceError
	All(ctx context.Context) (InboxMessageList, *errors.ServiceError)
	UnreadByAgentID(ctx context.Context, agentID string) (InboxMessageList, *errors.ServiceError)

	FindByIDs(ctx context.Context, ids []string) (InboxMessageList, *errors.ServiceError)

	OnUpsert(ctx context.Context, id string) error
	OnDelete(ctx context.Context, id string) error
}

func NewInboxMessageService

func NewInboxMessageService(lockFactory db.LockFactory, inboxMessageDao InboxMessageDao, events services.EventService, watchSvc InboxWatchService) InboxMessageService

type InboxWatchService

type InboxWatchService interface {
	Subscribe(ctx context.Context, agentID string) (<-chan *InboxMessage, func())
	Notify(msg *InboxMessage)
}

func NewInboxWatchService

func NewInboxWatchService() InboxWatchService

type ServiceLocator

type ServiceLocator func() InboxMessageService

func NewServiceLocator

func NewServiceLocator(env *environments.Env) ServiceLocator

Jump to

Keyboard shortcuts

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