Documentation
¶
Index ¶
- Constants
- func NewMessageHandler(session SessionService, msg MessageService) *messageHandler
- func NewMockSessionDao() *sessionDaoMock
- func NewSessionGRPCHandler(service SessionService, generic services.GenericService, ...) pb.SessionServiceServer
- func NewSessionHandler(session SessionService, msg MessageService, generic services.GenericService) *sessionHandler
- func PresentSession(session *Session) openapi.Session
- type MessageDao
- type MessageService
- type MessageServiceLocator
- type ServiceLocator
- type Session
- type SessionDao
- type SessionIndex
- type SessionList
- type SessionMessage
- type SessionPatchRequest
- type SessionService
- type SessionStatusPatchRequest
Constants ¶
View Source
const EventSource = "Sessions"
Variables ¶
This section is empty.
Functions ¶
func NewMessageHandler ¶
func NewMessageHandler(session SessionService, msg MessageService) *messageHandler
func NewMockSessionDao ¶
func NewMockSessionDao() *sessionDaoMock
func NewSessionGRPCHandler ¶
func NewSessionGRPCHandler(service SessionService, generic services.GenericService, brokerFunc func() *server.EventBroker, msgService MessageService) pb.SessionServiceServer
func NewSessionHandler ¶
func NewSessionHandler(session SessionService, msg MessageService, generic services.GenericService) *sessionHandler
func PresentSession ¶
Types ¶
type MessageDao ¶
type MessageDao interface {
Insert(ctx context.Context, msg *SessionMessage) error
AllBySessionIDAfterSeq(ctx context.Context, sessionID string, afterSeq int64) ([]SessionMessage, error)
}
func NewMessageDao ¶
func NewMessageDao(sessionFactory *db.SessionFactory) MessageDao
type MessageService ¶
type MessageService interface {
Push(ctx context.Context, sessionID, eventType, payload string) (*SessionMessage, error)
Subscribe(ctx context.Context, sessionID string) (<-chan *SessionMessage, func())
AllBySessionIDAfterSeq(ctx context.Context, sessionID string, afterSeq int64) ([]SessionMessage, error)
}
func MessageSvc ¶
func MessageSvc(s *environments.Services) MessageService
func NewMessageService ¶
func NewMessageService(dao MessageDao) MessageService
type MessageServiceLocator ¶
type MessageServiceLocator func() MessageService
func NewMessageServiceLocator ¶
func NewMessageServiceLocator(env *environments.Env) MessageServiceLocator
type ServiceLocator ¶
type ServiceLocator func() SessionService
func NewServiceLocator ¶
func NewServiceLocator(env *environments.Env) ServiceLocator
type Session ¶
type Session struct {
api.Meta
Name string `json:"name"`
RepoUrl *string `json:"repo_url"`
Prompt *string `json:"prompt"`
CreatedByUserId *string `json:"created_by_user_id"`
AssignedUserId *string `json:"assigned_user_id"`
WorkflowId *string `json:"workflow_id"`
Repos *string `json:"repos"`
Timeout *int32 `json:"timeout"`
LlmModel *string `json:"llm_model"`
LlmTemperature *float64 `json:"llm_temperature"`
LlmMaxTokens *int32 `json:"llm_max_tokens"`
ParentSessionId *string `json:"parent_session_id"`
BotAccountName *string `json:"bot_account_name"`
ResourceOverrides *string `json:"resource_overrides"`
EnvironmentVariables *string `json:"environment_variables"`
SessionLabels *string `json:"labels" gorm:"column:labels"`
SessionAnnotations *string `json:"annotations" gorm:"column:annotations"`
ProjectId *string `json:"project_id"`
Phase *string `json:"phase"`
StartTime *time.Time `json:"start_time"`
CompletionTime *time.Time `json:"completion_time"`
SdkSessionId *string `json:"sdk_session_id"`
SdkRestartCount *int32 `json:"sdk_restart_count"`
Conditions *string `json:"conditions"`
ReconciledRepos *string `json:"reconciled_repos"`
ReconciledWorkflow *string `json:"reconciled_workflow"`
KubeCrName *string `json:"kube_cr_name"`
KubeCrUid *string `json:"kube_cr_uid"`
KubeNamespace *string `json:"kube_namespace"`
}
func ConvertSession ¶
type SessionDao ¶
type SessionDao interface {
Get(ctx context.Context, id string) (*Session, error)
Create(ctx context.Context, session *Session) (*Session, error)
Replace(ctx context.Context, session *Session) (*Session, error)
Delete(ctx context.Context, id string) error
FindByIDs(ctx context.Context, ids []string) (SessionList, error)
All(ctx context.Context) (SessionList, error)
AllByProjectId(ctx context.Context, projectId string) (SessionList, error)
}
func NewSessionDao ¶
func NewSessionDao(sessionFactory *db.SessionFactory) SessionDao
type SessionIndex ¶
type SessionList ¶
type SessionList []*Session
func (SessionList) Index ¶
func (l SessionList) Index() SessionIndex
type SessionMessage ¶
type SessionMessage struct {
ID string `gorm:"column:id;primaryKey;type:varchar(36)" json:"id"`
SessionID string `gorm:"column:session_id;type:varchar(36)" json:"session_id"`
Seq int64 `gorm:"column:seq" json:"seq"`
EventType string `gorm:"column:event_type;type:varchar(255)" json:"event_type"`
Payload string `gorm:"column:payload;type:text" json:"payload"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamptz" json:"created_at"`
}
func (SessionMessage) TableName ¶
func (SessionMessage) TableName() string
type SessionPatchRequest ¶
type SessionPatchRequest struct {
Name *string `json:"name,omitempty"`
RepoUrl *string `json:"repo_url,omitempty"`
Prompt *string `json:"prompt,omitempty"`
AssignedUserId *string `json:"assigned_user_id,omitempty"`
WorkflowId *string `json:"workflow_id,omitempty"`
Repos *string `json:"repos,omitempty"`
Timeout *int32 `json:"timeout,omitempty"`
LlmModel *string `json:"llm_model,omitempty"`
LlmTemperature *float64 `json:"llm_temperature,omitempty"`
LlmMaxTokens *int32 `json:"llm_max_tokens,omitempty"`
ParentSessionId *string `json:"parent_session_id,omitempty"`
BotAccountName *string `json:"bot_account_name,omitempty"`
ResourceOverrides *string `json:"resource_overrides,omitempty"`
EnvironmentVariables *string `json:"environment_variables,omitempty"`
SessionLabels *string `json:"labels,omitempty"`
SessionAnnotations *string `json:"annotations,omitempty"`
}
type SessionService ¶
type SessionService interface {
Get(ctx context.Context, id string) (*Session, *errors.ServiceError)
Create(ctx context.Context, session *Session) (*Session, *errors.ServiceError)
Replace(ctx context.Context, session *Session) (*Session, *errors.ServiceError)
Delete(ctx context.Context, id string) *errors.ServiceError
All(ctx context.Context) (SessionList, *errors.ServiceError)
AllByProjectId(ctx context.Context, projectId string) (SessionList, *errors.ServiceError)
UpdateStatus(ctx context.Context, id string, patch *SessionStatusPatchRequest) (*Session, *errors.ServiceError)
Start(ctx context.Context, id string) (*Session, *errors.ServiceError)
Stop(ctx context.Context, id string) (*Session, *errors.ServiceError)
FindByIDs(ctx context.Context, ids []string) (SessionList, *errors.ServiceError)
OnUpsert(ctx context.Context, id string) error
OnDelete(ctx context.Context, id string) error
}
func NewSessionService ¶
func NewSessionService(lockFactory db.LockFactory, sessionDao SessionDao, events services.EventService) SessionService
func Service ¶
func Service(s *environments.Services) SessionService
type SessionStatusPatchRequest ¶
type SessionStatusPatchRequest struct {
Phase *string `json:"phase,omitempty"`
StartTime *time.Time `json:"start_time,omitempty"`
CompletionTime *time.Time `json:"completion_time,omitempty"`
SdkSessionId *string `json:"sdk_session_id,omitempty"`
SdkRestartCount *int32 `json:"sdk_restart_count,omitempty"`
Conditions *string `json:"conditions,omitempty"`
ReconciledRepos *string `json:"reconciled_repos,omitempty"`
ReconciledWorkflow *string `json:"reconciled_workflow,omitempty"`
KubeCrUid *string `json:"kube_cr_uid,omitempty"`
KubeNamespace *string `json:"kube_namespace,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.