Documentation
¶
Overview ¶
Package groups owns ProductCore group CRUD, listing, lifecycle, and policy actions.
Index ¶
- func RecordFromView(view View) dirextalkdomain.GroupRecord
- func RecordsFromViews(views []View) []dirextalkdomain.GroupRecord
- type Config
- type ConversationPort
- type Module
- func (m *Module) ByRoom(ctx context.Context, roomID string) (View, bool, error)
- func (m *Module) Create(ctx context.Context, raw map[string]any) (any, *actionbase.Error)
- func (m *Module) Delete(ctx context.Context, roomID string) error
- func (m *Module) Dissolve(ctx context.Context, raw map[string]any) (any, *actionbase.Error)
- func (m *Module) Handlers() map[string]actionbase.Handler
- func (m *Module) List(ctx context.Context) ([]View, error)
- func (m *Module) ListJoined(ctx context.Context, userID string) ([]View, error)
- func (m *Module) Save(ctx context.Context, group View) error
- func (m *Module) Update(ctx context.Context, raw map[string]any) (any, *actionbase.Error)
- func (m *Module) WithOperation(ctx context.Context, group View, action, status string) (View, error)
- type Store
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecordFromView ¶
func RecordFromView(view View) dirextalkdomain.GroupRecord
func RecordsFromViews ¶
func RecordsFromViews(views []View) []dirextalkdomain.GroupRecord
Types ¶
type Config ¶
type Config struct {
CreateRoom func(context.Context, View) (string, *actionbase.Error)
SaveOwnerMember func(context.Context, string) error
PublishState func(context.Context, View, bool) error
SetMemberMute func(context.Context, string, bool) *actionbase.Error
RequireOwner func(context.Context, string) *actionbase.Error
OwnerMXID func() string
}
Config contains the narrow Matrix, membership, and identity boundaries used by group workflows. Durable group and conversation state remain module-owned.
type ConversationPort ¶
type ConversationPort interface {
Save(ctx context.Context, record dirextalkdomain.ConversationRecord) error
DeleteKindByRoom(ctx context.Context, roomID string, kind dirextalkdomain.ConversationKind) error
Operation(ctx context.Context, action, status, roomID string) (map[string]any, *dirextalkdomain.ConversationView, error)
}
ConversationPort owns the related durable conversation projection.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) Handlers ¶
func (m *Module) Handlers() map[string]actionbase.Handler
Handlers returns the exact ProductCore action surface owned by the module.
func (*Module) ListJoined ¶
type Store ¶
type Store interface {
UpsertGroup(ctx context.Context, group dirextalkdomain.GroupRecord) error
DeleteGroup(ctx context.Context, roomID string) error
ListGroups(ctx context.Context) ([]dirextalkdomain.GroupRecord, error)
GetGroupByRoom(ctx context.Context, roomID string) (dirextalkdomain.GroupRecord, bool, error)
ListJoinedGroupsForUser(ctx context.Context, userID string) ([]dirextalkdomain.GroupRecord, error)
}
Store is the durable group repository used by Module.
type View ¶
type View struct {
RoomID string `json:"room_id"`
Name string `json:"name"`
Topic string `json:"topic"`
AvatarURL string `json:"avatar_url"`
MemberCount int64 `json:"member_count"`
InvitePolicy string `json:"invite_policy"`
Muted bool `json:"muted"`
Operation map[string]any `json:"operation,omitempty"`
Conversation *dirextalkdomain.ConversationView `json:"conversation,omitempty"`
}
View is the public ProductCore group response. Operation and Conversation are response-only presentation fields and are never written to Store.
func ViewFromRecord ¶
func ViewFromRecord(record dirextalkdomain.GroupRecord) View
func ViewsFromRecords ¶
func ViewsFromRecords(records []dirextalkdomain.GroupRecord) []View