Documentation ¶
Index ¶
- func Marshal(v vocab.Type) (b []byte, err error)
- func MustChangeOneRow(r sql.Result) error
- func MustQueryOneRow(r *sql.Rows, fn func(r SingleRow) error) error
- func QueryRows(r *sql.Rows, fn func(r SingleRow) error) error
- type ActivityStreams
- type ActivityStreamsApplication
- type ActivityStreamsCollection
- type ActivityStreamsCollectionPage
- type ActivityStreamsFollow
- type ActivityStreamsOrderedCollection
- type ActivityStreamsOrderedCollectionPage
- type ActivityStreamsPerson
- type BinaryMatcher
- type ClientInfo
- type ClientInfos
- func (c *ClientInfos) Close()
- func (c *ClientInfos) Create(ctx util.Context, tx *sql.Tx, info oauth2.ClientInfo) (id string, err error)
- func (c *ClientInfos) CreateTable(t *sql.Tx, s SqlDialect) error
- func (c *ClientInfos) GetByID(ctx util.Context, tx *sql.Tx, id string) (oauth2.ClientInfo, error)
- func (c *ClientInfos) Prepare(db *sql.DB, s SqlDialect) error
- type CreatePolicy
- type CreateResolution
- type CreateUser
- type Credentials
- func (c *Credentials) Close()
- func (c *Credentials) Create(ctx util.Context, tx *sql.Tx, userID, tokenID string, expires time.Time) (id string, err error)
- func (c *Credentials) CreateTable(tx *sql.Tx, s SqlDialect) error
- func (c *Credentials) Delete(ctx util.Context, tx *sql.Tx, id string) error
- func (c *Credentials) DeleteExpired(ctx util.Context, tx *sql.Tx) error
- func (c *Credentials) GetTokenInfo(ctx util.Context, tx *sql.Tx, id string) (oauth2.TokenInfo, error)
- func (c *Credentials) Prepare(db *sql.DB, s SqlDialect) error
- func (c *Credentials) Update(ctx util.Context, tx *sql.Tx, id string, info oauth2.TokenInfo) error
- func (c *Credentials) UpdateExpires(ctx util.Context, tx *sql.Tx, id string, expires time.Time) error
- type DeliveryAttempts
- func (d *DeliveryAttempts) Close()
- func (d *DeliveryAttempts) Create(c util.Context, tx *sql.Tx, from string, toActor *url.URL, payload []byte) (id string, err error)
- func (d *DeliveryAttempts) CreateTable(t *sql.Tx, s SqlDialect) error
- func (d *DeliveryAttempts) FirstPageFailures(c util.Context, tx *sql.Tx, fetchTime time.Time, n int) (rf []RetryableFailure, err error)
- func (d *DeliveryAttempts) MarkAbandoned(c util.Context, tx *sql.Tx, id string) error
- func (d *DeliveryAttempts) MarkFailed(c util.Context, tx *sql.Tx, id string) error
- func (d *DeliveryAttempts) MarkSuccessful(c util.Context, tx *sql.Tx, id string) error
- func (d *DeliveryAttempts) NextPageFailures(c util.Context, tx *sql.Tx, prevID string, fetchTime time.Time, n int) (rf []RetryableFailure, err error)
- func (d *DeliveryAttempts) Prepare(db *sql.DB, s SqlDialect) error
- type FedData
- func (f *FedData) Close()
- func (f *FedData) Create(c util.Context, tx *sql.Tx, v ActivityStreams) error
- func (f *FedData) CreateTable(t *sql.Tx, s SqlDialect) error
- func (f *FedData) Delete(c util.Context, tx *sql.Tx, fedIDIRI *url.URL) error
- func (f *FedData) Exists(c util.Context, tx *sql.Tx, id *url.URL) (exists bool, err error)
- func (f *FedData) Get(c util.Context, tx *sql.Tx, id *url.URL) (v ActivityStreams, err error)
- func (f *FedData) Prepare(db *sql.DB, s SqlDialect) error
- func (f *FedData) Update(c util.Context, tx *sql.Tx, fedIDIRI *url.URL, v ActivityStreams) error
- type Followers
- func (i *Followers) Close()
- func (i *Followers) Contains(c util.Context, tx *sql.Tx, followers, item *url.URL) (b bool, err error)
- func (i *Followers) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
- func (i *Followers) Create(c util.Context, tx *sql.Tx, actor *url.URL, ...) error
- func (i *Followers) CreateTable(t *sql.Tx, s SqlDialect) error
- func (i *Followers) DeleteItem(c util.Context, tx *sql.Tx, followers, item *url.URL) error
- func (i *Followers) GetAllForActor(c util.Context, tx *sql.Tx, followers *url.URL) (col ActivityStreamsCollection, err error)
- func (i *Followers) GetLastPage(c util.Context, tx *sql.Tx, followers *url.URL, n int) (page ActivityStreamsCollectionPage, startIdx int, err error)
- func (i *Followers) GetPage(c util.Context, tx *sql.Tx, followers *url.URL, min, max int) (page ActivityStreamsCollectionPage, isEnd bool, err error)
- func (i *Followers) OpenFollowRequests(c util.Context, tx *sql.Tx, actorIRI *url.URL) (f []ActivityStreamsFollow, err error)
- func (i *Followers) Prepare(db *sql.DB, s SqlDialect) error
- func (i *Followers) PrependItem(c util.Context, tx *sql.Tx, followers, item *url.URL) error
- type Following
- func (i *Following) Close()
- func (i *Following) Contains(c util.Context, tx *sql.Tx, following, item *url.URL) (b bool, err error)
- func (i *Following) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
- func (i *Following) Create(c util.Context, tx *sql.Tx, actor *url.URL, ...) error
- func (i *Following) CreateTable(t *sql.Tx, s SqlDialect) error
- func (i *Following) DeleteItem(c util.Context, tx *sql.Tx, following, item *url.URL) error
- func (i *Following) GetAllForActor(c util.Context, tx *sql.Tx, following *url.URL) (col ActivityStreamsCollection, err error)
- func (i *Following) GetLastPage(c util.Context, tx *sql.Tx, following *url.URL, n int) (page ActivityStreamsCollectionPage, startIdx int, err error)
- func (i *Following) GetPage(c util.Context, tx *sql.Tx, following *url.URL, min, max int) (page ActivityStreamsCollectionPage, isEnd bool, err error)
- func (i *Following) Prepare(db *sql.DB, s SqlDialect) error
- func (i *Following) PrependItem(c util.Context, tx *sql.Tx, following, item *url.URL) error
- type Inboxes
- func (i *Inboxes) Close()
- func (i *Inboxes) Contains(c util.Context, tx *sql.Tx, inbox, item *url.URL) (b bool, err error)
- func (i *Inboxes) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
- func (i *Inboxes) Create(c util.Context, tx *sql.Tx, actor *url.URL, ...) error
- func (i *Inboxes) CreateTable(t *sql.Tx, s SqlDialect) error
- func (i *Inboxes) DeleteInboxItem(c util.Context, tx *sql.Tx, inbox, item *url.URL) error
- func (i *Inboxes) GetLastPage(c util.Context, tx *sql.Tx, inbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
- func (i *Inboxes) GetPage(c util.Context, tx *sql.Tx, inbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
- func (i *Inboxes) GetPublicLastPage(c util.Context, tx *sql.Tx, inbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
- func (i *Inboxes) GetPublicPage(c util.Context, tx *sql.Tx, inbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
- func (i *Inboxes) Prepare(db *sql.DB, s SqlDialect) error
- func (i *Inboxes) PrependInboxItem(c util.Context, tx *sql.Tx, inbox, item *url.URL) error
- type InstanceActorPreferences
- type KVMatcher
- type Liked
- func (i *Liked) Close()
- func (i *Liked) Contains(c util.Context, tx *sql.Tx, liked, item *url.URL) (b bool, err error)
- func (i *Liked) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
- func (i *Liked) Create(c util.Context, tx *sql.Tx, actor *url.URL, liked ActivityStreamsCollection) error
- func (i *Liked) CreateTable(t *sql.Tx, s SqlDialect) error
- func (i *Liked) DeleteItem(c util.Context, tx *sql.Tx, liked, item *url.URL) error
- func (i *Liked) GetAllForActor(c util.Context, tx *sql.Tx, liked *url.URL) (col ActivityStreamsCollection, err error)
- func (i *Liked) GetLastPage(c util.Context, tx *sql.Tx, liked *url.URL, n int) (page ActivityStreamsCollectionPage, startIdx int, err error)
- func (i *Liked) GetPage(c util.Context, tx *sql.Tx, liked *url.URL, min, max int) (page ActivityStreamsCollectionPage, isEnd bool, err error)
- func (i *Liked) Prepare(db *sql.DB, s SqlDialect) error
- func (i *Liked) PrependItem(c util.Context, tx *sql.Tx, liked, item *url.URL) error
- type LocalData
- func (f *LocalData) Close()
- func (f *LocalData) Create(c util.Context, tx *sql.Tx, v ActivityStreams) error
- func (f *LocalData) CreateTable(t *sql.Tx, s SqlDialect) error
- func (f *LocalData) Delete(c util.Context, tx *sql.Tx, localIDIRI *url.URL) error
- func (f *LocalData) Exists(c util.Context, tx *sql.Tx, id *url.URL) (exists bool, err error)
- func (f *LocalData) Get(c util.Context, tx *sql.Tx, id *url.URL) (v ActivityStreams, err error)
- func (f *LocalData) Prepare(db *sql.DB, s SqlDialect) error
- func (f *LocalData) Stats(c util.Context, tx *sql.Tx) (la LocalDataActivity, err error)
- func (f *LocalData) Update(c util.Context, tx *sql.Tx, localIDIRI *url.URL, v ActivityStreams) error
- type LocalDataActivity
- type Model
- type NullDuration
- type OnFollowBehavior
- type Outboxes
- func (i *Outboxes) Close()
- func (i *Outboxes) Contains(c util.Context, tx *sql.Tx, inbox, item *url.URL) (b bool, err error)
- func (i *Outboxes) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
- func (i *Outboxes) Create(c util.Context, tx *sql.Tx, actor *url.URL, ...) error
- func (i *Outboxes) CreateTable(t *sql.Tx, s SqlDialect) error
- func (i *Outboxes) DeleteOutboxItem(c util.Context, tx *sql.Tx, outbox, item *url.URL) error
- func (i *Outboxes) GetLastPage(c util.Context, tx *sql.Tx, outbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
- func (i *Outboxes) GetPage(c util.Context, tx *sql.Tx, outbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
- func (i *Outboxes) GetPublicLastPage(c util.Context, tx *sql.Tx, outbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
- func (i *Outboxes) GetPublicPage(c util.Context, tx *sql.Tx, outbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
- func (i *Outboxes) OutboxForInbox(c util.Context, tx *sql.Tx, inbox *url.URL) (outbox URL, err error)
- func (i *Outboxes) Prepare(db *sql.DB, s SqlDialect) error
- func (i *Outboxes) PrependOutboxItem(c util.Context, tx *sql.Tx, outbox, item *url.URL) error
- type Policies
- func (p *Policies) Close()
- func (p *Policies) Create(c util.Context, tx *sql.Tx, cp CreatePolicy) (policyID string, err error)
- func (p *Policies) CreateTable(t *sql.Tx, s SqlDialect) error
- func (p *Policies) GetForActor(c util.Context, tx *sql.Tx, actorID *url.URL) (po []PolicyAndPurpose, err error)
- func (p *Policies) GetForActorAndPurpose(c util.Context, tx *sql.Tx, actorID *url.URL, u Purpose) (po []PolicyAndID, err error)
- func (p *Policies) Prepare(db *sql.DB, s SqlDialect) error
- type Policy
- type PolicyAndID
- type PolicyAndPurpose
- type Preferences
- type PrivateKeys
- func (p *PrivateKeys) Close()
- func (p *PrivateKeys) Create(c util.Context, tx *sql.Tx, userID, purpose string, privKey []byte) error
- func (p *PrivateKeys) CreateTable(t *sql.Tx, s SqlDialect) error
- func (p *PrivateKeys) GetByUserID(c util.Context, tx *sql.Tx, userID, purpose string) (b []byte, err error)
- func (p *PrivateKeys) GetInstanceActor(c util.Context, tx *sql.Tx, purpose string) (b []byte, err error)
- func (p *PrivateKeys) Prepare(db *sql.DB, s SqlDialect) error
- type Privileges
- type Purpose
- type Resolution
- type Resolutions
- type RetryableFailure
- type SensitiveUser
- type SingleRow
- type SqlDialect
- type TokenInfo
- func (t *TokenInfo) GetAccess() string
- func (t *TokenInfo) GetAccessCreateAt() time.Time
- func (t *TokenInfo) GetAccessExpiresIn() time.Duration
- func (t *TokenInfo) GetClientID() string
- func (t *TokenInfo) GetCode() string
- func (t *TokenInfo) GetCodeChallenge() string
- func (t *TokenInfo) GetCodeChallengeMethod() oauth2.CodeChallengeMethod
- func (t *TokenInfo) GetCodeCreateAt() time.Time
- func (t *TokenInfo) GetCodeExpiresIn() time.Duration
- func (t *TokenInfo) GetRedirectURI() string
- func (t *TokenInfo) GetRefresh() string
- func (t *TokenInfo) GetRefreshCreateAt() time.Time
- func (t *TokenInfo) GetRefreshExpiresIn() time.Duration
- func (t *TokenInfo) GetScope() string
- func (t *TokenInfo) GetUserID() string
- func (t *TokenInfo) New() oauth2.TokenInfo
- func (t *TokenInfo) SetAccess(s string)
- func (t *TokenInfo) SetAccessCreateAt(s time.Time)
- func (t *TokenInfo) SetAccessExpiresIn(s time.Duration)
- func (t *TokenInfo) SetClientID(s string)
- func (t *TokenInfo) SetCode(s string)
- func (t *TokenInfo) SetCodeChallenge(s string)
- func (t *TokenInfo) SetCodeChallengeMethod(cm oauth2.CodeChallengeMethod)
- func (t *TokenInfo) SetCodeCreateAt(s time.Time)
- func (t *TokenInfo) SetCodeExpiresIn(s time.Duration)
- func (t *TokenInfo) SetRedirectURI(s string)
- func (t *TokenInfo) SetRefresh(s string)
- func (t *TokenInfo) SetRefreshCreateAt(s time.Time)
- func (t *TokenInfo) SetRefreshExpiresIn(s time.Duration)
- func (t *TokenInfo) SetScope(s string)
- func (t *TokenInfo) SetUserID(s string)
- type TokenInfos
- func (t *TokenInfos) Close()
- func (t *TokenInfos) Create(c util.Context, tx *sql.Tx, info oauth2.TokenInfo) (id string, err error)
- func (t *TokenInfos) CreateTable(tx *sql.Tx, s SqlDialect) error
- func (t *TokenInfos) GetByAccess(c util.Context, tx *sql.Tx, access string) (oauth2.TokenInfo, error)
- func (t *TokenInfos) GetByCode(c util.Context, tx *sql.Tx, code string) (oauth2.TokenInfo, error)
- func (t *TokenInfos) GetByRefresh(c util.Context, tx *sql.Tx, refresh string) (oauth2.TokenInfo, error)
- func (t *TokenInfos) Prepare(db *sql.DB, s SqlDialect) error
- func (t *TokenInfos) RemoveByAccess(c util.Context, tx *sql.Tx, access string) error
- func (t *TokenInfos) RemoveByCode(c util.Context, tx *sql.Tx, code string) error
- func (t *TokenInfos) RemoveByRefresh(c util.Context, tx *sql.Tx, refresh string) error
- type URL
- type UnaryMatcher
- type User
- type UserActivityStats
- type Users
- func (u *Users) ActivityStats(c util.Context, tx *sql.Tx) (uas UserActivityStats, err error)
- func (u *Users) ActorIDForInbox(c util.Context, tx *sql.Tx, inbox *url.URL) (actor URL, err error)
- func (u *Users) ActorIDForOutbox(c util.Context, tx *sql.Tx, outbox *url.URL) (actor URL, err error)
- func (u *Users) Close()
- func (u *Users) Create(c util.Context, tx *sql.Tx, r *CreateUser) (userID string, err error)
- func (u *Users) CreateTable(t *sql.Tx, s SqlDialect) error
- func (u *Users) InstanceActorPreferences(c util.Context, tx *sql.Tx) (iap InstanceActorPreferences, err error)
- func (u *Users) InstanceActorUser(c util.Context, tx *sql.Tx) (s *User, err error)
- func (u *Users) Prepare(db *sql.DB, s SqlDialect) error
- func (u *Users) SensitiveUserByEmail(c util.Context, tx *sql.Tx, email string) (s *SensitiveUser, err error)
- func (u *Users) SetInstanceActorPreferences(c util.Context, tx *sql.Tx, iap InstanceActorPreferences) (err error)
- func (u *Users) UpdateActor(c util.Context, tx *sql.Tx, id string, actor ActivityStreams) error
- func (u *Users) UpdatePreferences(c util.Context, tx *sql.Tx, id string, p Preferences) error
- func (u *Users) UpdatePrivileges(c util.Context, tx *sql.Tx, id string, p Privileges) error
- func (u *Users) UserByID(c util.Context, tx *sql.Tx, id string) (s *User, err error)
- func (u *Users) UserByPreferredUsername(c util.Context, tx *sql.Tx, name string) (s *User, err error)
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustChangeOneRow ¶
Types ¶
type ActivityStreams ¶
ActivityStreams is a wrapper around any ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (ActivityStreams) SanitizeContentSummaryHTML ¶
func (a ActivityStreams) SanitizeContentSummaryHTML()
func (*ActivityStreams) Scan ¶
func (a *ActivityStreams) Scan(src interface{}) error
type ActivityStreamsApplication ¶
type ActivityStreamsApplication struct {
vocab.ActivityStreamsApplication
}
ActivityStreamsApplication is a wrapper around the ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (*ActivityStreamsApplication) Scan ¶
func (a *ActivityStreamsApplication) Scan(src interface{}) error
type ActivityStreamsCollection ¶
type ActivityStreamsCollection struct {
vocab.ActivityStreamsCollection
}
ActivityStreamsCollection is a wrapper around the ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (*ActivityStreamsCollection) Scan ¶
func (a *ActivityStreamsCollection) Scan(src interface{}) error
type ActivityStreamsCollectionPage ¶
type ActivityStreamsCollectionPage struct {
vocab.ActivityStreamsCollectionPage
}
ActivityStreamsCollectionPage is a wrapper around the ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (*ActivityStreamsCollectionPage) Scan ¶
func (a *ActivityStreamsCollectionPage) Scan(src interface{}) error
type ActivityStreamsFollow ¶
type ActivityStreamsFollow struct {
vocab.ActivityStreamsFollow
}
ActivityStreamsFollow is a wrapper around the ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (*ActivityStreamsFollow) Scan ¶
func (a *ActivityStreamsFollow) Scan(src interface{}) error
type ActivityStreamsOrderedCollection ¶
type ActivityStreamsOrderedCollection struct {
vocab.ActivityStreamsOrderedCollection
}
ActivityStreamsOrderedCollection is a wrapper around the ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (*ActivityStreamsOrderedCollection) Scan ¶
func (a *ActivityStreamsOrderedCollection) Scan(src interface{}) error
type ActivityStreamsOrderedCollectionPage ¶
type ActivityStreamsOrderedCollectionPage struct {
vocab.ActivityStreamsOrderedCollectionPage
}
ActivityStreamsOrderedCollectionPage is a wrapper around the ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (*ActivityStreamsOrderedCollectionPage) Scan ¶
func (a *ActivityStreamsOrderedCollectionPage) Scan(src interface{}) error
type ActivityStreamsPerson ¶
type ActivityStreamsPerson struct {
vocab.ActivityStreamsPerson
}
ActivityStreamsPerson is a wrapper around the ActivityStreams type that also knows how to serialize and deserialize itself for SQL database drivers.
func (*ActivityStreamsPerson) Scan ¶
func (a *ActivityStreamsPerson) Scan(src interface{}) error
type BinaryMatcher ¶
type BinaryMatcher struct { L *UnaryMatcher `json:"left"` R *UnaryMatcher `json:"right"` }
func (BinaryMatcher) Match ¶
func (b BinaryMatcher) Match(res gjson.Result, json []byte, r *Resolution) (lhs, rhs bool, err error)
func (BinaryMatcher) Validate ¶
func (b BinaryMatcher) Validate() error
type ClientInfo ¶
type ClientInfo struct { ID string Secret sql.NullString Domain string UserID string }
func (*ClientInfo) GetDomain ¶
func (c *ClientInfo) GetDomain() string
func (*ClientInfo) GetID ¶
func (c *ClientInfo) GetID() string
func (*ClientInfo) GetSecret ¶
func (c *ClientInfo) GetSecret() string
func (*ClientInfo) GetUserID ¶
func (c *ClientInfo) GetUserID() string
type ClientInfos ¶
type ClientInfos struct {
// contains filtered or unexported fields
}
ClientInfos is a Model that provides additional database methods for OAuth2 client information.
func (*ClientInfos) Close ¶
func (c *ClientInfos) Close()
func (*ClientInfos) Create ¶
func (c *ClientInfos) Create(ctx util.Context, tx *sql.Tx, info oauth2.ClientInfo) (id string, err error)
Create adds a ClientInfo into the database.
func (*ClientInfos) CreateTable ¶
func (c *ClientInfos) CreateTable(t *sql.Tx, s SqlDialect) error
func (*ClientInfos) GetByID ¶
func (c *ClientInfos) GetByID(ctx util.Context, tx *sql.Tx, id string) (oauth2.ClientInfo, error)
GetByID fetches ClientInfo based on its id.
func (*ClientInfos) Prepare ¶
func (c *ClientInfos) Prepare(db *sql.DB, s SqlDialect) error
type CreateResolution ¶
type CreateResolution struct { PolicyID string IRI *url.URL R Resolution }
type CreateUser ¶
type CreateUser struct { Email string Hashpass []byte Salt []byte Actor driver.Valuer Privileges Privileges Preferences Preferences }
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
Credentials is a Model that provides a first-party proxy to OAuth2 tokens for cookies and other first-party storage.
func (*Credentials) Close ¶
func (c *Credentials) Close()
func (*Credentials) Create ¶
func (c *Credentials) Create(ctx util.Context, tx *sql.Tx, userID, tokenID string, expires time.Time) (id string, err error)
Create saves the new first party credential.
func (*Credentials) CreateTable ¶
func (c *Credentials) CreateTable(tx *sql.Tx, s SqlDialect) error
func (*Credentials) DeleteExpired ¶
func (*Credentials) GetTokenInfo ¶
func (*Credentials) Prepare ¶
func (c *Credentials) Prepare(db *sql.DB, s SqlDialect) error
type DeliveryAttempts ¶
type DeliveryAttempts struct {
// contains filtered or unexported fields
}
DeliveryAttempts is a Model that provides additional database methods for delivery attempts.
func (*DeliveryAttempts) Close ¶
func (d *DeliveryAttempts) Close()
func (*DeliveryAttempts) Create ¶
func (d *DeliveryAttempts) Create(c util.Context, tx *sql.Tx, from string, toActor *url.URL, payload []byte) (id string, err error)
Create a new delivery attempt.
func (*DeliveryAttempts) CreateTable ¶
func (d *DeliveryAttempts) CreateTable(t *sql.Tx, s SqlDialect) error
func (*DeliveryAttempts) FirstPageFailures ¶
func (d *DeliveryAttempts) FirstPageFailures(c util.Context, tx *sql.Tx, fetchTime time.Time, n int) (rf []RetryableFailure, err error)
FirstPageFailures obtains the first page of retryable failures.
func (*DeliveryAttempts) MarkAbandoned ¶
MarkAbandoned marks a delivery attempt as abandoned.
func (*DeliveryAttempts) MarkFailed ¶
MarkFailed marks a delivery attempt as failed.
func (*DeliveryAttempts) MarkSuccessful ¶
MarkSuccessful marks a delivery attempt as successful.
func (*DeliveryAttempts) NextPageFailures ¶
func (d *DeliveryAttempts) NextPageFailures(c util.Context, tx *sql.Tx, prevID string, fetchTime time.Time, n int) (rf []RetryableFailure, err error)
NextPageFailures obtains the next page of retryable failures.
func (*DeliveryAttempts) Prepare ¶
func (d *DeliveryAttempts) Prepare(db *sql.DB, s SqlDialect) error
type FedData ¶
type FedData struct {
// contains filtered or unexported fields
}
FedData is a Model that provides additional database methods for ActivityStreams data received from federated peers.
func (*FedData) CreateTable ¶
func (f *FedData) CreateTable(t *sql.Tx, s SqlDialect) error
type Followers ¶
type Followers struct {
// contains filtered or unexported fields
}
Followers is a Model that provides additional database methods for Followers.
func (*Followers) Contains ¶
func (i *Followers) Contains(c util.Context, tx *sql.Tx, followers, item *url.URL) (b bool, err error)
Contains returns true if the item is in the followers's collection.
func (*Followers) ContainsForActor ¶
func (i *Followers) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
ContainsForActor returns true if the item is in the actor's followers's collection.
func (*Followers) Create ¶
func (i *Followers) Create(c util.Context, tx *sql.Tx, actor *url.URL, followers ActivityStreamsCollection) error
Create a new followers for the given actor.
func (*Followers) CreateTable ¶
func (i *Followers) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Followers) DeleteItem ¶
DeleteItem removes the item from the followers' ordered items list.
func (*Followers) GetAllForActor ¶
func (i *Followers) GetAllForActor(c util.Context, tx *sql.Tx, followers *url.URL) (col ActivityStreamsCollection, err error)
GetAllForActor returns the entire Collection of the Followers.
func (*Followers) GetLastPage ¶
func (i *Followers) GetLastPage(c util.Context, tx *sql.Tx, followers *url.URL, n int) (page ActivityStreamsCollectionPage, startIdx int, err error)
GetLastPage returns the last CollectionPage of the Followers.
func (*Followers) GetPage ¶
func (i *Followers) GetPage(c util.Context, tx *sql.Tx, followers *url.URL, min, max int) (page ActivityStreamsCollectionPage, isEnd bool, err error)
GetPage returns a CollectionPage of the Followers.
The range of elements retrieved are [min, max).
func (*Followers) OpenFollowRequests ¶
type Following ¶
type Following struct {
// contains filtered or unexported fields
}
Following is a Model that provides additional database methods for Following.
func (*Following) Contains ¶
func (i *Following) Contains(c util.Context, tx *sql.Tx, following, item *url.URL) (b bool, err error)
Contains returns true if the item is in the following's collection.
func (*Following) ContainsForActor ¶
func (i *Following) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
ContainsForActor returns true if the item is in the actor's following's collection.
func (*Following) Create ¶
func (i *Following) Create(c util.Context, tx *sql.Tx, actor *url.URL, following ActivityStreamsCollection) error
Create a new following entry for the given actor.
func (*Following) CreateTable ¶
func (i *Following) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Following) DeleteItem ¶
DeleteItem removes the item from the following's ordered items list.
func (*Following) GetAllForActor ¶
func (i *Following) GetAllForActor(c util.Context, tx *sql.Tx, following *url.URL) (col ActivityStreamsCollection, err error)
GetAllForActor returns the entire Following Collection.
func (*Following) GetLastPage ¶
func (i *Following) GetLastPage(c util.Context, tx *sql.Tx, following *url.URL, n int) (page ActivityStreamsCollectionPage, startIdx int, err error)
GetLastPage returns the last CollectionPage of the Following collection.
type Inboxes ¶
type Inboxes struct {
// contains filtered or unexported fields
}
Inboxes is a Model that provides additional database methods for Inboxes.
func (*Inboxes) ContainsForActor ¶
func (i *Inboxes) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
ContainsForActor returns true if the item is in the actor's inbox's collection.
func (*Inboxes) Create ¶
func (i *Inboxes) Create(c util.Context, tx *sql.Tx, actor *url.URL, inbox ActivityStreamsOrderedCollection) error
Create a new inbox for the given actor.
func (*Inboxes) CreateTable ¶
func (i *Inboxes) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Inboxes) DeleteInboxItem ¶
DeleteInboxItem removes the item from the inbox's ordered items list.
func (*Inboxes) GetLastPage ¶
func (i *Inboxes) GetLastPage(c util.Context, tx *sql.Tx, inbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
GetLastPage returns the last OrderedCollectionPage of the Inbox.
func (*Inboxes) GetPage ¶
func (i *Inboxes) GetPage(c util.Context, tx *sql.Tx, inbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
GetPage returns an OrderedCollectionPage of the Inbox.
The range of elements retrieved are [min, max).
func (*Inboxes) GetPublicLastPage ¶
func (i *Inboxes) GetPublicLastPage(c util.Context, tx *sql.Tx, inbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
GetPublicLastPage returns the last OrderedCollectionPage of inbox items that are public only.
func (*Inboxes) GetPublicPage ¶
func (i *Inboxes) GetPublicPage(c util.Context, tx *sql.Tx, inbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
GetPublicPage returns an OrderedCollectionPage of inbox items that are public only.
The range of elements retrieved are [min, max).
type InstanceActorPreferences ¶
type InstanceActorPreferences struct { // OnFollow indicates default behavior when a Follow request is received // by a user. OnFollow OnFollowBehavior // OpenRegistrations indicates whether registrations are open for this // software. OpenRegistrations bool // ServerBaseURL indicates the "base URL" of this server. ServerBaseURL string // ServerName contains the name of this particular server. ServerName string // OrgName contains the name of the wider organization this server // belongs to. OrgName string // OrgContact contains the contact information for the Organization this // server belongs to. OrgContact string // OrgAccount contains the account information representing the // Organization this server belongs to. OrgAccount string // Payload is additional preference information that is app-specific. Payload json.RawMessage }
InstanceActorPreferences are the preferences for an instance actor which are serializable and deserializable into JSON for database storage.
func (*InstanceActorPreferences) Scan ¶
func (p *InstanceActorPreferences) Scan(src interface{}) error
type KVMatcher ¶
type KVMatcher struct { // KeyPathQuery is a GJSON path query KeyPathQuery string `json:"keyPathQuery,omitempty"` ValueMatcher *UnaryMatcher `json:"valueMatcher,omitempty"` }
type Liked ¶
type Liked struct {
// contains filtered or unexported fields
}
Liked is a Model that provides additional database methods for Liked.
func (*Liked) ContainsForActor ¶
func (i *Liked) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
ContainsForActor returns true if the item is in the actor's liked's collection.
func (*Liked) Create ¶
func (i *Liked) Create(c util.Context, tx *sql.Tx, actor *url.URL, liked ActivityStreamsCollection) error
Create a new liked entry for the given actor.
func (*Liked) CreateTable ¶
func (i *Liked) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Liked) DeleteItem ¶
DeleteItem removes the item from the liked's ordered items list.
func (*Liked) GetAllForActor ¶
func (i *Liked) GetAllForActor(c util.Context, tx *sql.Tx, liked *url.URL) (col ActivityStreamsCollection, err error)
GetAllForActor returns the entire Liked Collection.
func (*Liked) GetLastPage ¶
func (i *Liked) GetLastPage(c util.Context, tx *sql.Tx, liked *url.URL, n int) (page ActivityStreamsCollectionPage, startIdx int, err error)
GetLastPage returns the last CollectionPage of the Liked collection.
type LocalData ¶
type LocalData struct {
// contains filtered or unexported fields
}
LocalData is a Model that provides additional database methods for ActivityStreams data generated by this instance.
func (*LocalData) CreateTable ¶
func (f *LocalData) CreateTable(t *sql.Tx, s SqlDialect) error
type LocalDataActivity ¶
type Model ¶
type Model interface { Prepare(*sql.DB, SqlDialect) error CreateTable(*sql.Tx, SqlDialect) error Close() }
Model handles managing a single database type.
type NullDuration ¶
NullDuration can handle nullable time.Duration values in the database.
func (*NullDuration) Scan ¶
func (n *NullDuration) Scan(src interface{}) error
type OnFollowBehavior ¶
type OnFollowBehavior pub.OnFollowBehavior
OnFollowBehavior is a wrapper around pub.OnFollowBehavior type that also knows how to serialize and deserialize itself for SQL database drivers in a more readable manner.
func (*OnFollowBehavior) Scan ¶
func (o *OnFollowBehavior) Scan(src interface{}) error
type Outboxes ¶
type Outboxes struct {
// contains filtered or unexported fields
}
Outboxes is a Model that provides additional database methods for Outboxes.
func (*Outboxes) ContainsForActor ¶
func (i *Outboxes) ContainsForActor(c util.Context, tx *sql.Tx, actor, item *url.URL) (b bool, err error)
ContainsForActor returns true if the item is in the actor's outbox's collection.
func (*Outboxes) Create ¶
func (i *Outboxes) Create(c util.Context, tx *sql.Tx, actor *url.URL, outbox ActivityStreamsOrderedCollection) error
Create a new outbox for the given actor.
func (*Outboxes) CreateTable ¶
func (i *Outboxes) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Outboxes) DeleteOutboxItem ¶
DeleteOutboxItem removes the item from the outbox's ordered items list.
func (*Outboxes) GetLastPage ¶
func (i *Outboxes) GetLastPage(c util.Context, tx *sql.Tx, outbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
GetLastPage returns the last OrderedCollectionPage of the Outbox.
func (*Outboxes) GetPage ¶
func (i *Outboxes) GetPage(c util.Context, tx *sql.Tx, outbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
GetPage returns an OrderedCollectionPage of the Outbox.
The range of elements retrieved are [min, max).
func (*Outboxes) GetPublicLastPage ¶
func (i *Outboxes) GetPublicLastPage(c util.Context, tx *sql.Tx, outbox *url.URL, n int) (page ActivityStreamsOrderedCollectionPage, startIdx int, err error)
GetPublicLastPage returns the last OrderedCollectionPage of outbox items that are public only.
func (*Outboxes) GetPublicPage ¶
func (i *Outboxes) GetPublicPage(c util.Context, tx *sql.Tx, outbox *url.URL, min, max int) (page ActivityStreamsOrderedCollectionPage, isEnd bool, err error)
GetPublicPage returns an OrderedCollectionPage of outbox items that are public only.
The range of elements retrieved are [min, max).
type Policies ¶
type Policies struct {
// contains filtered or unexported fields
}
Policies is a Model that provides additional database methods for the Policy type.
func (*Policies) CreateTable ¶
func (p *Policies) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Policies) GetForActor ¶
func (p *Policies) GetForActor(c util.Context, tx *sql.Tx, actorID *url.URL) (po []PolicyAndPurpose, err error)
GetForActor obtains all policies for an Actor.
type Policy ¶
type PolicyAndID ¶
type PolicyAndPurpose ¶
type Preferences ¶
type Preferences struct { // OnFollow indicates default behavior when a Follow request is received // by a user. OnFollow OnFollowBehavior // Payload is additional preference information that is app-specific. Payload json.RawMessage }
Preferences are a user's preferences serializable and deserializable into JSON for database storage.
func (*Preferences) Scan ¶
func (p *Preferences) Scan(src interface{}) error
type PrivateKeys ¶
type PrivateKeys struct {
// contains filtered or unexported fields
}
PrivateKeys is a Model that provides additional database methods for the PrivateKey type.
func (*PrivateKeys) Close ¶
func (p *PrivateKeys) Close()
func (*PrivateKeys) Create ¶
func (p *PrivateKeys) Create(c util.Context, tx *sql.Tx, userID, purpose string, privKey []byte) error
Create a new private key entry in the database.
func (*PrivateKeys) CreateTable ¶
func (p *PrivateKeys) CreateTable(t *sql.Tx, s SqlDialect) error
func (*PrivateKeys) GetByUserID ¶
func (p *PrivateKeys) GetByUserID(c util.Context, tx *sql.Tx, userID, purpose string) (b []byte, err error)
GetByUserID fetches a private key by the userID and purpose of the key.
func (*PrivateKeys) GetInstanceActor ¶
func (p *PrivateKeys) GetInstanceActor(c util.Context, tx *sql.Tx, purpose string) (b []byte, err error)
GetInstanceActor fetches a private key for the single instance actor.
func (*PrivateKeys) Prepare ¶
func (p *PrivateKeys) Prepare(db *sql.DB, s SqlDialect) error
type Privileges ¶
type Privileges struct { // Admin indicates whether to treat the user as an administrator by the // framework. Admin bool // InstanceActor indicates whether to treat the user as the instance // actor. InstanceActor bool // Payload is additional privilege information that is app-specific. Payload json.RawMessage }
Privileges are a user's privileges serializable and deserializable into JSON for database storage.
func (*Privileges) Scan ¶
func (p *Privileges) Scan(src interface{}) error
type Resolution ¶
type Resolution struct { Time time.Time `json:"time",omitempty` // The following are used by Policies Matched bool `json:"matched",omitempty` MatchLog []string `json:"matchLog",omitempty` }
func (*Resolution) Log ¶
func (r *Resolution) Log(s string)
func (*Resolution) Logf ¶
func (r *Resolution) Logf(s string, i ...interface{})
type Resolutions ¶
type Resolutions struct {
// contains filtered or unexported fields
}
Resolutions is a Model that provides additional database methods for the Resolution type.
func (*Resolutions) Close ¶
func (r *Resolutions) Close()
func (*Resolutions) Create ¶
func (r *Resolutions) Create(c util.Context, tx *sql.Tx, cr CreateResolution) error
Create a new Resolution
func (*Resolutions) CreateTable ¶
func (r *Resolutions) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Resolutions) Prepare ¶
func (r *Resolutions) Prepare(db *sql.DB, s SqlDialect) error
type RetryableFailure ¶
type SensitiveUser ¶
type SqlDialect ¶
type SqlDialect interface { // CreateUsersTable for the User model. CreateUsersTable() string // CreateFedDataTable for the FedData model. CreateFedDataTable() string // CreateLocalDataTable for the LocalData model. CreateLocalDataTable() string // CreateInboxesTable for the Inboxes model. CreateInboxesTable() string // CreateOutboxesTable for the Outboxes model. CreateOutboxesTable() string // CreateDeliveryAttemptsTable for the DeliveryAttempts model. CreateDeliveryAttemptsTable() string // CreatePrivateKeysTable for the PrivateKeys model. CreatePrivateKeysTable() string // CreateClientInfosTable for the ClientInfos model. CreateClientInfosTable() string // CreateTokenInfosTable for the TokenInfos model. CreateTokenInfosTable() string // CreateFollowersTable for the Followers model. CreateFollowersTable() string // CreateFollowingTable for the Following model. CreateFollowingTable() string // CreateLikedTable for the Liked model. CreateLikedTable() string // CreatePoliciesTable for the Policies model. CreatePoliciesTable() string // CreateResolutionsTable for the Resolutions model. CreateResolutionsTable() string // CreateFirstPartyCredentialsTable for first party credentials model. CreateFirstPartyCredentialsTable() string // CreateIndexIDFedDataTable creates an index on the `id` of a federated // data payload. CreateIndexIDFedDataTable() string // CreateIndexIDLocalDataTable creates an index on the `id` of a local // data payload. CreateIndexIDLocalDataTable() string // CreateIndexIDInboxesTable creates an index on the `id` of an inbox. CreateIndexIDInboxesTable() string // CreateIndexIDOutboxesTable creates an index on the `id` of an outbox. CreateIndexIDOutboxesTable() string // CreateIndexIDFollowersTable creates an index on the `id` of a // followers collection. CreateIndexIDFollowersTable() string // CreateIndexIDFollowingTable creates an index on the `id` of a // following collection. CreateIndexIDFollowingTable() string // CreateIndexIDLikedTable creates an index on the `id` of a liked // collection. CreateIndexIDLikedTable() string // InsertUser: // Params // Email string // Hashpass []byte // Salt []byte // Actor []byte // Privileges []byte // Preferences []byte // Returns // ID string InsertUser() string // UpdateUserActor: // Params // ID string // Actor []byte // Returns UpdateUserActor() string // SensitiveUserByEmail: // Params // Email string // Returns // ID string // Hashpass []byte // Salt []byte SensitiveUserByEmail() string // UserByID: // Params // ID string // Returns // ID string // Email string // Actor []byte // Privileges []byte // Preferences []byte UserByID() string // UserByPreferredUsername: // Params // Name string // Returns // ID string // Email string // Actor []byte // Privileges []byte // Preferences []byte UserByPreferredUsername() string // ActorIDForOutbox: // Params // OutboxID string // Returns // ActorID string ActorIDForOutbox() string // ActorIDForInbox: // Params // InboxID string // Returns // ActorID string ActorIDForInbox() string // UpdateUserPreferences: // Params // ID string // Preferences []byte // Returns UpdateUserPreferences() string // UpdateUserPrivileges: // Params // ID string // Privileges []byte // Returns UpdateUserPrivileges() string // InstanceUser: // Params // Returns // ID string // Email string // Actor []byte // Privileges []byte // Preferences []byte InstanceUser() string // GetInstanceActorProfile: // Params // Returns // Prefs []byte GetInstanceActorPreferences() string // SetInstanceActorProfile: // Params // Prefs []byte // Returns SetInstanceActorPreferences() string // GetUserActivityStats: // Params // Returns // TotalUsers int // ActiveHalfYear int // ActiveMonth int // ActiveWeek int GetUserActivityStats() string // FedExists: // Params // ID string // Returns // Exists bool FedExists() string // FedGet: // Params // ID string // Returns // Payload []byte FedGet() string // FedCreate: // Params // Payload []byte // Returns FedCreate() string // FedUpdate: // Params // ID string // Payload []byte // Returns FedUpdate() string // FedDelete: // Params // ID string // Returns FedDelete() string // LocalExists: // Params // ID string // Returns // Exists bool LocalExists() string // LocalGet: // Params // ID string // Returns // Payload []byte LocalGet() string // LocalCreate: // Params // Payload []byte // Returns LocalCreate() string // LocalUpdate: // Params // ID string // Payload []byte // Returns LocalUpdate() string // LocalDelete: // Params // ID string // Returns LocalDelete() string // LocalStats: // Params // Returns // NLocalPosts int // NLocalComments int LocalStats() string // InsertInbox: // Params // ActorID string // Inbox []byte // Returns InsertInbox() string // InboxContainsForActor: // Params // ActorID string // Item string // Returns // Contains bool InboxContainsForActor() string // InboxContains: // Params // InboxID string // Item string // Returns // Contains bool InboxContains() string // GetInbox: // Params // Inbox string // Min int // Max int // Returns // Page []byte // IsEnd bool GetInbox() string // GetPublicInbox: // Params // Inbox string // Min int // Max int // Returns // Page []byte // IsEnd bool GetPublicInbox() string // GetInboxLastPage: // Params // Inbox string // N int // Returns // Page []byte // StartIndex int GetInboxLastPage() string // GetPublicInboxLastPage: // Params // Inbox string // N int // Returns // Page []byte // StartIndex int GetPublicInboxLastPage() string // PrependInboxItem: // Params // Inbox string // Item string // Returns PrependInboxItem() string // DeleteInboxItem: // Params // Inbox string // Item string // Returns DeleteInboxItem() string // InsertOutbox: // Params // ActorID string // Outbox []byte // Returns InsertOutbox() string // OutboxContainsForActor: // Params // ActorID string // Item string // Returns // Contains bool OutboxContainsForActor() string // OutboxContains: // Params // OutboxID string // Item string // Returns // Contains bool OutboxContains() string // GetOutbox: // Params // Outbox string // Min int // Max int // Returns // Page []byte // IsEnd bool GetOutbox() string // GetPublicOutbox: // Params // Outbox string // Min int // Max int // Returns // Page []byte // IsEnd bool GetPublicOutbox() string // GetOutboxLastPage: // Params // Outbox string // N int // Returns // Page []byte // StartIndex int GetOutboxLastPage() string // GetPublicOutboxLastPage: // Params // Outbox string // N int // Returns // Page []byte // StartIndex int GetPublicOutboxLastPage() string // PrependOutboxItem: // Params // Outbox string // Item string // Returns PrependOutboxItem() string // DeleteOutboxItem: // Params // Outbox string // Item string // Returns DeleteOutboxItem() string // OutboxForInbox: // Params // Inbox string // Returns // Outbox string OutboxForInbox() string // InsertAttempt: // Params // FromID string // ToActor string // Payload []byte // State string // Returns // ID string InsertAttempt() string // MarkSuccessfulAttempt: // Params // ID string // Returns MarkSuccessfulAttempt() string // MarkFailedAttempt: // Params // ID string // Returns MarkFailedAttempt() string // MarkAbandonedAttempt: // Params // ID string // Returns MarkAbandonedAttempt() string // FirstPageRetryableFailures: // Params // State string // FetchTime time.Time // Limit int // Returns // ID string // FromID string // DeliverTo string // Payload []byte // NAttempts int // LastAttempt time.Time FirstPageRetryableFailures() string // NextPageRetryableFailures: // Params // State string // FetchTime time.Time // Limit int // PrevID string // Returns // ID string // FromID string // DeliverTo string // Payload []byte // NAttempts int // LastAttempt time.Time NextPageRetryableFailures() string // CreatePrivateKey: // Params // UserID string // Purpose string // PrivKey []byte // Returns CreatePrivateKey() string // GetPrivateKeyByUserID: // Params // UserID string // Purpose string // Returns // PrivKey []byte GetPrivateKeyByUserID() string // GetPrivateKeyForInstanceActor: // Params // Purpose string // Returns // PrivKey []byte GetPrivateKeyForInstanceActor() string // CreateClientInfo: // Params // Secret string // Domain string // UserID string // Returns // ID string CreateClientInfo() string // GetClientInfoByID: // Params // ID string // Returns // ID string // Secret string // Domain string // UserID string GetClientInfoByID() string // CreateTokenInfo: // Params // ClientID string // UserID string // RedirURI string // Scope string // Code string // CodeCreated time.Time // CodeExpires time.Duration // CodeChal string // CodeChalMtd string // Access string // AccessCtd time.Time // AccessExp time.Duration // Refresh string // RefrCreated time.Time // RefrExpires time.Duration // Returns // ID string CreateTokenInfo() string // RemoveTokenInfoByCode: // Params // Code string // Returns RemoveTokenInfoByCode() string // RemoveTokenInfoByAccess: // Params // Access string // Returns RemoveTokenInfoByAccess() string // RemoveTokenInfoByRefresh: // Params // Refresh string // Returns RemoveTokenInfoByRefresh() string // GetTokenInfoByCode: // Params // Code string // Returns // ClientID string // UserID string // RedirURI string // Scope string // Code string // CodeCreated time.Time // CodeExpires time.Duration // CodeChal string // CodeChalMtd string // Access string // AccessCtd time.Time // AccessExp time.Duration // Refresh string // RefrCreated time.Time // RefrExpires time.Duration GetTokenInfoByCode() string // GetTokenInfoByAccess: // Params // Access string // Returns // ClientID string // UserID string // RedirURI string // Scope string // Code string // CodeCreated time.Time // CodeExpires time.Duration // CodeChal string // CodeChalMtd string // Access string // AccessCtd time.Time // AccessExp time.Duration // Refresh string // RefrCreated time.Time // RefrExpires time.Duration GetTokenInfoByAccess() string // GetTokenInfoByRefresh: // Params // Refresh string // Returns // ClientID string // UserID string // RedirURI string // Scope string // Code string // CodeCreated time.Time // CodeExpires time.Duration // CodeChal string // CodeChalMtd string // Access string // AccessCtd time.Time // AccessExp time.Duration // Refresh string // RefrCreated time.Time // RefrExpires time.Duration GetTokenInfoByRefresh() string // InsertFollowers: // Params // ActorID string // Followers []byte // Returns InsertFollowers() string // FollowersContainsForActor: // Params // ActorID string // Item string // Returns // Contains bool FollowersContainsForActor() string // FollowersContains: // Params // Followers string // Item string // Returns // Contains bool FollowersContains() string // GetFollowers: // Params // Followers string // Min int // Max int // Returns // Page []byte // IsEnd bool GetFollowers() string // GetFollowersLastPage: // Params // Followers string // N int // Returns // Page []byte // StartIndex int GetFollowersLastPage() string // PrependFollowersItem: // Params // Followers string // Item string // Returns PrependFollowersItem() string // DeleteFollowersItem: // Params // Followers string // Item string // Returns DeleteFollowersItem() string // GetAllFollowersForActor: // Params // Followers string // Returns // Followers []byte GetAllFollowersForActor() string // InsertFollowing: // Params // ActorID string // Following []byte // Returns InsertFollowing() string // FollowingContainsForActor: // Params // ActorID string // Item string // Returns // Contains bool FollowingContainsForActor() string // FollowingContains: // Params // Following string // Item string // Returns // Contains bool FollowingContains() string // GetFollowing: // Params // Following string // Min int // Max int // Returns // Page []byte // IsEnd bool GetFollowing() string // GetFollowingLastPage: // Params // Following string // N int // Returns // Page []byte // StartIndex int GetFollowingLastPage() string // PrependFollowingItem: // Params // Following string // Item string // Returns PrependFollowingItem() string // DeleteFollowingItem: // Params // Following string // Item string // Returns DeleteFollowingItem() string // GetAllFollowingForActor: // Params // Following string // Returns // Following []byte GetAllFollowingForActor() string // InsertLiked: // Params // ActorID string // Liked []byte // Returns InsertLiked() string // LikedContainsForActor: // Params // ActorID string // Item string // Returns // Contains bool LikedContainsForActor() string // LikedContains: // Params // Liked string // Item string // Returns // Contains bool LikedContains() string // GetLiked: // Params // Liked string // Min int // Max int // Returns // Page []byte // IsEnd bool GetLiked() string // GetLikedLastPage: // Params // Liked string // N int // Returns // Page []byte // StartIndex int GetLikedLastPage() string // PrependLikedItem: // Params // Liked string // Item string // Returns PrependLikedItem() string // DeleteLikedItem: // Params // Liked string // Item string // Returns DeleteLikedItem() string // GetAllLikedForActor: // Params // Liked string // Returns // Liked []byte GetAllLikedForActor() string // CreatePolicy: // Params // ActorID string // Purpose string // Payload []byte // Returns // ID string CreatePolicy() string // GetPoliciesForActor: // Params // ActorID string // Returns (Multiple) // ID string // Purpose string // Payload []byte GetPoliciesForActor() string // GetPoliciesForActorAndPurpose: // Params // ActorID string // Purpose string // Returns (Multiple) // ID string // Payload []byte GetPoliciesForActorAndPurpose() string // CreateResolution: // Params // PolicyID string // DataIRI string // Payload []byte // Returns CreateResolution() string // CreateFirstPartyCredential: // Params // UserID string // TokenID string // Expires time.Time // Returns // ID string CreateFirstPartyCredential() string // UpdateFirstPartyCredential: // Params // ID string // ClientID string // UserID string // RedirURI string // Scope string // Code string // CodeCreated time.Time // CodeExpires time.Duration // CodeChal string // CodeChalMtd string // Access string // AccessCtd time.Time // AccessExp time.Duration // Refresh string // RefrCreated time.Time // RefrExpires time.Duration // Returns UpdateFirstPartyCredential() string // UpdateFirstPartyCredentialExpires: // Params // ID string // Expires time.Time // Returns UpdateFirstPartyCredentialExpires() string // RemoveFirstPartyCredential: // Params // ID string // Returns RemoveFirstPartyCredential() string // RemoveExpiredFirstPartyCredentials: // Params // Returns RemoveExpiredFirstPartyCredentials() string // GetTokenInfoForCredentialID: // Params // ID string // Returns // ClientID string // UserID string // RedirURI string // Scope string // Code string // CodeCreated time.Time // CodeExpires time.Duration // CodeChal string // CodeChalMtd string // Access string // AccessCtd time.Time // AccessExp time.Duration // Refresh string // RefrCreated time.Time // RefrExpires time.Duration GetTokenInfoForCredentialID() string // GetOpenFollowRequests // Params // ID string // Returns (Multiple) // Payload []byte GetOpenFollowRequests() string }
SqlDialect is a SQL dialect provider.
Note that the order for inputs and outputs listed matter.
type TokenInfo ¶
type TokenInfo struct { ClientID string UserID string RedirectURI string Scope string Code sql.NullString CodeCreated sql.NullTime CodeExpires NullDuration CodeChallenge sql.NullString CodeChallengeMethod sql.NullString Access sql.NullString AccessCreated sql.NullTime AccessExpires NullDuration Refresh sql.NullString RefreshCreated sql.NullTime RefreshExpires NullDuration }
func (*TokenInfo) GetAccessCreateAt ¶
func (*TokenInfo) GetAccessExpiresIn ¶
func (*TokenInfo) GetClientID ¶
func (*TokenInfo) GetCodeChallenge ¶
func (*TokenInfo) GetCodeChallengeMethod ¶
func (t *TokenInfo) GetCodeChallengeMethod() oauth2.CodeChallengeMethod
func (*TokenInfo) GetCodeCreateAt ¶
func (*TokenInfo) GetCodeExpiresIn ¶
func (*TokenInfo) GetRedirectURI ¶
func (*TokenInfo) GetRefresh ¶
func (*TokenInfo) GetRefreshCreateAt ¶
func (*TokenInfo) GetRefreshExpiresIn ¶
func (*TokenInfo) SetAccessCreateAt ¶
func (*TokenInfo) SetAccessExpiresIn ¶
func (*TokenInfo) SetClientID ¶
func (*TokenInfo) SetCodeChallenge ¶
func (*TokenInfo) SetCodeChallengeMethod ¶
func (t *TokenInfo) SetCodeChallengeMethod(cm oauth2.CodeChallengeMethod)
func (*TokenInfo) SetCodeCreateAt ¶
func (*TokenInfo) SetCodeExpiresIn ¶
func (*TokenInfo) SetRedirectURI ¶
func (*TokenInfo) SetRefresh ¶
func (*TokenInfo) SetRefreshCreateAt ¶
func (*TokenInfo) SetRefreshExpiresIn ¶
type TokenInfos ¶
type TokenInfos struct {
// contains filtered or unexported fields
}
TokenInfos is a Model that provides additional database methods for OAuth2 token information.
func (*TokenInfos) Close ¶
func (t *TokenInfos) Close()
func (*TokenInfos) Create ¶
func (t *TokenInfos) Create(c util.Context, tx *sql.Tx, info oauth2.TokenInfo) (id string, err error)
Create saves the new token information.
func (*TokenInfos) CreateTable ¶
func (t *TokenInfos) CreateTable(tx *sql.Tx, s SqlDialect) error
func (*TokenInfos) GetByAccess ¶
func (t *TokenInfos) GetByAccess(c util.Context, tx *sql.Tx, access string) (oauth2.TokenInfo, error)
GetByAccess fetches tokens based on the access token.
func (*TokenInfos) GetByRefresh ¶
func (t *TokenInfos) GetByRefresh(c util.Context, tx *sql.Tx, refresh string) (oauth2.TokenInfo, error)
GetByRefresh fetches tokens based on the refresh token.
func (*TokenInfos) Prepare ¶
func (t *TokenInfos) Prepare(db *sql.DB, s SqlDialect) error
func (*TokenInfos) RemoveByAccess ¶
RemoveByAccess deletes the token information based on the access token.
func (*TokenInfos) RemoveByCode ¶
RemoveByCode deletes the token information based on the authorization code.
func (*TokenInfos) RemoveByRefresh ¶
RemoveByRefresh deletes the token information based on the refresh token.
type UnaryMatcher ¶
type UnaryMatcher struct { Not *UnaryMatcher `json:"not,omitempty"` And *BinaryMatcher `json:"and,omitempty"` Or *BinaryMatcher `json:"or,omitempty"` Value *Value `json:"value,omitempty"` Empty bool `json:"empty,omitempty"` }
func (UnaryMatcher) Match ¶
func (u UnaryMatcher) Match(res gjson.Result, json []byte, r *Resolution) (bool, error)
func (UnaryMatcher) Validate ¶
func (u UnaryMatcher) Validate() error
type User ¶
type User struct { ID string Email string Actor ActivityStreams Privileges Privileges Preferences Preferences }
type UserActivityStats ¶
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
Users is a Model that provides additional database methods for the Users type.
func (*Users) ActivityStats ¶
ActivityStats obtains statistics about the activity of users.
func (*Users) ActorIDForInbox ¶
ActorIDForOutbox returns the actor associated with the inbox.
func (*Users) ActorIDForOutbox ¶
func (u *Users) ActorIDForOutbox(c util.Context, tx *sql.Tx, outbox *url.URL) (actor URL, err error)
ActorIDForOutbox returns the actor associated with the outbox.
func (*Users) CreateTable ¶
func (u *Users) CreateTable(t *sql.Tx, s SqlDialect) error
func (*Users) InstanceActorPreferences ¶
func (u *Users) InstanceActorPreferences(c util.Context, tx *sql.Tx) (iap InstanceActorPreferences, err error)
InstanceActorPreferences fetches the Server's preferences from the instance actor.
func (*Users) InstanceActorUser ¶
InstanceActorUser returns the user representing the instance.
func (*Users) SensitiveUserByEmail ¶
func (u *Users) SensitiveUserByEmail(c util.Context, tx *sql.Tx, email string) (s *SensitiveUser, err error)
SensitiveUserByEmail returns the credentials for a given user's email.
func (*Users) SetInstanceActorPreferences ¶
func (u *Users) SetInstanceActorPreferences(c util.Context, tx *sql.Tx, iap InstanceActorPreferences) (err error)
SetInstanceActorPreferences sets the Server's preferences on the instance actor.
func (*Users) UpdateActor ¶
UpdateActor updates the Actor for the userID.
func (*Users) UpdatePreferences ¶
UpdatePreferences updates the preferences associated with the user.
func (*Users) UpdatePrivileges ¶
UpdatePrivileges updates the privileges associated with the user.
type Value ¶
type Value struct { JSONPath string `json:"jsonPath,omitempty"` EqualsString string `json:"equalsString,omitempty"` ContainsString string `json:"containsString,omitempty"` LenEquals *int `json:"lenEquals,omitempty"` LenGreater *int `json:"lenGreater,omitempty"` LenLess *int `json:"lenLess,omitempty"` }