Documentation ¶
Overview ¶
Package service includes all of the services used in Emissary. This maps loosely to the "Use Cases" concept in the "Clean Architecture" design pattern (https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
Services include server-level singletons that are used by every domain (such as themes, templates, etc) and domain-level services that have unique instances for each domain.
* Server-level serivces are created by the server.Factory and are passed by reference to each domain factory.
* Domain-level services are created by the domain.Factory, and typically require a connection to a database table, which is why they are not global.
Index ¶
- Constants
- func ParseProfileURL(value string) (urlValue *url.URL, userID primitive.ObjectID, objectType string, ...)
- func ParseProfileURL_AsFollowing(value string) (primitive.ObjectID, primitive.ObjectID, error)
- func ParseProfileURL_UserID(value string) (primitive.ObjectID, error)
- func WatchStreams(collection *mongo.Collection, result chan<- model.Stream)
- type ActivityStream
- func (service *ActivityStream) Delete(url string) error
- func (service *ActivityStream) Load(url string, options ...any) (streams.Document, error)
- func (service *ActivityStream) NewDocument(document map[string]any) streams.Document
- func (service *ActivityStream) PurgeCache() error
- func (service *ActivityStream) Put(document streams.Document)
- func (service *ActivityStream) QueryAnnouncesBeforeDate(relationHref string, maxDate int64, done <-chan struct{}) <-chan streams.Document
- func (service *ActivityStream) QueryLikesBeforeDate(relationHref string, maxDate int64, done <-chan struct{}) <-chan streams.Document
- func (service *ActivityStream) QueryRepliesAfterDate(inReplyTo string, minDate int64, done <-chan struct{}) <-chan streams.Document
- func (service *ActivityStream) QueryRepliesBeforeDate(inReplyTo string, maxDate int64, done <-chan struct{}) <-chan streams.Document
- func (service *ActivityStream) Refresh(innerClient streams.Client, cacheClient *ascache.Client, ...)
- func (service *ActivityStream) SearchActors(queryString string) ([]model.ActorSummary, error)
- type Attachment
- func (service *Attachment) Close()
- func (service *Attachment) Delete(attachment *model.Attachment, note string) error
- func (service *Attachment) DeleteAll(objectType string, objectID primitive.ObjectID, note string) error
- func (service *Attachment) DeleteByID(objectType string, objectID primitive.ObjectID, ...) error
- func (service *Attachment) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Attachment) Load(criteria exp.Expression, result *model.Attachment) error
- func (service *Attachment) LoadByID(objectType string, objectID primitive.ObjectID, ...) error
- func (service *Attachment) LoadFirstByObjectID(objectType string, objectID primitive.ObjectID) (model.Attachment, error)
- func (service *Attachment) New() model.Attachment
- func (service *Attachment) Query(criteria exp.Expression, options ...option.Option) ([]model.Attachment, error)
- func (service *Attachment) QueryByObjectID(objectType string, objectID primitive.ObjectID) ([]model.Attachment, error)
- func (service *Attachment) Refresh(collection data.Collection, mediaServer mediaserver.MediaServer, host string)
- func (service *Attachment) Save(attachment *model.Attachment, note string) error
- func (service *Attachment) Schema() schema.Schema
- type AuthorSetter
- type Config
- type Content
- func (service *Content) ApplyLinks(content *model.Content)
- func (service *Content) ApplyTags(content *model.Content, tags []model.Tag)
- func (service *Content) Format(content *model.Content)
- func (service *Content) FormatByExtension(extension string) string
- func (service *Content) New(format string, raw string) model.Content
- func (service *Content) NewByExtension(extension string, raw string) model.Content
- type Domain
- func (service *Domain) ActiveClients() []model.Client
- func (service *Domain) Client(providerID string) model.Client
- func (service *Domain) Close()
- func (service *Domain) Get() model.Domain
- func (service *Domain) GetOAuthToken(providerID string) (model.Client, *oauth2.Token, error)
- func (service *Domain) GetPointer() *model.Domain
- func (service *Domain) HasSignupForm() bool
- func (service *Domain) LoadDomain() (model.Domain, error)
- func (service *Domain) LoadOrCreateDomain() (model.Domain, error)
- func (service *Domain) ManualProvider(providerID string) (providers.ManualProvider, bool)
- func (service *Domain) NewOAuthClient(providerID string) (model.Client, error)
- func (service *Domain) OAuthClientCallbackURL(providerID string) string
- func (service *Domain) OAuthCodeURL(providerID string) (string, error)
- func (service *Domain) OAuthExchange(providerID string, state string, code string) error
- func (service *Domain) OAuthProvider(providerID string) (providers.OAuthProvider, bool)
- func (service *Domain) ObjectDelete(object data.Object, note string) error
- func (service *Domain) ObjectID(object data.Object) primitive.ObjectID
- func (service *Domain) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Domain) ObjectLoad(_ exp.Expression) (data.Object, error)
- func (service *Domain) ObjectNew() data.Object
- func (service *Domain) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Domain) ObjectSave(object data.Object, note string) error
- func (service *Domain) ObjectType() string
- func (service *Domain) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Domain) Provider(providerID string) (providers.Provider, bool)
- func (service *Domain) ReadOAuthClient(providerID string) (model.Client, bool)
- func (service *Domain) Ready() bool
- func (service *Domain) Refresh(collection data.Collection, configuration config.Domain, themeService *Theme, ...)
- func (service *Domain) Save(domain model.Domain, note string) error
- func (service *Domain) Schema() schema.Schema
- func (service *Domain) Theme() model.Theme
- type DomainEmail
- type EncryptionKey
- func (service *EncryptionKey) Close()
- func (service *EncryptionKey) Create(parentType string, parentID primitive.ObjectID) (model.EncryptionKey, error)
- func (service *EncryptionKey) Delete(encryptionKey *model.EncryptionKey, note string) error
- func (service *EncryptionKey) GetPrivateKey(encryptionKey *model.EncryptionKey) (*rsa.PrivateKey, error)
- func (service *EncryptionKey) GetPublicKey(encryptionKey *model.EncryptionKey) (*rsa.PublicKey, error)
- func (service *EncryptionKey) KeyID(encryptionKey *model.EncryptionKey) string
- func (service *EncryptionKey) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *EncryptionKey) Load(criteria exp.Expression, encryptionKey *model.EncryptionKey) error
- func (service *EncryptionKey) LoadByParentID(parentType string, parentID primitive.ObjectID, ...) error
- func (service *EncryptionKey) OwnerID(encryptionKey *model.EncryptionKey) string
- func (service *EncryptionKey) Refresh(collection data.Collection, host string)
- func (service *EncryptionKey) Save(encryptionKey *model.EncryptionKey, note string) error
- func (service *EncryptionKey) Sign(message []byte, encryptionKey *model.EncryptionKey) ([]byte, error)
- func (service *EncryptionKey) Verify(message []byte, signature []byte, encryptionKey *model.EncryptionKey) error
- type Filesystem
- func (filesystem *Filesystem) GetAfero(folder mapof.String) (afero.Fs, error)
- func (filesystem *Filesystem) GetAferos(folders ...mapof.String) []afero.Fs
- func (filesystem *Filesystem) GetFS(folder mapof.String) (fs.FS, error)
- func (filesystem *Filesystem) GetFSs(folders ...mapof.String) []fs.FS
- func (filesystem *Filesystem) Watch(folder mapof.String, changes chan<- bool, done <-chan channel.Done) error
- type Folder
- func (service *Folder) CalculateUnreadCount(userID primitive.ObjectID, folderID primitive.ObjectID) error
- func (service *Folder) Close()
- func (service *Folder) CreateDefaultFolders(userID primitive.ObjectID) error
- func (service *Folder) Delete(folder *model.Folder, note string) error
- func (service *Folder) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Folder) ListByUserID(userID primitive.ObjectID) (data.Iterator, error)
- func (service *Folder) Load(criteria exp.Expression, result *model.Folder) error
- func (service *Folder) LoadByID(userID primitive.ObjectID, folderID primitive.ObjectID, result *model.Folder) error
- func (service *Folder) LoadByLabel(userID primitive.ObjectID, label string, result *model.Folder) error
- func (service *Folder) LoadByOriginURL(userID primitive.ObjectID, originURL string, result *model.Folder) error
- func (service *Folder) LoadByToken(userID primitive.ObjectID, token string, result *model.Folder) error
- func (service *Folder) New() model.Folder
- func (service *Folder) ObjectDelete(object data.Object, comment string) error
- func (service *Folder) ObjectID(object data.Object) primitive.ObjectID
- func (service *Folder) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Folder) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Folder) ObjectNew() data.Object
- func (service *Folder) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Folder) ObjectSave(object data.Object, comment string) error
- func (service *Folder) ObjectType() string
- func (service *Folder) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Folder) Query(criteria exp.Expression, options ...option.Option) ([]model.Folder, error)
- func (service *Folder) QueryByUserID(userID primitive.ObjectID) ([]model.Folder, error)
- func (service *Folder) ReCalculateUnreadCountFromFolder(userID primitive.ObjectID, folderID primitive.ObjectID) error
- func (service *Folder) Refresh(collection data.Collection, themeService *Theme, domainService *Domain, ...)
- func (service *Folder) Save(folder *model.Folder, note string) error
- func (service *Folder) Schema() schema.Schema
- func (service *Folder) SetUnreadCount(userID primitive.ObjectID, folderID primitive.ObjectID, unreadCount int) error
- type FolderLookupProvider
- type Follower
- func (service *Follower) ActivityPubFollowersChannel(parentType string, parentID primitive.ObjectID) (<-chan model.Follower, error)
- func (service *Follower) ActivityPubID(follower *model.Follower) string
- func (service *Follower) ActivityPubObjectID(follower *model.Follower) string
- func (service *Follower) AsJSONLD(follower *model.Follower) mapof.Any
- func (service *Follower) Channel(criteria exp.Expression, options ...option.Option) (<-chan model.Follower, error)
- func (service *Follower) Close()
- func (service *Follower) Delete(follower *model.Follower, note string) error
- func (service *Follower) FollowersChannel(parentType string, parentID primitive.ObjectID) (<-chan model.Follower, error)
- func (service *Follower) IsActivityPubFollower(streamID primitive.ObjectID, followerURL string) bool
- func (service *Follower) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Follower) ListActivityPub(parentID primitive.ObjectID, options ...option.Option) (data.Iterator, error)
- func (service *Follower) ListByParent(parentID primitive.ObjectID, options ...option.Option) (data.Iterator, error)
- func (service *Follower) Load(criteria exp.Expression, follower *model.Follower) error
- func (service *Follower) LoadByActivityPubFollower(parentID primitive.ObjectID, followerURL string, follower *model.Follower) error
- func (service *Follower) LoadByActor(parentID primitive.ObjectID, actorID string, follower *model.Follower) error
- func (service *Follower) LoadByToken(parentID primitive.ObjectID, token string, follower *model.Follower) error
- func (service *Follower) LoadByWebSub(objectType string, parentID primitive.ObjectID, callback string, ...) error
- func (service *Follower) LoadOrCreate(parentID primitive.ObjectID, actorID string) (model.Follower, error)
- func (service *Follower) LoadOrCreateByWebSub(objectType string, parentID primitive.ObjectID, callback string) (model.Follower, error)
- func (service *Follower) NewActivityPubFollower(parentType string, parentID primitive.ObjectID, actor streams.Document, ...) error
- func (service *Follower) ObjectDelete(object data.Object, comment string) error
- func (service *Follower) ObjectID(object data.Object) primitive.ObjectID
- func (service *Follower) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Follower) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Follower) ObjectNew() data.Object
- func (service *Follower) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Follower) ObjectSave(object data.Object, comment string) error
- func (service *Follower) ObjectType() string
- func (service *Follower) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Follower) Query(criteria exp.Expression, options ...option.Option) ([]model.Follower, error)
- func (service *Follower) QueryByParentAndDate(parentType string, parentID primitive.ObjectID, method string, ...) ([]model.Follower, error)
- func (service *Follower) Refresh(collection data.Collection, userService *User, ruleService *Rule, ...)
- func (service *Follower) RemoteActor(follower *model.Follower) (streams.Document, error)
- func (service *Follower) Save(follower *model.Follower, note string) error
- func (service *Follower) Schema() schema.Schema
- func (service *Follower) WebSubFollowersChannel(parentType string, parentID primitive.ObjectID) (<-chan model.Follower, error)
- type Following
- func (service *Following) ActivityPubActorID(following *model.Following) string
- func (service *Following) ActivityPubID(following *model.Following) string
- func (service *Following) AsJSONLD(following *model.Following) mapof.Any
- func (service *Following) Close()
- func (service *Following) Connect(following model.Following) error
- func (service *Following) Delete(following *model.Following, note string) error
- func (service *Following) Disconnect(following *model.Following)
- func (service *Following) GetFollowingID(userID primitive.ObjectID, uri string) (string, error)
- func (service *Following) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Following) ListActivityPub(userID primitive.ObjectID, options ...option.Option) (data.Iterator, error)
- func (service *Following) ListByUserID(userID primitive.ObjectID) (data.Iterator, error)
- func (service *Following) ListPollable() (data.Iterator, error)
- func (service *Following) Load(criteria exp.Expression, result *model.Following) error
- func (service *Following) LoadByID(userID primitive.ObjectID, followingID primitive.ObjectID, ...) error
- func (service *Following) LoadByToken(userID primitive.ObjectID, token string, result *model.Following) error
- func (service *Following) LoadByURL(userID primitive.ObjectID, profileUrl string, result *model.Following) error
- func (service *Following) New() model.Following
- func (service *Following) ObjectDelete(object data.Object, note string) error
- func (service *Following) ObjectID(object data.Object) primitive.ObjectID
- func (service *Following) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Following) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Following) ObjectNew() data.Object
- func (service *Following) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Following) ObjectSave(object data.Object, note string) error
- func (service *Following) ObjectType() string
- func (service *Following) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Following) PurgeInbox(following model.Following) error
- func (service *Following) Query(criteria exp.Expression, options ...option.Option) ([]model.Following, error)
- func (service *Following) QueryByFolder(userID primitive.ObjectID, folderID primitive.ObjectID) ([]model.FollowingSummary, error)
- func (service *Following) QueryByFolderAndExp(userID primitive.ObjectID, folderID primitive.ObjectID, ...) ([]model.FollowingSummary, error)
- func (service *Following) QueryByUser(userID primitive.ObjectID) ([]model.FollowingSummary, error)
- func (service *Following) Refresh(collection data.Collection, streamService *Stream, userService *User, ...)
- func (service *Following) RefreshAndConnect(following model.Following)
- func (service *Following) Save(following *model.Following, note string) error
- func (service *Following) SaveMessage(following *model.Following, document streams.Document, originType string) error
- func (service *Following) Schema() schema.Schema
- func (service *Following) SetStatusFailure(following *model.Following, statusMessage string) error
- func (service *Following) SetStatusLoading(following *model.Following) error
- func (service *Following) SetStatusSuccess(following *model.Following) error
- func (service *Following) Start()
- type Group
- func (service *Group) Close()
- func (service *Group) Count(criteria exp.Expression) (int64, error)
- func (service *Group) Delete(group *model.Group, note string) error
- func (service *Group) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Group) ListAsOptions() []form.LookupCode
- func (service *Group) ListByGroup(group string) (data.Iterator, error)
- func (service *Group) ListByIDs(groupIDs ...primitive.ObjectID) ([]model.Group, error)
- func (service *Group) Load(criteria exp.Expression, result *model.Group) error
- func (service *Group) LoadByID(groupID primitive.ObjectID, result *model.Group) error
- func (service *Group) LoadByToken(token string, result *model.Group) error
- func (service *Group) ObjectDelete(object data.Object, comment string) error
- func (service *Group) ObjectID(object data.Object) primitive.ObjectID
- func (service *Group) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Group) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Group) ObjectNew() data.Object
- func (service *Group) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Group) ObjectSave(object data.Object, comment string) error
- func (service *Group) ObjectType() string
- func (service *Group) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Group) Query(criteria exp.Expression, options ...option.Option) ([]model.Group, error)
- func (service *Group) Refresh(collection data.Collection)
- func (service *Group) Save(group *model.Group, note string) error
- func (service *Group) Schema() schema.Schema
- func (service *Group) Startup(theme *model.Theme) error
- type GroupLookupProvider
- type Icons
- type Inbox
- func (service *Inbox) CalculateRank(message *model.Message)
- func (service *Inbox) Close()
- func (service *Inbox) CountUnreadMessages(userID primitive.ObjectID, folderID primitive.ObjectID) (int, error)
- func (service *Inbox) Delete(message *model.Message, note string) error
- func (service *Inbox) DeleteByFolder(userID primitive.ObjectID, folderID primitive.ObjectID) error
- func (service *Inbox) DeleteByOrigin(internalID primitive.ObjectID, note string) error
- func (service *Inbox) DeleteMany(criteria exp.Expression, note string) error
- func (service *Inbox) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Inbox) ListByFolder(userID primitive.ObjectID, folderID primitive.ObjectID) (data.Iterator, error)
- func (service *Inbox) ListByFollowingID(userID primitive.ObjectID, followingID primitive.ObjectID) (data.Iterator, error)
- func (service *Inbox) Load(criteria exp.Expression, result *model.Message) error
- func (service *Inbox) LoadByID(userID primitive.ObjectID, messageID primitive.ObjectID, result *model.Message) error
- func (service *Inbox) LoadByRank(userID primitive.ObjectID, folderID primitive.ObjectID, ...) error
- func (service *Inbox) LoadByURL(userID primitive.ObjectID, url string, result *model.Message) error
- func (service *Inbox) LoadOldestUnread(userID primitive.ObjectID, message *model.Message) error
- func (service *Inbox) LoadSibling(folderID primitive.ObjectID, rank int64, following string, direction string) (model.Message, error)
- func (service *Inbox) LoadUnreadByURL(userID primitive.ObjectID, url string, result *model.Message) error
- func (service *Inbox) MarkMuted(message *model.Message) error
- func (service *Inbox) MarkRead(message *model.Message) error
- func (service *Inbox) MarkReadByDate(userID primitive.ObjectID, rank int64) error
- func (service *Inbox) MarkUnmuted(message *model.Message) error
- func (service *Inbox) MarkUnread(message *model.Message) error
- func (service *Inbox) New() model.Message
- func (service *Inbox) ObjectDelete(object data.Object, note string) error
- func (service *Inbox) ObjectID(object data.Object) primitive.ObjectID
- func (service *Inbox) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Inbox) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Inbox) ObjectNew() data.Object
- func (service *Inbox) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Inbox) ObjectSave(object data.Object, note string) error
- func (service *Inbox) ObjectType() string
- func (service *Inbox) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Inbox) Query(criteria exp.Expression, options ...option.Option) ([]model.Message, error)
- func (service *Inbox) QueryByUserID(userID primitive.ObjectID, criteria exp.Expression, options ...option.Option) ([]model.Message, error)
- func (service *Inbox) QueryPurgeable(following *model.Following) ([]model.Message, error)
- func (service *Inbox) Refresh(collection data.Collection, ruleService *Rule, folderService *Folder, ...)
- func (service *Inbox) Save(message *model.Message, note string) error
- func (service *Inbox) Schema() schema.Schema
- func (service *Inbox) UpdateInboxFolders(userID primitive.ObjectID, followingID primitive.ObjectID, ...)
- type JWT
- func (service *JWT) Close()
- func (service *JWT) FindJWTKey(token *jwt.Token) (any, error)
- func (service *JWT) NewJWTKey() (string, any)
- func (service *JWT) Parse(request *http.Request) (*jwt.Token, error)
- func (service *JWT) ParseString(tokenString string) (*jwt.Token, error)
- func (service *JWT) Refresh(collection data.Collection, keyEncryptingKey []byte)
- type Locator
- type LookupProvider
- type Mention
- func (service *Mention) Close()
- func (service *Mention) Delete(mention *model.Mention, note string) error
- func (service *Mention) DiscoverEndpoint(url string) (string, error)
- func (service *Mention) FindLinks(body string) []string
- func (service *Mention) GetPageInfo(body *bytes.Buffer, originURL string, mention *model.Mention) error
- func (service *Mention) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Mention) Load(criteria exp.Expression, mention *model.Mention) error
- func (service *Mention) LoadByOrigin(objectType string, objectID primitive.ObjectID, originURL string, ...) error
- func (service *Mention) LoadOrCreate(objectType string, objectID primitive.ObjectID, originURL string) (model.Mention, error)
- func (service *Mention) ObjectDelete(object data.Object, comment string) error
- func (service *Mention) ObjectID(object data.Object) primitive.ObjectID
- func (service *Mention) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Mention) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Mention) ObjectNew() data.Object
- func (service *Mention) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Mention) ObjectSave(object data.Object, comment string) error
- func (service *Mention) ObjectType() string
- func (service *Mention) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Mention) ParseURL(target string) (objectType string, token string, err error)
- func (service *Mention) Query(criteria exp.Expression, options ...option.Option) ([]model.Mention, error)
- func (service *Mention) QueryByObjectID(objectID primitive.ObjectID, options ...option.Option) ([]model.Mention, error)
- func (service *Mention) Refresh(collection data.Collection, ruleService *Rule, activityService *ActivityStream, ...)
- func (service *Mention) Save(mention *model.Mention, note string) error
- func (service *Mention) Schema() schema.Schema
- func (service *Mention) Send(source string, target string) error
- func (service *Mention) Verify(source string, target string, buffer io.Writer) error
- type ModelService
- type OAuthClient
- func (service *OAuthClient) Close()
- func (service *OAuthClient) Delete(app *model.OAuthClient, note string) error
- func (service *OAuthClient) Iterator(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *OAuthClient) Load(criteria exp.Expression, application *model.OAuthClient) error
- func (service *OAuthClient) LoadByClientID(clientID primitive.ObjectID, client *model.OAuthClient) error
- func (service *OAuthClient) Query(criteria exp.Expression, options ...option.Option) ([]model.OAuthClient, error)
- func (service *OAuthClient) Refresh(collection data.Collection, oauthUserTokenService *OAuthUserToken, host string)
- func (service *OAuthClient) Save(app *model.OAuthClient, note string) error
- func (service *OAuthClient) Schema() schema.Schema
- func (service *OAuthClient) ValidateClientSecret(clientID primitive.ObjectID, clientSecret string) error
- type OAuthUserToken
- func (service *OAuthUserToken) Close()
- func (service *OAuthUserToken) Create(client model.OAuthClient, authorization model.Authorization, ...) (model.OAuthUserToken, error)
- func (service *OAuthUserToken) CreateFromUser(user *model.User, clientID primitive.ObjectID, scope string) (model.OAuthUserToken, error)
- func (service *OAuthUserToken) Delete(application *model.OAuthUserToken, note string) error
- func (service *OAuthUserToken) DeleteByClient(clientID primitive.ObjectID, note string) error
- func (service *OAuthUserToken) DeleteMany(criteria exp.Expression, note string) error
- func (service *OAuthUserToken) Iterator(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *OAuthUserToken) JWT(userID primitive.ObjectID, scopes string) (string, error)
- func (service *OAuthUserToken) Load(criteria exp.Expression, application *model.OAuthUserToken) error
- func (service *OAuthUserToken) LoadByClientAndCode(userTokenID primitive.ObjectID, clientID primitive.ObjectID, ...) error
- func (service *OAuthUserToken) LoadByClientAndToken(clientID primitive.ObjectID, clientSecret string, token string, ...) error
- func (service *OAuthUserToken) LoadByUserAndClient(userID primitive.ObjectID, clientID primitive.ObjectID, ...) error
- func (service *OAuthUserToken) Query(criteria exp.Expression, options ...option.Option) ([]model.OAuthUserToken, error)
- func (service *OAuthUserToken) Refresh(collection data.Collection, oauthClientService *OAuthClient, jwtService *JWT, ...)
- func (service *OAuthUserToken) Save(application *model.OAuthUserToken, note string) error
- func (service *OAuthUserToken) Schema() schema.Schema
- type Origin
- func (service *Origin) Close()
- func (service *Origin) Poll(providerID string) <-chan model.Stream
- func (service *Origin) PollAll() <-chan model.Stream
- func (service *Origin) Refresh(domainService *Domain, streamService *Stream, providerService *Provider)
- func (service *Origin) Save(streams <-chan model.Stream) error
- type Outbox
- func (service *Outbox) Close()
- func (service *Outbox) Delete(outboxMessage *model.OutboxMessage, note string) error
- func (service *Outbox) DeleteByURL(parentType string, parentID primitive.ObjectID, url string) error
- func (service *Outbox) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Outbox) Load(criteria exp.Expression, result *model.OutboxMessage) error
- func (service *Outbox) LoadByURL(parentType string, parentID primitive.ObjectID, url string, ...) error
- func (service *Outbox) LoadOrCreate(parentType string, parentID primitive.ObjectID, url string) (model.OutboxMessage, error)
- func (service *Outbox) New() model.OutboxMessage
- func (service *Outbox) Publish(actor *outbox.Actor, parentType string, parentID primitive.ObjectID, ...) error
- func (service *Outbox) Query(criteria exp.Expression, options ...option.Option) ([]model.OutboxMessage, error)
- func (service *Outbox) QueryByParentID(parentType string, parentID primitive.ObjectID, criteria exp.Expression, ...) ([]model.OutboxMessage, error)
- func (service *Outbox) QueryByUserAndDate(parentType string, parentID primitive.ObjectID, maxDate int64, maxRows int) ([]model.OutboxMessageSummary, error)
- func (service *Outbox) Refresh(collection data.Collection, streamService *Stream, ...)
- func (service *Outbox) Save(outboxMessage *model.OutboxMessage, note string) error
- func (service *Outbox) UnPublish(actor *outbox.Actor, parentType string, parentID primitive.ObjectID, ...) error
- type Provider
- type RSS
- type Response
- func (service *Response) Close()
- func (service *Response) CountByContent(objectID string) (mapof.Int, error)
- func (service *Response) Delete(response *model.Response, note string) error
- func (service *Response) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Response) Load(criteria exp.Expression, response *model.Response) error
- func (service *Response) LoadByActorAndObject(actor string, object string, responseType string, response *model.Response) error
- func (service *Response) LoadByID(responseID primitive.ObjectID, response *model.Response) error
- func (service *Response) LoadByUserAndObject(userID primitive.ObjectID, object string, responseType string, ...) error
- func (service *Response) ObjectDelete(object data.Object, note string) error
- func (service *Response) ObjectID(object data.Object) primitive.ObjectID
- func (service *Response) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Response) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Response) ObjectNew() data.Object
- func (service *Response) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Response) ObjectSave(object data.Object, note string) error
- func (service *Response) ObjectType() string
- func (service *Response) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Response) Query(criteria exp.Expression, options ...option.Option) ([]model.Response, error)
- func (service *Response) QueryByObjectAndDate(objectID string, responseType string, maxDate int64, pageSize int) ([]model.Response, error)
- func (service *Response) QueryByUserAndDate(userID primitive.ObjectID, responseType string, maxDate int64, pageSize int) ([]model.Response, error)
- func (service *Response) QueryByUserAndObject(userID primitive.ObjectID, object string, options ...option.Option) ([]model.Response, error)
- func (service *Response) Refresh(collection data.Collection, userService *User, outboxService *Outbox, ...)
- func (service *Response) Save(response *model.Response, note string) error
- func (service *Response) Schema() schema.Schema
- func (service *Response) SetResponse(user *model.User, url string, responseType string, content string) error
- func (service *Response) UnsetResponse(user *model.User, url string, responseType string) error
- type Rule
- func (service *Rule) ActivityPubActorURL(rule model.Rule) string
- func (service *Rule) ActivityPubURL(rule model.Rule) string
- func (service *Rule) Channel(criteria exp.Expression, options ...option.Option) (<-chan model.Rule, error)
- func (service *Rule) Close()
- func (service *Rule) Delete(rule *model.Rule, note string) error
- func (service *Rule) Filter(userID primitive.ObjectID, options ...RuleFilterOption) RuleFilter
- func (service *Rule) JSONLD(rule model.Rule) mapof.Any
- func (service *Rule) JSONLDGetter(rule model.Rule) RuleJSONLDGetter
- func (service *Rule) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Rule) Load(criteria exp.Expression, rule *model.Rule) error
- func (service *Rule) LoadByFollowing(userID primitive.ObjectID, followingID primitive.ObjectID, ruleType string, ...) error
- func (service *Rule) LoadByID(userID primitive.ObjectID, ruleID primitive.ObjectID, rule *model.Rule) error
- func (service *Rule) LoadByToken(userID primitive.ObjectID, token string, rule *model.Rule) error
- func (service *Rule) LoadByTrigger(userID primitive.ObjectID, ruleType string, trigger string, rule *model.Rule) error
- func (service *Rule) ObjectDelete(object data.Object, comment string) error
- func (service *Rule) ObjectID(object data.Object) primitive.ObjectID
- func (service *Rule) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Rule) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Rule) ObjectNew() data.Object
- func (service *Rule) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Rule) ObjectSave(object data.Object, comment string) error
- func (service *Rule) ObjectType() string
- func (service *Rule) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Rule) Query(criteria exp.Expression, options ...option.Option) ([]model.Rule, error)
- func (service *Rule) QueryBlockedActors(userID primitive.ObjectID) ([]model.Rule, error)
- func (service *Rule) QueryByActor(userID primitive.ObjectID, actorID string) ([]model.RuleSummary, error)
- func (service *Rule) QueryByActorAndActions(userID primitive.ObjectID, actorID string, actions ...string) ([]model.RuleSummary, error)
- func (service *Rule) QueryByType(userID primitive.ObjectID, ruleType string, criteria exp.Expression, ...) ([]model.Rule, error)
- func (service *Rule) QueryByTypeActor(userID primitive.ObjectID, criteria exp.Expression, options ...option.Option) ([]model.Rule, error)
- func (service *Rule) QueryByTypeContent(userID primitive.ObjectID, criteria exp.Expression, options ...option.Option) ([]model.Rule, error)
- func (service *Rule) QueryByTypeDomain(userID primitive.ObjectID, criteria exp.Expression, options ...option.Option) ([]model.Rule, error)
- func (service *Rule) QueryDomainBlocks() ([]model.Rule, error)
- func (service *Rule) QueryPublic(userID primitive.ObjectID, maxDate int64, options ...option.Option) ([]model.Rule, error)
- func (service *Rule) QuerySummary(criteria exp.Expression, options ...option.Option) ([]model.RuleSummary, error)
- func (service *Rule) Refresh(collection data.Collection, outboxService *Outbox, userService *User, ...)
- func (service *Rule) Save(rule *model.Rule, note string) error
- func (service *Rule) Schema() schema.Schema
- type RuleFilter
- func (filter *RuleFilter) Allow(document *streams.Document) bool
- func (filter *RuleFilter) AllowSend(actorID string) bool
- func (filter *RuleFilter) Channel(ch <-chan streams.Document) <-chan streams.Document
- func (filter *RuleFilter) ChannelSend(ch <-chan model.Follower) <-chan string
- func (filter *RuleFilter) Disallow(document *streams.Document) bool
- func (filter *RuleFilter) Slice(documents []streams.Document) []streams.Document
- type RuleFilterOption
- type RuleJSONLDGetter
- type Scheduler
- type ServerEmail
- type SterankoUserService
- func (service SterankoUserService) Close()
- func (service SterankoUserService) Delete(user steranko.User, comment string) error
- func (service SterankoUserService) Load(username string, result steranko.User) error
- func (service SterankoUserService) New() steranko.User
- func (service SterankoUserService) NewClaims() jwt.Claims
- func (service SterankoUserService) RequestPasswordReset(user steranko.User) error
- func (service SterankoUserService) Save(user steranko.User, comment string) error
- type Stream
- func (service *Stream) ActivityPubActor(streamID primitive.ObjectID, withFollowers bool) (outbox.Actor, error)
- func (service *Stream) ActivityPubURL(streamID primitive.ObjectID) string
- func (service *Stream) CalcContext(stream *model.Stream)
- func (service *Stream) CalcParentIDs(stream *model.Stream) error
- func (service *Stream) CalcTags(stream *model.Stream)
- func (service *Stream) Close()
- func (service *Stream) Count(criteria exp.Expression) (int64, error)
- func (service *Stream) Delete(stream *model.Stream, note string) error
- func (service *Stream) DeleteByParent(parentID primitive.ObjectID, note string) error
- func (service *Stream) DeleteMany(criteria exp.Expression, note string) error
- func (service *Stream) DeleteRelatedDuplicate(parentID primitive.ObjectID, originalStreamID primitive.ObjectID) error
- func (service *Stream) JSONLD(stream *model.Stream) mapof.Any
- func (service *Stream) JSONLDGetter(stream *model.Stream) StreamJSONLDGetter
- func (service *Stream) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Stream) ListByParent(parentID primitive.ObjectID) (data.Iterator, error)
- func (service *Stream) ListByTemplate(template string) (data.Iterator, error)
- func (service *Stream) ListNavigation() (data.Iterator, error)
- func (service *Stream) Load(criteria exp.Expression, stream *model.Stream) error
- func (service *Stream) LoadByID(streamID primitive.ObjectID, result *model.Stream) error
- func (service *Stream) LoadByToken(token string, result *model.Stream) error
- func (service *Stream) LoadByURL(streamURL string, result *model.Stream) error
- func (service *Stream) LoadFirstAttachment(streamID primitive.ObjectID) (model.Attachment, error)
- func (service *Stream) LoadFirstSibling(parentID primitive.ObjectID, result *model.Stream) error
- func (service *Stream) LoadLastSibling(parentID primitive.ObjectID, result *model.Stream) error
- func (service *Stream) LoadNavigationByID(streamID primitive.ObjectID, result *model.Stream) error
- func (service *Stream) LoadNextSibling(parentID primitive.ObjectID, rank int, result *model.Stream) error
- func (service *Stream) LoadParent(stream *model.Stream, parent *model.Stream) error
- func (service *Stream) LoadPrevSibling(parentID primitive.ObjectID, rank int, result *model.Stream) error
- func (service *Stream) LoadWebFinger(token string) (digit.Resource, error)
- func (service *Stream) LoadWithOptions(criteria exp.Expression, result *model.Stream, options ...option.Option) error
- func (service *Stream) MaxRank(parentID primitive.ObjectID) (int, error)
- func (service *Stream) New() model.Stream
- func (service *Stream) ObjectDelete(object data.Object, note string) error
- func (service *Stream) ObjectID(object data.Object) primitive.ObjectID
- func (service *Stream) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *Stream) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *Stream) ObjectNew() data.Object
- func (service *Stream) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *Stream) ObjectSave(object data.Object, note string) error
- func (service *Stream) ObjectType() string
- func (service *Stream) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *Stream) ParsePath(uri *url.URL) (string, string, error)
- func (service *Stream) ParseURL(streamURL string) (primitive.ObjectID, error)
- func (service *Stream) Publish(user *model.User, stream *model.Stream) error
- func (service *Stream) PurgeDeleted(ancestorID primitive.ObjectID) error
- func (service *Stream) Query(criteria exp.Expression, options ...option.Option) ([]model.Stream, error)
- func (service *Stream) QueryByAncestorAndDate(streamID primitive.ObjectID, publishedDate int64, pageSize int) ([]model.Stream, error)
- func (service *Stream) QueryByParentAndDate(streamID primitive.ObjectID, publishedDate int64, pageSize int) ([]model.Stream, error)
- func (service *Stream) QueryByUser(userID primitive.ObjectID, criteria exp.Expression, options ...option.Option) ([]model.Stream, error)
- func (service *Stream) QuerySummary(criteria exp.Expression, options ...option.Option) ([]model.StreamSummary, error)
- func (service *Stream) Refresh(collection data.Collection, templateService *Template, ...)
- func (service *Stream) RestoreDeleted(ancestorID primitive.ObjectID) error
- func (service *Stream) Save(stream *model.Stream, note string) error
- func (service *Stream) Schema() schema.Schema
- func (service *Stream) SetLocationChild(template *model.Template, stream *model.Stream, parent *model.Stream) error
- func (service *Stream) SetLocationOutbox(template *model.Template, stream *model.Stream, userID primitive.ObjectID) error
- func (service *Stream) SetLocationTop(template *model.Template, stream *model.Stream) error
- func (service *Stream) Startup(theme *model.Theme) error
- func (service *Stream) UnPublish(user *model.User, stream *model.Stream) error
- func (service *Stream) UserCan(authorization *model.Authorization, stream *model.Stream, actionID string) error
- type StreamDraft
- func (service *StreamDraft) Close()
- func (service *StreamDraft) Delete(draft *model.Stream, _note string) error
- func (service *StreamDraft) Load(criteria exp.Expression, result *model.Stream) error
- func (service *StreamDraft) LoadByID(streamID primitive.ObjectID, result *model.Stream) error
- func (service *StreamDraft) New() model.Stream
- func (service *StreamDraft) ObjectDelete(object data.Object, comment string) error
- func (service *StreamDraft) ObjectID(object data.Object) primitive.ObjectID
- func (service *StreamDraft) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *StreamDraft) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *StreamDraft) ObjectNew() data.Object
- func (service *StreamDraft) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *StreamDraft) ObjectSave(object data.Object, comment string) error
- func (service *StreamDraft) ObjectType() string
- func (service *StreamDraft) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *StreamDraft) Promote(streamID primitive.ObjectID, stateID string) (model.Stream, error)
- func (service *StreamDraft) Refresh(collection data.Collection, streamService *Stream)
- func (service *StreamDraft) Save(draft *model.Stream, note string) error
- func (service *StreamDraft) Schema() schema.Schema
- type StreamJSONLDGetter
- type TaskCreateWebSubFollower
- type TaskReceiveWebMention
- type TaskSendWebMention
- type TaskSendWebSubMessage
- type Template
- func (service *Template) Add(templateID string, filesystem fs.FS, definition []byte) error
- func (service *Template) List(filter func(*model.Template) bool) []form.LookupCode
- func (service *Template) ListByContainer(containedByRole string) []form.LookupCode
- func (service *Template) ListByContainerLimited(containedByRole string, limitRoles sliceof.String) []form.LookupCode
- func (service *Template) Load(templateID string) (model.Template, error)
- func (service *Template) LoadAdmin(templateID string) (model.Template, error)
- func (service *Template) Refresh(locations sliceof.Object[mapof.String])
- func (service *Template) Schema(templateID string) (schema.Schema, error)
- func (service *Template) State(templateID string, stateID string) (model.State, error)
- type Theme
- type ThemeLookupProvider
- type User
- func (service *User) ActivityPubActor(userID primitive.ObjectID, withFollowers bool) (outbox.Actor, error)
- func (service *User) ActivityPubPublicKeyURL(userID primitive.ObjectID) string
- func (service *User) ActivityPubURL(userID primitive.ObjectID) string
- func (service *User) CalcFollowerCount(userID primitive.ObjectID)
- func (service *User) CalcFollowingCount(userID primitive.ObjectID)
- func (service *User) CalcRuleCount(userID primitive.ObjectID)
- func (service *User) Close()
- func (service *User) Count(ctx context.Context, criteria exp.Expression) (int64, error)
- func (service *User) Delete(user *model.User, note string) error
- func (service *User) DeleteAvatar(user *model.User, note string) error
- func (service *User) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *User) ListByGroup(group string) (data.Iterator, error)
- func (service *User) ListByIdentities(identities []string) (data.Iterator, error)
- func (service *User) ListOwners() (data.Iterator, error)
- func (service *User) ListOwnersAsSlice() []model.UserSummary
- func (service *User) ListUsernameOrOwner(username string) (data.Iterator, error)
- func (service *User) Load(criteria exp.Expression, result *model.User) error
- func (service *User) LoadByID(userID primitive.ObjectID, result *model.User) error
- func (service *User) LoadByProfileURL(profileUrl string, result *model.User) error
- func (service *User) LoadByResetCode(userID string, code string, user *model.User) error
- func (service *User) LoadByToken(token string, result *model.User) error
- func (service *User) LoadByUsername(username string, result *model.User) error
- func (service *User) LoadByUsernameOrEmail(usernameOrEmail string, result *model.User) error
- func (service *User) LoadWebFinger(username string) (digit.Resource, error)
- func (service *User) MakeNewPasswordResetCode(user *model.User) error
- func (service *User) ObjectDelete(object data.Object, note string) error
- func (service *User) ObjectID(object data.Object) primitive.ObjectID
- func (service *User) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
- func (service *User) ObjectLoad(criteria exp.Expression) (data.Object, error)
- func (service *User) ObjectNew() data.Object
- func (service *User) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
- func (service *User) ObjectSave(object data.Object, note string) error
- func (service *User) ObjectType() string
- func (service *User) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
- func (service *User) ParseProfileURL(value string) (primitive.ObjectID, error)
- func (service *User) Query(criteria exp.Expression, options ...option.Option) ([]model.User, error)
- func (service *User) QueryBlockedActors(userID primitive.ObjectID, criteria exp.Expression) ([]model.User, error)
- func (service *User) Refresh(userCollection data.Collection, followerCollection data.Collection, ...)
- func (service *User) RemoteFollowURL() string
- func (service *User) Save(user *model.User, note string) error
- func (service *User) Schema() schema.Schema
- func (service *User) SendPasswordResetEmail(user *model.User)
- func (service *User) SendWelcomeEmail(user *model.User)
- func (service *User) SetOwner(owner config.Owner) error
- type Widget
Constants ¶
const DefinitionEmail = "EMAIL"
DefinitionEmail marks a filesystem that contains an Email definition.
const DefinitionTemplate = "TEMPLATE"
DefinitionEmail marks a filesystem that contains a stream Template definition.
const DefinitionTheme = "THEME"
DefinitionEmail marks a filesystem that contains a domain Theme definition.
const DefinitionWidget = "WIDGET"
DefinitionWidget marks a filesystem that contains a Widget definition.
Variables ¶
This section is empty.
Functions ¶
func ParseProfileURL ¶
func WatchStreams ¶
func WatchStreams(collection *mongo.Collection, result chan<- model.Stream)
WatchStreams initiates a mongodb change stream to on every updates to Stream data objects
Types ¶
type ActivityStream ¶
type ActivityStream struct {
// contains filtered or unexported fields
}
ActivityStream implements the Hannibal HTTP client interface, and provides a cache for ActivityStream documents.
func NewActivityStream ¶
func NewActivityStream() ActivityStream
NewActivityStream creates a new ActivityStream service
func (*ActivityStream) Delete ¶
func (service *ActivityStream) Delete(url string) error
Delete removes a single document from the database by its URL
func (*ActivityStream) Load ¶
Load implements the Hannibal `Client` interface, and returns a streams.Document from the cache.
func (*ActivityStream) NewDocument ¶ added in v0.6.0
func (service *ActivityStream) NewDocument(document map[string]any) streams.Document
func (*ActivityStream) PurgeCache ¶ added in v0.6.0
func (service *ActivityStream) PurgeCache() error
PurgeCache removes all expired documents from the cache
func (*ActivityStream) Put ¶ added in v0.6.0
func (service *ActivityStream) Put(document streams.Document)
Put adds a single document to the ActivityStream cache
func (*ActivityStream) QueryAnnouncesBeforeDate ¶ added in v0.6.0
func (service *ActivityStream) QueryAnnouncesBeforeDate(relationHref string, maxDate int64, done <-chan struct{}) <-chan streams.Document
func (*ActivityStream) QueryLikesBeforeDate ¶ added in v0.6.0
func (service *ActivityStream) QueryLikesBeforeDate(relationHref string, maxDate int64, done <-chan struct{}) <-chan streams.Document
func (*ActivityStream) QueryRepliesAfterDate ¶ added in v0.6.0
func (service *ActivityStream) QueryRepliesAfterDate(inReplyTo string, minDate int64, done <-chan struct{}) <-chan streams.Document
QueryRepliesAfterDate returns a slice of streams.Document values that are replies to the specified document, and were published after the specified date.
func (*ActivityStream) QueryRepliesBeforeDate ¶ added in v0.6.0
func (service *ActivityStream) QueryRepliesBeforeDate(inReplyTo string, maxDate int64, done <-chan struct{}) <-chan streams.Document
QueryRepliesBeforeDate returns a slice of streams.Document values that are replies to the specified document, and were published before the specified date.
func (*ActivityStream) Refresh ¶
func (service *ActivityStream) Refresh(innerClient streams.Client, cacheClient *ascache.Client, collection data.Collection)
Refresh updates the ActivityStream service with new dependencies
func (*ActivityStream) SearchActors ¶ added in v0.6.0
func (service *ActivityStream) SearchActors(queryString string) ([]model.ActorSummary, error)
type Attachment ¶
type Attachment struct {
// contains filtered or unexported fields
}
Attachment manages all interactions with the Attachment collection
func NewAttachment ¶
func NewAttachment() Attachment
NewAttachment returns a fully populated Attachment service
func (*Attachment) Close ¶
func (service *Attachment) Close()
Close stops any background processes controlled by this service
func (*Attachment) Delete ¶
func (service *Attachment) Delete(attachment *model.Attachment, note string) error
Delete removes an Attachment from the database (virtual delete)
func (*Attachment) DeleteAll ¶
func (service *Attachment) DeleteAll(objectType string, objectID primitive.ObjectID, note string) error
DeleteByStream removes all attachments from the provided stream (virtual delete)
func (*Attachment) DeleteByID ¶
func (*Attachment) List ¶
func (service *Attachment) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Attachments who match the provided criteria
func (*Attachment) Load ¶
func (service *Attachment) Load(criteria exp.Expression, result *model.Attachment) error
Load retrieves an Attachment from the database
func (*Attachment) LoadByID ¶
func (service *Attachment) LoadByID(objectType string, objectID primitive.ObjectID, attachmentID primitive.ObjectID, result *model.Attachment) error
func (*Attachment) LoadFirstByObjectID ¶
func (service *Attachment) LoadFirstByObjectID(objectType string, objectID primitive.ObjectID) (model.Attachment, error)
func (*Attachment) New ¶
func (service *Attachment) New() model.Attachment
New creates a newly initialized Attachment that is ready to use
func (*Attachment) Query ¶
func (service *Attachment) Query(criteria exp.Expression, options ...option.Option) ([]model.Attachment, error)
func (*Attachment) QueryByObjectID ¶
func (service *Attachment) QueryByObjectID(objectType string, objectID primitive.ObjectID) ([]model.Attachment, error)
func (*Attachment) Refresh ¶
func (service *Attachment) Refresh(collection data.Collection, mediaServer mediaserver.MediaServer, host string)
Refresh updates any stateful data that is cached inside this service.
func (*Attachment) Save ¶
func (service *Attachment) Save(attachment *model.Attachment, note string) error
Save adds/updates an Attachment in the database
func (*Attachment) Schema ¶
func (service *Attachment) Schema() schema.Schema
type AuthorSetter ¶ added in v0.6.0
type Content ¶
type Content struct {
// contains filtered or unexported fields
}
func NewContent ¶
func NewContent(editorJS *goeditorjs.HTMLEngine) Content
func (*Content) ApplyLinks ¶ added in v0.6.0
func (*Content) FormatByExtension ¶ added in v0.6.0
type Domain ¶
type Domain struct {
// contains filtered or unexported fields
}
Domain service manages all access to the singleton model.Domain in the database
func (*Domain) ActiveClients ¶
ActiveClients returns all active Clients for this domain
func (*Domain) GetOAuthToken ¶
GetAuthToken retrieves the OAuth token for the specified provider. If the token has expired then it is refreshed (and saved) automatically before returning.
func (*Domain) GetPointer ¶ added in v0.6.0
func (*Domain) HasSignupForm ¶ added in v0.6.0
HasSignupForm returns TRUE if this domain allows new users to sign up.
func (*Domain) LoadDomain ¶ added in v0.6.0
func (*Domain) LoadOrCreateDomain ¶
LoadOrCreate domain guarantees that a domain record exists in the database. It returns A COPY of the service domain.
func (*Domain) ManualProvider ¶
func (service *Domain) ManualProvider(providerID string) (providers.ManualProvider, bool)
ManualProvider returns the external.ManualProvider that matches the given providerID
func (*Domain) NewOAuthClient ¶
NewOAuthState generates and returns a new OAuth state for the specified provider
func (*Domain) OAuthClientCallbackURL ¶ added in v0.6.0
OAuthClientCallbackURL returns the specific callback URL to use for this host and provider.
func (*Domain) OAuthCodeURL ¶
OAuthCodeURL generates a new (unique) OAuth state and AuthCodeURL for the specified provider
func (*Domain) OAuthExchange ¶
OAuthExchange trades a temporary OAuth code for a valid OAuth token
func (*Domain) OAuthProvider ¶
func (service *Domain) OAuthProvider(providerID string) (providers.OAuthProvider, bool)
OAuthProvider returns the external.OAuthProvider that matches the given providerID
func (*Domain) ObjectDelete ¶
func (*Domain) ObjectList ¶
func (*Domain) ObjectLoad ¶
func (*Domain) ObjectQuery ¶
func (*Domain) ObjectSave ¶
func (*Domain) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Domain) ObjectUserCan ¶
func (*Domain) ReadOAuthClient ¶
ReadOAuthState returns the OAuth state for the specified provider WITHOUT changing the current value. THIS SHOULD NOT BE USED TO ACCESS OAUTH TOKENS because they may be expired. Use GetOAuthToken for that.
func (*Domain) Refresh ¶
func (service *Domain) Refresh(collection data.Collection, configuration config.Domain, themeService *Theme, userService *User, providerService *Provider, funcMap template.FuncMap)
Refresh updates any stateful data that is cached inside this service.
type DomainEmail ¶
type DomainEmail struct {
// contains filtered or unexported fields
}
func NewDomainEmail ¶
func NewDomainEmail(serverEmail *ServerEmail) DomainEmail
func (*DomainEmail) Refresh ¶
func (service *DomainEmail) Refresh(configuration config.Domain)
func (*DomainEmail) SendPasswordReset ¶
func (service *DomainEmail) SendPasswordReset(user *model.User) error
SendPasswordReset sends a passowrd reset email to the user. This method swallows errors so that it can be run asynchronously.
func (*DomainEmail) SendWelcome ¶
func (service *DomainEmail) SendWelcome(user *model.User) error
SendWelcome sends a welcome email to the user. This method returns an error so that it CAN NOT be run asynchronously.
type EncryptionKey ¶
type EncryptionKey struct {
// contains filtered or unexported fields
}
EncryptionKey defines a service that tracks the (possibly external) accounts an internal User is encryptionKey.
func NewEncryptionKey ¶
func NewEncryptionKey() EncryptionKey
NewEncryptionKey returns a fully initialized EncryptionKey service
func (*EncryptionKey) Close ¶
func (service *EncryptionKey) Close()
Close stops any background processes controlled by this service
func (*EncryptionKey) Create ¶
func (service *EncryptionKey) Create(parentType string, parentID primitive.ObjectID) (model.EncryptionKey, error)
func (*EncryptionKey) Delete ¶
func (service *EncryptionKey) Delete(encryptionKey *model.EncryptionKey, note string) error
Delete removes an EncryptionKey from the database (virtual delete)
func (*EncryptionKey) GetPrivateKey ¶
func (service *EncryptionKey) GetPrivateKey(encryptionKey *model.EncryptionKey) (*rsa.PrivateKey, error)
func (*EncryptionKey) GetPublicKey ¶
func (service *EncryptionKey) GetPublicKey(encryptionKey *model.EncryptionKey) (*rsa.PublicKey, error)
func (*EncryptionKey) KeyID ¶
func (service *EncryptionKey) KeyID(encryptionKey *model.EncryptionKey) string
KeyID returns the publicly accessible URL of this EncryptionKey
func (*EncryptionKey) List ¶
func (service *EncryptionKey) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the EncryptionKeys who match the provided criteria
func (*EncryptionKey) Load ¶
func (service *EncryptionKey) Load(criteria exp.Expression, encryptionKey *model.EncryptionKey) error
Load retrieves an EncryptionKey from the database
func (*EncryptionKey) LoadByParentID ¶ added in v0.6.0
func (service *EncryptionKey) LoadByParentID(parentType string, parentID primitive.ObjectID, encryptionKey *model.EncryptionKey) error
LoadByID tries to load the EncryptionKey from the database. If no key exists for the designated user, then a new one is generated.
func (*EncryptionKey) OwnerID ¶
func (service *EncryptionKey) OwnerID(encryptionKey *model.EncryptionKey) string
OwnerID returns the publicly accessible URL of the Actor who owns this EncryptionKey
func (*EncryptionKey) Refresh ¶
func (service *EncryptionKey) Refresh(collection data.Collection, host string)
Refresh updates any stateful data that is cached inside this service.
func (*EncryptionKey) Save ¶
func (service *EncryptionKey) Save(encryptionKey *model.EncryptionKey, note string) error
Save adds/updates an EncryptionKey in the database
func (*EncryptionKey) Sign ¶
func (service *EncryptionKey) Sign(message []byte, encryptionKey *model.EncryptionKey) ([]byte, error)
func (*EncryptionKey) Verify ¶
func (service *EncryptionKey) Verify(message []byte, signature []byte, encryptionKey *model.EncryptionKey) error
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
Filesystem is a service that multiplexes between different filesystems. Currently works with embedded filesystems and file:// URIs
func NewFilesystem ¶
func NewFilesystem(embedded fs.FS) Filesystem
NewFilesytem returns a fully initialized Filesystem service
func (*Filesystem) GetAferos ¶
func (filesystem *Filesystem) GetAferos(folders ...mapof.String) []afero.Fs
GetAferos returns multiple afero filesystems
func (*Filesystem) GetFS ¶
GetFS returns a READONLY Filesystem. It works with embed:// and file:// URIs
type Folder ¶
type Folder struct {
// contains filtered or unexported fields
}
Folder manages all interactions with a user's Folder
func (*Folder) CalculateUnreadCount ¶ added in v0.6.0
func (service *Folder) CalculateUnreadCount(userID primitive.ObjectID, folderID primitive.ObjectID) error
CalculateUnreadCount counts the number of items in a folder that were created AFTER the provided minRank, then updates the folder's "unreadCount" and "readDate" fields
func (*Folder) Close ¶
func (service *Folder) Close()
Close stops any background processes controlled by this service
func (*Folder) CreateDefaultFolders ¶
func (*Folder) List ¶
func (service *Folder) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Folders that match the provided criteria
func (*Folder) ListByUserID ¶
ListByUserID returns an iterator containing all of the Folders for a given user
func (*Folder) LoadByID ¶
func (service *Folder) LoadByID(userID primitive.ObjectID, folderID primitive.ObjectID, result *model.Folder) error
LoadByID loads a single stream that matches the provided ID
func (*Folder) LoadByLabel ¶
func (service *Folder) LoadByLabel(userID primitive.ObjectID, label string, result *model.Folder) error
LoadByLabel loads a single stream that matches the provided label
func (*Folder) LoadByOriginURL ¶
func (service *Folder) LoadByOriginURL(userID primitive.ObjectID, originURL string, result *model.Folder) error
LoadBySource locates a single stream that matches the provided OriginURL
func (*Folder) LoadByToken ¶
func (service *Folder) LoadByToken(userID primitive.ObjectID, token string, result *model.Folder) error
LoadByToken loads a single stream that matches the provided token
func (*Folder) ObjectDelete ¶
func (*Folder) ObjectList ¶
func (*Folder) ObjectLoad ¶
func (*Folder) ObjectQuery ¶
func (*Folder) ObjectSave ¶
func (*Folder) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Folder) ObjectUserCan ¶
func (*Folder) Query ¶
func (service *Folder) Query(criteria exp.Expression, options ...option.Option) ([]model.Folder, error)
Query returns a slice of Folders that math the provided criteria
func (*Folder) QueryByUserID ¶
QueryByUserID returns all folders for a given user
func (*Folder) ReCalculateUnreadCountFromFolder ¶ added in v0.6.0
func (*Folder) Refresh ¶
func (service *Folder) Refresh(collection data.Collection, themeService *Theme, domainService *Domain, inboxService *Inbox)
Refresh updates any stateful data that is cached inside this service.
type FolderLookupProvider ¶
type FolderLookupProvider struct {
// contains filtered or unexported fields
}
func NewFolderLookupProvider ¶
func NewFolderLookupProvider(folderService *Folder, userID primitive.ObjectID) FolderLookupProvider
func (FolderLookupProvider) Add ¶
func (service FolderLookupProvider) Add(name string) (string, error)
func (FolderLookupProvider) Get ¶
func (service FolderLookupProvider) Get() []form.LookupCode
func (FolderLookupProvider) Group ¶
func (service FolderLookupProvider) Group(name string) form.LookupGroup
type Follower ¶
type Follower struct {
// contains filtered or unexported fields
}
func NewFollower ¶
func NewFollower() Follower
NewFollower returns a fully initialized Follower service
func (*Follower) ActivityPubFollowersChannel ¶ added in v0.6.0
func (service *Follower) ActivityPubFollowersChannel(parentType string, parentID primitive.ObjectID) (<-chan model.Follower, error)
ActivityPubFollowersChannel returns a channel containing all of the Followers of specific parentID who use ActivityPub for updates
func (*Follower) ActivityPubID ¶
func (*Follower) ActivityPubObjectID ¶
func (*Follower) Channel ¶ added in v0.6.0
func (service *Follower) Channel(criteria exp.Expression, options ...option.Option) (<-chan model.Follower, error)
Channel returns a channel containing all of the Followers who match the provided criteria
func (*Follower) Close ¶
func (service *Follower) Close()
Close stops any background processes controlled by this service
func (*Follower) FollowersChannel ¶ added in v0.6.0
func (service *Follower) FollowersChannel(parentType string, parentID primitive.ObjectID) (<-chan model.Follower, error)
FollowersChannel returns a channel containing all of the Followers of specific parentID
func (*Follower) IsActivityPubFollower ¶ added in v0.6.0
func (service *Follower) IsActivityPubFollower(streamID primitive.ObjectID, followerURL string) bool
IsActivityPubFollower searches
func (*Follower) List ¶
func (service *Follower) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Followers who match the provided criteria
func (*Follower) ListActivityPub ¶
func (service *Follower) ListActivityPub(parentID primitive.ObjectID, options ...option.Option) (data.Iterator, error)
ListActivityPub returns an iterator containing all of the Followers of specific parentID
func (*Follower) ListByParent ¶ added in v0.6.0
func (service *Follower) ListByParent(parentID primitive.ObjectID, options ...option.Option) (data.Iterator, error)
ListByParent returns an iterator containing all of the Followers of specific parentID
func (*Follower) LoadByActivityPubFollower ¶
func (*Follower) LoadByActor ¶
func (service *Follower) LoadByActor(parentID primitive.ObjectID, actorID string, follower *model.Follower) error
LoadByActor retrieves an Follower from the database by parentID and actorID
func (*Follower) LoadByToken ¶
func (service *Follower) LoadByToken(parentID primitive.ObjectID, token string, follower *model.Follower) error
LoadByToken loads a follower using either the FollowerID (if an ObjectID is passed) or the Actor's ProfileURL
func (*Follower) LoadByWebSub ¶
func (service *Follower) LoadByWebSub(objectType string, parentID primitive.ObjectID, callback string, result *model.Follower) error
LoadByWebSub retrieves a follower based on the parentID and callback
func (*Follower) LoadOrCreate ¶
func (*Follower) LoadOrCreateByWebSub ¶ added in v0.6.0
func (service *Follower) LoadOrCreateByWebSub(objectType string, parentID primitive.ObjectID, callback string) (model.Follower, error)
LoadOrCreateByWebSub finds a follower based on the parentID and callback. If no follower is found, a new record is created.
func (*Follower) NewActivityPubFollower ¶
func (*Follower) ObjectDelete ¶
func (*Follower) ObjectList ¶
func (*Follower) ObjectLoad ¶
func (*Follower) ObjectQuery ¶
func (*Follower) ObjectSave ¶
func (*Follower) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Follower) ObjectUserCan ¶
func (*Follower) QueryByParentAndDate ¶ added in v0.6.0
func (*Follower) Refresh ¶
func (service *Follower) Refresh(collection data.Collection, userService *User, ruleService *Rule, activityService *ActivityStream, queue queue.Queue, host string)
Refresh updates any stateful data that is cached inside this service.
func (*Follower) RemoteActor ¶ added in v0.6.0
RemoteActor returns the ActivityStream document for a remote Actor for a specific Follower
func (*Follower) WebSubFollowersChannel ¶ added in v0.6.0
func (service *Follower) WebSubFollowersChannel(parentType string, parentID primitive.ObjectID) (<-chan model.Follower, error)
WebSubFollowersChannel returns a channel containing all of the Followers of specific parentID who use WebSub for updates
type Following ¶
type Following struct {
// contains filtered or unexported fields
}
Following manages all interactions with the Following collection
func NewFollowing ¶
func NewFollowing() Following
NewFollowing returns a fully populated Following service.
func (*Following) ActivityPubActorID ¶
ActivityPubActorID returns the public URL (ID) of the actor being followed
func (*Following) ActivityPubID ¶
ActivityPubID returns the public URL (ID) of a Following record
func (*Following) Close ¶
func (service *Following) Close()
Close stops the following service watcher
func (*Following) Connect ¶
Connect attempts to connect to a new URL and determines how to follow it.
func (*Following) Disconnect ¶
func (*Following) GetFollowingID ¶ added in v0.6.0
func (*Following) List ¶
func (service *Following) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Following who match the provided criteria
func (*Following) ListActivityPub ¶
func (*Following) ListByUserID ¶
ListByUserID returns an iterator of all following for a given userID
func (*Following) ListPollable ¶
ListPollable returns an iterator of all following that are ready to be polled
func (*Following) LoadByID ¶
func (service *Following) LoadByID(userID primitive.ObjectID, followingID primitive.ObjectID, result *model.Following) error
LoadByID retrieves an Following from the database. UserID is required to prevent people from snooping on other's following.
func (*Following) LoadByToken ¶
func (service *Following) LoadByToken(userID primitive.ObjectID, token string, result *model.Following) error
LoadByToken loads an individual following using a string version of the following ID
func (*Following) LoadByURL ¶
func (service *Following) LoadByURL(userID primitive.ObjectID, profileUrl string, result *model.Following) error
LoadByURL loads an individual following using the target URL that is being followed
func (*Following) ObjectDelete ¶
func (*Following) ObjectList ¶
func (*Following) ObjectLoad ¶
func (*Following) ObjectQuery ¶
func (*Following) ObjectSave ¶
func (*Following) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Following) ObjectUserCan ¶
func (*Following) PurgeInbox ¶
PurgeInbox removes all inbox items that are past their expiration date. TODO: LOW: Should this be in the Inbox service?
func (*Following) Query ¶
func (service *Following) Query(criteria exp.Expression, options ...option.Option) ([]model.Following, error)
Query returns an iterator containing all of the Following who match the provided criteria
func (*Following) QueryByFolder ¶
func (service *Following) QueryByFolder(userID primitive.ObjectID, folderID primitive.ObjectID) ([]model.FollowingSummary, error)
QueryByFolder returns a slice of all following for a given user
func (*Following) QueryByFolderAndExp ¶ added in v0.6.0
func (service *Following) QueryByFolderAndExp(userID primitive.ObjectID, folderID primitive.ObjectID, criteria exp.Expression) ([]model.FollowingSummary, error)
QueryByFolderAndExp returns a slice of all following for a given user
func (*Following) QueryByUser ¶
QueryByUser returns a slice of all following for a given user
func (*Following) Refresh ¶
func (service *Following) Refresh(collection data.Collection, streamService *Stream, userService *User, inboxService *Inbox, folderService *Folder, keyService *EncryptionKey, activityService *ActivityStream, host string)
Refresh updates any stateful data that is cached inside this service.
func (*Following) RefreshAndConnect ¶ added in v0.6.0
func (*Following) SaveMessage ¶ added in v0.6.0
func (service *Following) SaveMessage(following *model.Following, document streams.Document, originType string) error
saveToInbox adds/updates an individual Message based on an RSS item. It returns TRUE if a new record was created
func (*Following) SetStatusFailure ¶ added in v0.6.0
SetStatusFailure updates a Following record to the "Failure" status and increments the error count.
func (*Following) SetStatusLoading ¶ added in v0.6.0
SetStatusLoading updates a Following record with the "Loading" status
func (*Following) SetStatusSuccess ¶ added in v0.6.0
SetStatusSuccess updates a Following record with the "Success" status and resets the error count to zero.
func (*Following) Start ¶
func (service *Following) Start()
Start begins the background scheduler that checks each following according to its own polling frequency TODO: HIGH: Need to make this configurable on a per-physical-server basis so that clusters can work together without hammering the Following collection.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group manages all interactions with the Group collection
func (*Group) Close ¶
func (service *Group) Close()
Close stops any background processes controlled by this service
func (*Group) Count ¶
func (service *Group) Count(criteria exp.Expression) (int64, error)
Count returns the number of (non-deleted) records in the User collection
func (*Group) List ¶
func (service *Group) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Groups who match the provided criteria
func (*Group) ListAsOptions ¶
func (service *Group) ListAsOptions() []form.LookupCode
func (*Group) ListByGroup ¶
ListByGroup returns all groups that match a provided group name
func (*Group) LoadByID ¶
LoadByID loads a single model.Group object that matches the provided groupID
func (*Group) LoadByToken ¶
LoadByGroupname loads a single Group object that matches the provided token
func (*Group) ObjectDelete ¶
func (*Group) ObjectList ¶
func (*Group) ObjectLoad ¶
func (*Group) ObjectQuery ¶
func (*Group) ObjectSave ¶
func (*Group) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Group) ObjectUserCan ¶
func (*Group) Refresh ¶
func (service *Group) Refresh(collection data.Collection)
Refresh updates any stateful data that is cached inside this service.
type GroupLookupProvider ¶
type GroupLookupProvider struct {
// contains filtered or unexported fields
}
func NewGroupLookupProvider ¶
func NewGroupLookupProvider(groupService *Group) GroupLookupProvider
func (GroupLookupProvider) Add ¶
func (service GroupLookupProvider) Add(name string) (string, error)
func (GroupLookupProvider) Get ¶
func (service GroupLookupProvider) Get() []form.LookupCode
type Inbox ¶
type Inbox struct {
// contains filtered or unexported fields
}
Inbox manages all Inbox records for a User. This includes Inbox and Outbox
func (*Inbox) CalculateRank ¶
CalculateRank generates a unique rank for the message based on the PublishDate and the number of messages that already exist in the database with this PublishDate.
func (*Inbox) Close ¶
func (service *Inbox) Close()
Close stops any background processes controlled by this service
func (*Inbox) CountUnreadMessages ¶ added in v0.6.0
func (service *Inbox) CountUnreadMessages(userID primitive.ObjectID, folderID primitive.ObjectID) (int, error)
CountUnreadMessages counts the number of messages for a user/folder that are marked "unread".
func (*Inbox) DeleteByFolder ¶
func (*Inbox) DeleteByOrigin ¶
func (*Inbox) DeleteMany ¶
func (service *Inbox) DeleteMany(criteria exp.Expression, note string) error
DeleteMany removes all child streams from the provided stream (virtual delete)
func (*Inbox) List ¶
func (service *Inbox) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Activities that match the provided criteria
func (*Inbox) ListByFolder ¶
func (*Inbox) ListByFollowingID ¶
func (*Inbox) LoadByRank ¶
func (*Inbox) LoadByURL ¶
LoadByURL returns the first message that matches the provided UserID and URL
func (*Inbox) LoadOldestUnread ¶ added in v0.6.0
func (*Inbox) LoadSibling ¶ added in v0.6.0
func (service *Inbox) LoadSibling(folderID primitive.ObjectID, rank int64, following string, direction string) (model.Message, error)
LoadSibling searches for the previous/next sibling to the provided message criteria.
func (*Inbox) LoadUnreadByURL ¶ added in v0.6.0
func (service *Inbox) LoadUnreadByURL(userID primitive.ObjectID, url string, result *model.Message) error
LoadUnreadByURL returns the first UNREAD message that matches the provided UserID and URL
func (*Inbox) MarkRead ¶ added in v0.6.0
MarkRead updates a message to "READ" status and recalculates statistics
func (*Inbox) MarkReadByDate ¶ added in v0.6.0
func (*Inbox) MarkUnmuted ¶ added in v0.6.0
func (*Inbox) MarkUnread ¶ added in v0.6.0
MarkRead updates a message to "UNREAD" status and recalculates statistics
func (*Inbox) ObjectDelete ¶
func (*Inbox) ObjectList ¶
func (*Inbox) ObjectLoad ¶
func (*Inbox) ObjectQuery ¶
func (*Inbox) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Inbox) ObjectUserCan ¶
func (*Inbox) Query ¶
func (service *Inbox) Query(criteria exp.Expression, options ...option.Option) ([]model.Message, error)
Query returns a slice containing all of the Activities that match the provided criteria
func (*Inbox) QueryByUserID ¶
func (*Inbox) QueryPurgeable ¶
QueryPurgeable returns a list of Inboxs that are older than the purge date for this following TODO: HIGH: ReadDate is gone. Need another way to purge messages.
func (*Inbox) Refresh ¶
func (service *Inbox) Refresh(collection data.Collection, ruleService *Rule, folderService *Folder, host string)
Refresh updates any stateful data that is cached inside this service.
type JWT ¶
type JWT struct {
// contains filtered or unexported fields
}
JWT is a service that generates and validates JWT keys.
func (*JWT) FindJWTKey ¶
FindJWTKey retrieves a key from the cache or database, and returns it to the caller. This method is a part of the steranko.KeyService interface.
func (*JWT) NewJWTKey ¶
NewJWTKey returns a a new JWT Key to the caller. This method is a part of the steranko.KeyService interface.
func (*JWT) Parse ¶ added in v0.6.0
Parse retrieves a JWT token from the request, and parses it into a JWT token. This method is a part of the steranko.KeyService interface.
func (*JWT) ParseString ¶ added in v0.6.0
type LookupProvider ¶
type LookupProvider struct {
// contains filtered or unexported fields
}
func NewLookupProvider ¶
func (LookupProvider) Group ¶
func (service LookupProvider) Group(path string) form.LookupGroup
type Mention ¶
type Mention struct {
// contains filtered or unexported fields
}
Mention defines a service that can send and receive mention data
func (*Mention) Close ¶
func (service *Mention) Close()
Close stops any background processes controlled by this service
func (*Mention) DiscoverEndpoint ¶
DiscoverEndpoint tries to find the Mention endpoint for the provided URL
func (*Mention) GetPageInfo ¶ added in v0.6.0
func (service *Mention) GetPageInfo(body *bytes.Buffer, originURL string, mention *model.Mention) error
TODO: HIGH: This should use a common service to get URL data from Microformats, OpenGraph, JSON-LD, etc.
func (*Mention) List ¶
func (service *Mention) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Mentions that match the provided criteria
func (*Mention) LoadByOrigin ¶ added in v0.6.0
func (service *Mention) LoadByOrigin(objectType string, objectID primitive.ObjectID, originURL string, result *model.Mention) error
LoadByOrigin loads an existing Mention by its type/objectID/origin URL
func (*Mention) LoadOrCreate ¶ added in v0.6.0
func (service *Mention) LoadOrCreate(objectType string, objectID primitive.ObjectID, originURL string) (model.Mention, error)
LoadOrCreate loads an existing Mention or creates a new one if it doesn't exist
func (*Mention) ObjectDelete ¶
func (*Mention) ObjectList ¶
func (*Mention) ObjectLoad ¶
func (*Mention) ObjectQuery ¶
func (*Mention) ObjectSave ¶
func (*Mention) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Mention) ObjectUserCan ¶
func (*Mention) ParseURL ¶ added in v0.6.0
TODO: LOW: This should just use the Locator service. ParseURL inspects a target URL and determines what kind of object it is and what the token is.
func (*Mention) Query ¶
func (service *Mention) Query(criteria exp.Expression, options ...option.Option) ([]model.Mention, error)
Query returns a slice containing all of the Mentions that match the provided criteria
func (*Mention) QueryByObjectID ¶
func (*Mention) Refresh ¶
func (service *Mention) Refresh(collection data.Collection, ruleService *Rule, activityService *ActivityStream, host string)
Refresh updates any stateful data that is cached inside this service.
type ModelService ¶
type ModelService interface { ObjectType() string ObjectID(data.Object) primitive.ObjectID ObjectNew() data.Object ObjectQuery(any, exp.Expression, ...option.Option) error ObjectList(exp.Expression, ...option.Option) (data.Iterator, error) ObjectLoad(exp.Expression) (data.Object, error) ObjectSave(data.Object, string) error ObjectDelete(data.Object, string) error ObjectUserCan(data.Object, model.Authorization, string) error Schema() schema.Schema }
ModelService interface wraps the generic Object-* functions that standard services provide
type OAuthClient ¶ added in v0.6.0
type OAuthClient struct {
// contains filtered or unexported fields
}
OAuthClient manages all interactions with the OAuthClient collection
func NewOAuthClient ¶ added in v0.6.0
func NewOAuthClient() OAuthClient
NewOAuthClient returns a fully populated OAuthClient service.
func (*OAuthClient) Close ¶ added in v0.6.0
func (service *OAuthClient) Close()
Close stops any background processes controlled by this service
func (*OAuthClient) Delete ¶ added in v0.6.0
func (service *OAuthClient) Delete(app *model.OAuthClient, note string) error
Delete removes an OAuthClient from the database (virtual delete)
func (*OAuthClient) Iterator ¶ added in v0.6.0
func (service *OAuthClient) Iterator(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
Iterator returns an iterator containing all of the OAuthClients that match the provided criteria
func (*OAuthClient) Load ¶ added in v0.6.0
func (service *OAuthClient) Load(criteria exp.Expression, application *model.OAuthClient) error
Load retrieves an OAuthClient from the database
func (*OAuthClient) LoadByClientID ¶ added in v0.6.0
func (service *OAuthClient) LoadByClientID(clientID primitive.ObjectID, client *model.OAuthClient) error
LoadByClientID loads a single application using the "client_id" field (which is just a stringified ObjectID)
func (*OAuthClient) Query ¶ added in v0.6.0
func (service *OAuthClient) Query(criteria exp.Expression, options ...option.Option) ([]model.OAuthClient, error)
Query returns an slice containing all of the OAuthClients that match the provided criteria
func (*OAuthClient) Refresh ¶ added in v0.6.0
func (service *OAuthClient) Refresh(collection data.Collection, oauthUserTokenService *OAuthUserToken, host string)
Refresh updates any stateful data that is cached inside this service.
func (*OAuthClient) Save ¶ added in v0.6.0
func (service *OAuthClient) Save(app *model.OAuthClient, note string) error
Save adds/updates an OAuthClient in the database
func (*OAuthClient) Schema ¶ added in v0.6.0
func (service *OAuthClient) Schema() schema.Schema
func (*OAuthClient) ValidateClientSecret ¶ added in v0.6.0
func (service *OAuthClient) ValidateClientSecret(clientID primitive.ObjectID, clientSecret string) error
type OAuthUserToken ¶ added in v0.6.0
type OAuthUserToken struct {
// contains filtered or unexported fields
}
OAuthUserToken manages all interactions with the OAuthUserToken collection
func NewOAuthUserToken ¶ added in v0.6.0
func NewOAuthUserToken() OAuthUserToken
NewOAuthUserToken returns a fully populated OAuthUserToken service.
func (*OAuthUserToken) Close ¶ added in v0.6.0
func (service *OAuthUserToken) Close()
Close stops any background processes controlled by this service
func (*OAuthUserToken) Create ¶ added in v0.6.0
func (service *OAuthUserToken) Create(client model.OAuthClient, authorization model.Authorization, transaction model.OAuthAuthorizationRequest) (model.OAuthUserToken, error)
Create creates a new OAuthUserToken for the provided application and authorization
func (*OAuthUserToken) CreateFromUser ¶ added in v0.6.0
func (service *OAuthUserToken) CreateFromUser(user *model.User, clientID primitive.ObjectID, scope string) (model.OAuthUserToken, error)
func (*OAuthUserToken) Delete ¶ added in v0.6.0
func (service *OAuthUserToken) Delete(application *model.OAuthUserToken, note string) error
Delete removes an OAuthUserToken from the database (virtual delete)
func (*OAuthUserToken) DeleteByClient ¶ added in v0.6.0
func (service *OAuthUserToken) DeleteByClient(clientID primitive.ObjectID, note string) error
func (*OAuthUserToken) DeleteMany ¶ added in v0.6.0
func (service *OAuthUserToken) DeleteMany(criteria exp.Expression, note string) error
DeleteMany removes all child streams from the provided stream (virtual delete)
func (*OAuthUserToken) Iterator ¶ added in v0.6.0
func (service *OAuthUserToken) Iterator(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
Iterator returns an iterator containing all of the OAuthUserTokens that match the provided criteria
func (*OAuthUserToken) Load ¶ added in v0.6.0
func (service *OAuthUserToken) Load(criteria exp.Expression, application *model.OAuthUserToken) error
Load retrieves an OAuthUserToken from the database
func (*OAuthUserToken) LoadByClientAndCode ¶ added in v0.6.0
func (service *OAuthUserToken) LoadByClientAndCode(userTokenID primitive.ObjectID, clientID primitive.ObjectID, clientSecret string, result *model.OAuthUserToken) error
func (*OAuthUserToken) LoadByClientAndToken ¶ added in v0.6.0
func (service *OAuthUserToken) LoadByClientAndToken(clientID primitive.ObjectID, clientSecret string, token string, result *model.OAuthUserToken) error
func (*OAuthUserToken) LoadByUserAndClient ¶ added in v0.6.0
func (service *OAuthUserToken) LoadByUserAndClient(userID primitive.ObjectID, clientID primitive.ObjectID, result *model.OAuthUserToken) error
func (*OAuthUserToken) Query ¶ added in v0.6.0
func (service *OAuthUserToken) Query(criteria exp.Expression, options ...option.Option) ([]model.OAuthUserToken, error)
Query returns an slice containing all of the OAuthUserTokens that match the provided criteria
func (*OAuthUserToken) Refresh ¶ added in v0.6.0
func (service *OAuthUserToken) Refresh(collection data.Collection, oauthClientService *OAuthClient, jwtService *JWT, host string)
Refresh updates any stateful data that is cached inside this service.
func (*OAuthUserToken) Save ¶ added in v0.6.0
func (service *OAuthUserToken) Save(application *model.OAuthUserToken, note string) error
Save adds/updates an OAuthUserToken in the database
func (*OAuthUserToken) Schema ¶ added in v0.6.0
func (service *OAuthUserToken) Schema() schema.Schema
type Origin ¶
type Origin struct {
// contains filtered or unexported fields
}
Origin service polls external Stream origins for new external Streams.
type Outbox ¶ added in v0.6.0
type Outbox struct {
// contains filtered or unexported fields
}
Outbox manages all Outbox records for a User. This includes Outbox and Outbox
func NewOutbox ¶ added in v0.6.0
func NewOutbox() Outbox
NewOutbox returns a fully populated Outbox service
func (*Outbox) Close ¶ added in v0.6.0
func (service *Outbox) Close()
Close stops any background processes controlled by this service
func (*Outbox) Delete ¶ added in v0.6.0
func (service *Outbox) Delete(outboxMessage *model.OutboxMessage, note string) error
Delete removes an Outbox from the database (virtual delete)
func (*Outbox) DeleteByURL ¶ added in v0.6.0
func (*Outbox) List ¶ added in v0.6.0
func (service *Outbox) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Activities that match the provided criteria
func (*Outbox) Load ¶ added in v0.6.0
func (service *Outbox) Load(criteria exp.Expression, result *model.OutboxMessage) error
Load retrieves an Outbox from the database
func (*Outbox) LoadOrCreate ¶ added in v0.6.0
func (*Outbox) New ¶ added in v0.6.0
func (service *Outbox) New() model.OutboxMessage
New creates a newly initialized Outbox that is ready to use
func (*Outbox) Publish ¶ added in v0.6.0
func (service *Outbox) Publish(actor *outbox.Actor, parentType string, parentID primitive.ObjectID, activity mapof.Any) error
Publish adds an OutboxMessage to the Actor's Outbox and sends notifications to all Followers.
func (*Outbox) Query ¶ added in v0.6.0
func (service *Outbox) Query(criteria exp.Expression, options ...option.Option) ([]model.OutboxMessage, error)
Query returns a slice containing all of the Activities that match the provided criteria
func (*Outbox) QueryByParentID ¶ added in v0.6.0
func (*Outbox) QueryByUserAndDate ¶ added in v0.6.0
func (*Outbox) Refresh ¶ added in v0.6.0
func (service *Outbox) Refresh(collection data.Collection, streamService *Stream, activityService *ActivityStream, followerService *Follower, templateService *Template, userService *User, queue queue.Queue)
Refresh updates any stateful data that is cached inside this service.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider service manages all access to external services
func NewProvider ¶
NewProvider returns a fully initialized Provider service
func (*Provider) GetGiphyProvider ¶
func (*Provider) GetProvider ¶
GetProvider returns a populated adapter for the given provider
type RSS ¶
type RSS struct {
// contains filtered or unexported fields
}
RSS service generates RSS feeds of the available streams in the database
type Response ¶ added in v0.6.0
type Response struct {
// contains filtered or unexported fields
}
Response defines a service that can send and receive response data
func NewResponse ¶ added in v0.6.0
func NewResponse() Response
NewResponse returns a fully initialized Response service
func (*Response) Close ¶ added in v0.6.0
func (service *Response) Close()
Close stops any background processes controlled by this service
func (*Response) CountByContent ¶ added in v0.6.0
func (*Response) Delete ¶ added in v0.6.0
Delete removes an Response from the database (hard delete)
func (*Response) List ¶ added in v0.6.0
func (service *Response) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Responses that match the provided criteria
func (*Response) LoadByActorAndObject ¶ added in v0.6.0
func (*Response) LoadByUserAndObject ¶ added in v0.6.0
func (*Response) ObjectDelete ¶ added in v0.6.0
func (*Response) ObjectList ¶ added in v0.6.0
func (*Response) ObjectLoad ¶ added in v0.6.0
func (*Response) ObjectNew ¶ added in v0.6.0
New returns a fully initialized model.Response as a data.Object.
func (*Response) ObjectQuery ¶ added in v0.6.0
func (*Response) ObjectSave ¶ added in v0.6.0
func (*Response) ObjectType ¶ added in v0.6.0
ObjectType returns the type of object that this service manages
func (*Response) ObjectUserCan ¶ added in v0.6.0
func (*Response) Query ¶ added in v0.6.0
func (service *Response) Query(criteria exp.Expression, options ...option.Option) ([]model.Response, error)
Query returns a slice containing all of the Responses that match the provided criteria
func (*Response) QueryByObjectAndDate ¶ added in v0.6.0
func (*Response) QueryByUserAndDate ¶ added in v0.6.0
func (*Response) QueryByUserAndObject ¶ added in v0.6.0
func (*Response) Refresh ¶ added in v0.6.0
func (service *Response) Refresh(collection data.Collection, userService *User, outboxService *Outbox, host string)
Refresh updates any stateful data that is cached inside this service.
func (*Response) SetResponse ¶ added in v0.6.0
func (service *Response) SetResponse(user *model.User, url string, responseType string, content string) error
SetResponse is the preferred way of creating/updating a Response. It includes the business logic to search for an existing response, and delete it if one exists already (publishing UNDO actions in the process).
type Rule ¶ added in v0.6.0
type Rule struct {
// contains filtered or unexported fields
}
Rule defines a service that manages all content rules created and imported by Users.
func (*Rule) ActivityPubActorURL ¶ added in v0.6.0
func (*Rule) ActivityPubURL ¶ added in v0.6.0
func (*Rule) Channel ¶ added in v0.6.0
func (service *Rule) Channel(criteria exp.Expression, options ...option.Option) (<-chan model.Rule, error)
Channel returns a channel that will stream all of the Rules that match the provided criteria
func (*Rule) Close ¶ added in v0.6.0
func (service *Rule) Close()
Close stops any background processes controlled by this service
func (*Rule) Filter ¶ added in v0.6.0
func (service *Rule) Filter(userID primitive.ObjectID, options ...RuleFilterOption) RuleFilter
func (*Rule) JSONLDGetter ¶ added in v0.6.0
func (service *Rule) JSONLDGetter(rule model.Rule) RuleJSONLDGetter
JSONLDGetter returns a new JSONLDGetter for the provided stream
func (*Rule) List ¶ added in v0.6.0
List returns an iterator containing all of the Rules that match the provided criteria
func (*Rule) LoadByFollowing ¶ added in v0.6.0
func (service *Rule) LoadByFollowing(userID primitive.ObjectID, followingID primitive.ObjectID, ruleType string, trigger string, rule *model.Rule) error
LoadByFollowing retrieves a single Rule that maches the provided User, Following, RuleType, and Trigger
func (*Rule) LoadByToken ¶ added in v0.6.0
func (*Rule) LoadByTrigger ¶ added in v0.6.0
func (service *Rule) LoadByTrigger(userID primitive.ObjectID, ruleType string, trigger string, rule *model.Rule) error
LoadByTrigger retrieves a single Rule that maches the provided User, RuleType, and Trigger
func (*Rule) ObjectDelete ¶ added in v0.6.0
func (*Rule) ObjectList ¶ added in v0.6.0
func (*Rule) ObjectLoad ¶ added in v0.6.0
func (*Rule) ObjectNew ¶ added in v0.6.0
New returns a fully initialized model.Group as a data.Object.
func (*Rule) ObjectQuery ¶ added in v0.6.0
func (*Rule) ObjectSave ¶ added in v0.6.0
func (*Rule) ObjectType ¶ added in v0.6.0
ObjectType returns the type of object that this service manages
func (*Rule) ObjectUserCan ¶ added in v0.6.0
func (*Rule) Query ¶ added in v0.6.0
Query returns an slice of allthe Rules that match the provided criteria
func (*Rule) QueryBlockedActors ¶ added in v0.6.0
QueryBlockedActors returns all Actors blocked by this User (or by the Domain on behalf of the User)
func (*Rule) QueryByActor ¶ added in v0.6.0
func (service *Rule) QueryByActor(userID primitive.ObjectID, actorID string) ([]model.RuleSummary, error)
QueryByActor retrieves a slice of RuleSummaries that match the provided User and Actor
func (*Rule) QueryByActorAndActions ¶ added in v0.6.0
func (service *Rule) QueryByActorAndActions(userID primitive.ObjectID, actorID string, actions ...string) ([]model.RuleSummary, error)
QueryByActorAndActions retrieves a slice of RuleSummaries that match the provided User, Actor, and potential actions
func (*Rule) QueryByType ¶ added in v0.6.0
func (*Rule) QueryByTypeActor ¶ added in v0.6.0
func (*Rule) QueryByTypeContent ¶ added in v0.6.0
func (*Rule) QueryByTypeDomain ¶ added in v0.6.0
func (*Rule) QueryDomainBlocks ¶ added in v0.6.0
QueryDomainBlocks returns all external domains blocked by this Instance/Domain.
func (*Rule) QueryPublic ¶ added in v0.6.0
func (service *Rule) QueryPublic(userID primitive.ObjectID, maxDate int64, options ...option.Option) ([]model.Rule, error)
QueryPublic returns a collection of Rules that are marked Public, in reverse chronological order.
func (*Rule) QuerySummary ¶ added in v0.6.0
func (service *Rule) QuerySummary(criteria exp.Expression, options ...option.Option) ([]model.RuleSummary, error)
QuerySummary returns an slice of allthe Rules that match the provided criteria
func (*Rule) Refresh ¶ added in v0.6.0
func (service *Rule) Refresh(collection data.Collection, outboxService *Outbox, userService *User, queue queue.Queue, host string)
Refresh updates any stateful data that is cached inside this service.
type RuleFilter ¶ added in v0.6.0
type RuleFilter struct {
// contains filtered or unexported fields
}
RuleFilter is a temporary object that filters ActivityStream documents based on the User- and Domain-Rules that are active for a given UserID. Each RuleFilter can be used as many times as needed for a single User and HTTP Request. RuleFilters are not thread-safe, and should not be shared between goroutines.
func NewRuleFilter ¶ added in v0.6.0
func NewRuleFilter(ruleService *Rule, userID primitive.ObjectID, options ...RuleFilterOption) RuleFilter
NewRuleFilter returns a fully initialized RuleFilter that is keyed to a specific User.
func (*RuleFilter) Allow ¶ added in v0.6.0
func (filter *RuleFilter) Allow(document *streams.Document) bool
Allow returns TRUE if this document is allowed past all User and Domain filters. The document is passed as a pointer because it MAY BE MODIFIED by the filter, for instance, to add a label or other metadata.
func (*RuleFilter) AllowSend ¶ added in v0.6.0
func (filter *RuleFilter) AllowSend(actorID string) bool
AllowSend returns TRUE if this actorID is allowed to receive messages.
func (*RuleFilter) Channel ¶ added in v0.6.0
func (filter *RuleFilter) Channel(ch <-chan streams.Document) <-chan streams.Document
Channel returns a channel of all documents that are allowed by User/Domain filters. Documents may be modified by filters in the process, for instance, to add content warning labels.
func (*RuleFilter) ChannelSend ¶ added in v0.6.0
func (filter *RuleFilter) ChannelSend(ch <-chan model.Follower) <-chan string
ChannelSend inspects the channel of recipients to see if they should receive messages or not.
func (*RuleFilter) Disallow ¶ added in v0.6.0
func (filter *RuleFilter) Disallow(document *streams.Document) bool
Disallow returns TRUE if a document is NOT allowed past all User and Domain filters.
func (*RuleFilter) Slice ¶ added in v0.6.0
func (filter *RuleFilter) Slice(documents []streams.Document) []streams.Document
Slice returns a slice of all documents from the input that are allowed by User/Domain filters. Documents may be modified by filters in the process, for instance, to add content warning labels.
type RuleFilterOption ¶ added in v0.6.0
type RuleFilterOption func(*RuleFilter)
RuleFilterOption defines a functional option that modifies the behavior of a RuleFilter object
func IgnoreBlocks ¶ added in v0.6.0
func IgnoreBlocks() RuleFilterOption
IgnoreBlocks returns a RuleFilterOption that prevents `Block` -type rules from being executed
func IgnoreLabels ¶ added in v0.6.0
func IgnoreLabels() RuleFilterOption
IgnoreLabels returns a RuleFilterOption that prevents `Label` -type rules from being executed
func IgnoreMutes ¶ added in v0.6.0
func IgnoreMutes() RuleFilterOption
IgnoreMutes returns a RuleFilterOption that prevents `Mute` -type rules from being executed
func WithBlocksOnly ¶ added in v0.6.0
func WithBlocksOnly() RuleFilterOption
WithLabelsOnly returns a RuleFilterOption that allows ONLY `Block` -type rules, and ignores all others.
func WithLabelsOnly ¶ added in v0.6.0
func WithLabelsOnly() RuleFilterOption
WithLabelsOnly returns a RuleFilterOption that allows ONLY `Label` -type rules, and ignores all others.
func WithMutesOnly ¶ added in v0.6.0
func WithMutesOnly() RuleFilterOption
WithLabelsOnly returns a RuleFilterOption that allows ONLY `Mute` -type rules, and ignores all others.
type RuleJSONLDGetter ¶ added in v0.6.0
type RuleJSONLDGetter struct {
// contains filtered or unexported fields
}
RuleJSONLDGetter wraps the Rule service and a model.Rule to provide a JSONLDGetter interface
func NewRuleJSONLDGetter ¶ added in v0.6.0
func NewRuleJSONLDGetter(service *Rule, rule model.Rule) RuleJSONLDGetter
NewRuleJSONLDGetter returns a fully initialized RuleJSONLDGetter
func (RuleJSONLDGetter) Created ¶ added in v0.6.0
func (getter RuleJSONLDGetter) Created() int64
Created returns the creation date of the wrapped Rule
func (RuleJSONLDGetter) GetJSONLD ¶ added in v0.6.0
func (getter RuleJSONLDGetter) GetJSONLD() mapof.Any
GetJSONLD returns a JSON-LD representation of the wrapped Rule
type ServerEmail ¶
type ServerEmail struct {
// contains filtered or unexported fields
}
func NewServerEmail ¶
func NewServerEmail(filesystemService Filesystem, funcMap template.FuncMap, locations []mapof.String) ServerEmail
type SterankoUserService ¶
type SterankoUserService struct {
// contains filtered or unexported fields
}
SterankoUserService is a wrapper/adapter that makes the User service compatable with Steranko.
func NewSterankoUserService ¶
func NewSterankoUserService(userService *User, domainEmail *DomainEmail) SterankoUserService
NewSterankoUserService returns a fully populated SterankoUserService.
func (SterankoUserService) Close ¶
func (service SterankoUserService) Close()
Close is required to implement the steranko.UserService interface
func (SterankoUserService) Delete ¶
func (service SterankoUserService) Delete(user steranko.User, comment string) error
Delete removes a single User from the database
func (SterankoUserService) Load ¶
func (service SterankoUserService) Load(username string, result steranko.User) error
Load retrieves a single User from the database
func (SterankoUserService) New ¶
func (service SterankoUserService) New() steranko.User
New creates a newly initialized User that is ready to use
func (SterankoUserService) NewClaims ¶
func (service SterankoUserService) NewClaims() jwt.Claims
NewClaims creates a new JWT claim object
func (SterankoUserService) RequestPasswordReset ¶
func (service SterankoUserService) RequestPasswordReset(user steranko.User) error
RequestPasswordReset is not currently implemented in this service. (TODO)
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream manages all interactions with the Stream collection
func (*Stream) ActivityPubActor ¶ added in v0.6.0
func (service *Stream) ActivityPubActor(streamID primitive.ObjectID, withFollowers bool) (outbox.Actor, error)
ActivityPubActor returns an ActivityPub Actor object ** WHICH INCLUDES ENCRYPTION KEYS ** for the provided Stream.
func (*Stream) ActivityPubURL ¶ added in v0.6.0
func (*Stream) CalcContext ¶ added in v0.6.0
CalcContext calculates the conversational context for a given stream, IF it can be determined.
func (*Stream) CalcParentIDs ¶ added in v0.6.0
CalcParentIDs scans the parent chain of a stream and generates a "breadcrumbs" slice of all of this Stream's parents
func (*Stream) Close ¶
func (service *Stream) Close()
Close stops any background processes controlled by this service
func (*Stream) Count ¶
func (service *Stream) Count(criteria exp.Expression) (int64, error)
Count returns the number of (non-deleted) records in the Stream collection
func (*Stream) DeleteByParent ¶
func (*Stream) DeleteMany ¶
func (service *Stream) DeleteMany(criteria exp.Expression, note string) error
DeleteMany removes all child streams from the provided stream (virtual delete)
func (*Stream) DeleteRelatedDuplicate ¶
func (service *Stream) DeleteRelatedDuplicate(parentID primitive.ObjectID, originalStreamID primitive.ObjectID) error
Delete RelatedDuplicate hard deletes any inbox/outbox streams that point to the same original.
func (*Stream) JSONLD ¶ added in v0.6.0
GetJSONLD returns a map document that conforms to the ActivityStreams 2.0 spec. This map will still need to be marshalled into JSON
func (*Stream) JSONLDGetter ¶ added in v0.6.0
func (service *Stream) JSONLDGetter(stream *model.Stream) StreamJSONLDGetter
JSONLDGetter returns a new JSONLDGetter for the provided stream
func (*Stream) List ¶
func (service *Stream) List(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
List returns an iterator containing all of the Streams that match the provided criteria
func (*Stream) ListByParent ¶
ListByParent returns all Streams that match a particular parentID
func (*Stream) ListByTemplate ¶
ListByTemplate returns all `Streams` that use a particular `Template`
func (*Stream) ListNavigation ¶
ListNavigation returns all Streams of type FOLDER at the top of the hierarchy
func (*Stream) LoadByToken ¶
LoadByToken returns a single `Stream` that matches a particular `Token`
func (*Stream) LoadFirstAttachment ¶
func (*Stream) LoadFirstSibling ¶
func (*Stream) LoadLastSibling ¶
func (*Stream) LoadNavigationByID ¶
LoadNavigationByID locates a single stream in the top level of the site hierarchy
func (*Stream) LoadNextSibling ¶
func (*Stream) LoadParent ¶
LoadParent returns the Stream that is the parent of the provided Stream
func (*Stream) LoadPrevSibling ¶
func (*Stream) LoadWebFinger ¶
func (*Stream) LoadWithOptions ¶
func (*Stream) ObjectDelete ¶
func (*Stream) ObjectList ¶
func (*Stream) ObjectLoad ¶
func (*Stream) ObjectQuery ¶
func (*Stream) ObjectSave ¶
func (*Stream) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*Stream) ObjectUserCan ¶
func (*Stream) ParsePath ¶ added in v0.6.0
ParsePathextracts the Stream token and actionID from a URL
func (*Stream) ParseURL ¶ added in v0.6.0
ParseURL validates that a URL matches the current server, and then extracts the streamID from it.
func (*Stream) PurgeDeleted ¶
PurgeDeleted hard deletes all items with the given ancestor that have already been soft-deleted
func (*Stream) Query ¶
func (service *Stream) Query(criteria exp.Expression, options ...option.Option) ([]model.Stream, error)
Query returns an slice containing all of the Streams that match the provided criteria
func (*Stream) QueryByAncestorAndDate ¶ added in v0.6.0
func (service *Stream) QueryByAncestorAndDate(streamID primitive.ObjectID, publishedDate int64, pageSize int) ([]model.Stream, error)
QueryByParentAndDate returns a slice of Streams that are ANY DEPTH below the provided StreamID
func (*Stream) QueryByParentAndDate ¶ added in v0.6.0
func (service *Stream) QueryByParentAndDate(streamID primitive.ObjectID, publishedDate int64, pageSize int) ([]model.Stream, error)
QueryByParentAndDate returns a slice of Streams that are DIRECT CHILDREN of the provided StreamID
func (*Stream) QueryByUser ¶ added in v0.6.0
func (*Stream) QuerySummary ¶
func (service *Stream) QuerySummary(criteria exp.Expression, options ...option.Option) ([]model.StreamSummary, error)
QuerySummary returns an slice containing StreamSummaries for all of the Streams that match the provided criteria
func (*Stream) Refresh ¶
func (service *Stream) Refresh(collection data.Collection, templateService *Template, draftService *StreamDraft, outboxService *Outbox, attachmentService *Attachment, activityService *ActivityStream, contentService *Content, keyService *EncryptionKey, followerService *Follower, ruleService *Rule, userService *User, host string, streamUpdateChannel chan model.Stream)
Refresh updates any stateful data that is cached inside this service.
func (*Stream) RestoreDeleted ¶
RestoreDeleted un-deletes all soft-deleted records underneath a common ancestor.
func (*Stream) SetLocationChild ¶ added in v0.6.0
func (service *Stream) SetLocationChild(template *model.Template, stream *model.Stream, parent *model.Stream) error
SetLocationChild sets a Stream to be a child of another Stream
func (*Stream) SetLocationOutbox ¶ added in v0.6.0
func (service *Stream) SetLocationOutbox(template *model.Template, stream *model.Stream, userID primitive.ObjectID) error
SetLocationInbox sets a Stream's location to be a User's outbox
func (*Stream) SetLocationTop ¶ added in v0.6.0
SetLocationTop sets a Stream to be a top-level navigation item
type StreamDraft ¶
type StreamDraft struct {
// contains filtered or unexported fields
}
StreamDraft manages all interactions with the StreamDraft collection
func NewStreamDraft ¶
func NewStreamDraft() StreamDraft
NewStreamDraft returns a fully populated StreamDraft service.
func (*StreamDraft) Close ¶
func (service *StreamDraft) Close()
Close stops any background processes controlled by this service
func (*StreamDraft) Delete ¶
func (service *StreamDraft) Delete(draft *model.Stream, _note string) error
Delete removes an StreamDraft from the database (hard delete)
func (*StreamDraft) Load ¶
func (service *StreamDraft) Load(criteria exp.Expression, result *model.Stream) error
Load either: 1) loads a valid draft from the database, or 2) creates a new draft and returns it instead
func (*StreamDraft) New ¶
func (service *StreamDraft) New() model.Stream
New creates a newly initialized StreamDraft that is ready to use
func (*StreamDraft) ObjectDelete ¶
func (service *StreamDraft) ObjectDelete(object data.Object, comment string) error
func (*StreamDraft) ObjectID ¶
func (service *StreamDraft) ObjectID(object data.Object) primitive.ObjectID
func (*StreamDraft) ObjectList ¶
func (service *StreamDraft) ObjectList(criteria exp.Expression, options ...option.Option) (data.Iterator, error)
func (*StreamDraft) ObjectLoad ¶
func (service *StreamDraft) ObjectLoad(criteria exp.Expression) (data.Object, error)
func (*StreamDraft) ObjectNew ¶
func (service *StreamDraft) ObjectNew() data.Object
New returns a fully initialized model.Stream as a data.Object.
func (*StreamDraft) ObjectQuery ¶
func (service *StreamDraft) ObjectQuery(result any, criteria exp.Expression, options ...option.Option) error
func (*StreamDraft) ObjectSave ¶
func (service *StreamDraft) ObjectSave(object data.Object, comment string) error
func (*StreamDraft) ObjectType ¶
func (service *StreamDraft) ObjectType() string
ObjectType returns the type of object that this service manages
func (*StreamDraft) ObjectUserCan ¶
func (service *StreamDraft) ObjectUserCan(object data.Object, authorization model.Authorization, action string) error
func (*StreamDraft) Refresh ¶
func (service *StreamDraft) Refresh(collection data.Collection, streamService *Stream)
Refresh updates any stateful data that is cached inside this service.
func (*StreamDraft) Save ¶
func (service *StreamDraft) Save(draft *model.Stream, note string) error
save adds/updates an StreamDraft in the database
func (*StreamDraft) Schema ¶
func (service *StreamDraft) Schema() schema.Schema
type StreamJSONLDGetter ¶ added in v0.6.0
type StreamJSONLDGetter struct {
// contains filtered or unexported fields
}
StreamJSONLDGetter wraps the Stream service and a model.Stream to provide a JSONLDGetter interface
func NewStreamJSONLDGetter ¶ added in v0.6.0
func NewStreamJSONLDGetter(streamService *Stream, stream *model.Stream) StreamJSONLDGetter
NewStreamJSONLDGetter returns a fully initialized StreamJSONLDGetter
func (StreamJSONLDGetter) Created ¶ added in v0.6.0
func (getter StreamJSONLDGetter) Created() int64
Created returns the creation date of the wrapped Stream
func (StreamJSONLDGetter) GetJSONLD ¶ added in v0.6.0
func (getter StreamJSONLDGetter) GetJSONLD() mapof.Any
GetJSONLD returns a JSON-LD representation of the wrapped Stream
type TaskCreateWebSubFollower ¶ added in v0.6.0
type TaskCreateWebSubFollower struct {
// contains filtered or unexported fields
}
func NewTaskCreateWebSubFollower ¶ added in v0.6.0
func (TaskCreateWebSubFollower) Run ¶ added in v0.6.0
func (task TaskCreateWebSubFollower) Run() error
type TaskReceiveWebMention ¶ added in v0.6.0
type TaskReceiveWebMention struct {
// contains filtered or unexported fields
}
func NewTaskReceiveWebMention ¶ added in v0.6.0
func (TaskReceiveWebMention) Run ¶ added in v0.6.0
func (task TaskReceiveWebMention) Run() error
type TaskSendWebMention ¶ added in v0.6.0
type TaskSendWebMention struct {
// contains filtered or unexported fields
}
func NewTaskSendWebMention ¶ added in v0.6.0
func NewTaskSendWebMention(source string, target string) TaskSendWebMention
func (TaskSendWebMention) Run ¶ added in v0.6.0
func (task TaskSendWebMention) Run() error
type TaskSendWebSubMessage ¶ added in v0.6.0
type TaskSendWebSubMessage struct {
// contains filtered or unexported fields
}
TaskSendWebSubMessage sends a WebSub notification to a single WebSub follower.
func NewTaskSendWebSubMessage ¶ added in v0.6.0
func NewTaskSendWebSubMessage(follower model.Follower) TaskSendWebSubMessage
func (TaskSendWebSubMessage) Run ¶ added in v0.6.0
func (task TaskSendWebSubMessage) Run() error
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template service manages all of the templates in the system, and merges them with data to form fully populated HTML pages.
func NewTemplate ¶
func NewTemplate(filesystemService Filesystem, themeService *Theme, widgetService *Widget, funcMap template.FuncMap, locations []mapof.String) *Template
NewTemplate returns a fully initialized Template service.
func (*Template) ListByContainer ¶
func (service *Template) ListByContainer(containedByRole string) []form.LookupCode
ListByContainer returns all model.Templates that match the provided "containedByRole" value
func (*Template) ListByContainerLimited ¶
func (service *Template) ListByContainerLimited(containedByRole string, limitRoles sliceof.String) []form.LookupCode
ListByContainerLimited returns all model.Templates that match the provided "containedByRole" value AND whose TemplateRoles are present in the "limitRoles" list. If the "limited" list is empty, then all otherwise-valid templates are returned.
type Theme ¶
type Theme struct {
// contains filtered or unexported fields
}
Theme service manages the global site theme that is stored in a particular path of the filesystem.
func (*Theme) ListActive ¶ added in v0.6.0
func (*Theme) ListSorted ¶ added in v0.6.0
type ThemeLookupProvider ¶
type ThemeLookupProvider struct {
// contains filtered or unexported fields
}
func NewThemeLookupProvider ¶
func NewThemeLookupProvider(themeService *Theme) ThemeLookupProvider
func (ThemeLookupProvider) Get ¶
func (service ThemeLookupProvider) Get() []form.LookupCode
type User ¶
type User struct {
// contains filtered or unexported fields
}
User manages all interactions with the User collection
func (*User) ActivityPubActor ¶
func (service *User) ActivityPubActor(userID primitive.ObjectID, withFollowers bool) (outbox.Actor, error)
ActivityPubActor returns an ActivityPub Actor object ** WHICH INCLUDES ENCRYPTION KEYS ** for the provided User.
func (*User) ActivityPubPublicKeyURL ¶
func (*User) CalcFollowerCount ¶
func (*User) CalcFollowingCount ¶
func (*User) CalcRuleCount ¶ added in v0.6.0
func (*User) Close ¶
func (service *User) Close()
Close stops any background processes controlled by this service
func (*User) DeleteAvatar ¶ added in v0.6.0
func (*User) List ¶
List returns an iterator containing all of the Users who match the provided criteria
func (*User) ListByGroup ¶
ListByGroup returns all users that match a provided group name
func (*User) ListByIdentities ¶
ListByIdentities returns all users that appear in the list of identities
func (*User) ListOwnersAsSlice ¶
func (service *User) ListOwnersAsSlice() []model.UserSummary
func (*User) ListUsernameOrOwner ¶ added in v0.6.0
func (*User) LoadByProfileURL ¶ added in v0.6.0
func (*User) LoadByResetCode ¶
func (*User) LoadByToken ¶
LoadByUsername loads a single model.User object that matches the provided token
func (*User) LoadByUsername ¶
LoadByUsername loads a single model.User object that matches the provided username
func (*User) LoadByUsernameOrEmail ¶
LoadByUsernameOrEmail loads a single model.User object that matches the provided username
func (*User) LoadWebFinger ¶
func (*User) MakeNewPasswordResetCode ¶
MakeNewPasswordResetCode generates a new password reset code for the provided user.
func (*User) ObjectDelete ¶
func (*User) ObjectList ¶
func (*User) ObjectLoad ¶
func (*User) ObjectQuery ¶
func (*User) ObjectType ¶
ObjectType returns the type of object that this service manages
func (*User) ObjectUserCan ¶
func (*User) ParseProfileURL ¶
ParseProfileURL parses (or looks up) the correct UserID from a given URL. Unlike the package-level ParseProfileURL, this method can resolve usernames into objectIDs because it has access to the database server.
func (*User) Query ¶ added in v0.6.0
Query returns an slice containing all of the Users who match the provided criteria
func (*User) QueryBlockedActors ¶ added in v0.6.0
func (service *User) QueryBlockedActors(userID primitive.ObjectID, criteria exp.Expression) ([]model.User, error)
TODO: MEDIUM: this function is wickedly inefficient Should probably use a RuleFilter here.
func (*User) Refresh ¶
func (service *User) Refresh(userCollection data.Collection, followerCollection data.Collection, followingCollection data.Collection, ruleCollection data.Collection, attachmentService *Attachment, ruleService *Rule, emailService *DomainEmail, keyService *EncryptionKey, folderService *Folder, followerService *Follower, streamService *Stream, host string)
Refresh updates any stateful data that is cached inside this service.
func (*User) RemoteFollowURL ¶
func (*User) SendPasswordResetEmail ¶
SendPasswordResetEmail generates a new password reset code and sends a welcome email to a new user. If there is a problem sending the email, then the new code is not saved.
func (*User) SendWelcomeEmail ¶
SendWelcomeEmail generates a new password reset code and sends a welcome email to a new user. If there is a problem sending the email, then the new code is not saved.
type Widget ¶
type Widget struct {
// contains filtered or unexported fields
}
Widget service manages the global, in-memory library of widget templates that can be applied to any Stream
func (*Widget) Add ¶
Add loads a widget definition from a filesystem, and adds it to the in-memory library.
func (*Widget) IsValidWidgetType ¶
func (*Widget) List ¶
func (service *Widget) List() []form.LookupCode
Source Files ¶
- activityStreams.go
- attachment.go
- bundle.go
- config.go
- content.go
- domain.go
- domainEmail.go
- encryptionKey.go
- filesystem.go
- folder.go
- folderLookupProvider.go
- follower.go
- following_.go
- following_activityPub.go
- following_connect.go
- following_disconnect.go
- following_threads.go
- following_webSub.go
- group.go
- groupLookupProvider.go
- icons.go
- inbox.go
- interfaces.go
- jwt.go
- locator.go
- lookupProvider.go
- mention.go
- modelService.go
- oauthClient.go
- oauthUserToken.go
- origin.go
- outbox.go
- outbox_publish.go
- provider.go
- response.go
- rss.go
- rule.go
- ruleFilter.go
- ruleFilterOption.go
- ruleFilter_send.go
- ruleJSONLDGetter.go
- rule_activitypub.go
- rule_publish.go
- scheduler.go
- serverEmail.go
- service.go
- steranko.go
- stream.go
- streamDraft.go
- streamJSONLDGetter.go
- streamWatcher.go
- stream_activitypub.go
- stream_mastodon.go
- stream_publish.go
- stream_webfinger.go
- task_createWebSubFollower.go
- task_receiveWebMention.go
- task_sendWebSubMessage.go
- task_sendWebmention.go
- template.go
- theme.go
- theme_lookupProvider.go
- user.go
- user_activitypub.go
- utilities.go
- widget.go