42 lines
1.7 KiB
Go
42 lines
1.7 KiB
Go
package domain
|
|
|
|
import "context"
|
|
|
|
// Repository persists studio domain entities (memory or mon).
|
|
type Repository interface {
|
|
// Persona
|
|
SavePersona(ctx context.Context, p *Persona) error
|
|
GetPersona(ctx context.Context, id string) (*Persona, error)
|
|
ListPersonas(ctx context.Context, ownerUID int64) ([]*Persona, error)
|
|
DeletePersona(ctx context.Context, id string) error
|
|
GetActivePersonaID(ctx context.Context, ownerUID int64) (string, error)
|
|
SetActivePersonaID(ctx context.Context, ownerUID int64, personaID string) error
|
|
|
|
// Play
|
|
SavePlay(ctx context.Context, p *Play) error
|
|
GetPlay(ctx context.Context, id string) (*Play, error)
|
|
ListPlays(ctx context.Context, ownerUID int64) ([]*Play, error)
|
|
DeletePlay(ctx context.Context, id string) error
|
|
|
|
// Outbox
|
|
SaveOutbox(ctx context.Context, b *OutboxBundle) error
|
|
GetOutbox(ctx context.Context, id string) (*OutboxBundle, error)
|
|
ListOutbox(ctx context.Context, ownerUID int64) ([]*OutboxBundle, error)
|
|
DeleteOutbox(ctx context.Context, id string) error
|
|
// ListDueSteps returns bundles that may have due scheduled steps (all owners for worker).
|
|
ListAllOutbox(ctx context.Context) ([]*OutboxBundle, error)
|
|
|
|
// OwnPosts
|
|
SaveOwnPost(ctx context.Context, p *OwnPost) error
|
|
GetOwnPost(ctx context.Context, id string) (*OwnPost, error)
|
|
ListOwnPosts(ctx context.Context, ownerUID int64, accountID string) ([]*OwnPost, error)
|
|
DeleteOwnPost(ctx context.Context, id string) error
|
|
GetSyncMeta(ctx context.Context, ownerUID int64) (*SyncMeta, error)
|
|
SetSyncMeta(ctx context.Context, m *SyncMeta) error
|
|
|
|
// Mentions
|
|
SaveMention(ctx context.Context, m *Mention) error
|
|
GetMention(ctx context.Context, id string) (*Mention, error)
|
|
ListMentions(ctx context.Context, ownerUID int64, accountID string) ([]*Mention, error)
|
|
}
|