Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/davecheney/pub
/ functions
Functions
422 in github.com/davecheney/pub
⨍
Functions
422
◇
Types & classes
121
↓ 94 callers
Function
Error
Error is a convenience function for returning an error with an associated HTTP status code.
internal/httpx/handler.go:15
↓ 85 callers
Function
HandlerFunc
HandlerFunc adapts a function that returns an error to an http.HandlerFunc.
internal/httpx/handler.go:40
↓ 80 callers
Function
JSON
JSON writes the given object to the response body as JSON. If obj is a nil slice, an empty JSON array is written. If obj is a nil map, an empty JSON o
internal/to/json.go:16
↓ 54 callers
Method
authenticate
authenticate authenticates the bearer token attached to the request and, if successful, returns the account associated with the token.
mastodon/mastodon.go:33
↓ 42 callers
Function
Map
Map applies the function f to each element of the slice and returns a new slice containing the results.
internal/algorithms/algorithms.go:5
↓ 39 callers
Method
URI
()
models/actor.go:130
↓ 36 callers
Method
Find
Find finds an account by its name and domain.
models/actor.go:236
↓ 33 callers
Method
Run
(ctx *Context)
serve.go:41
↓ 27 callers
Method
Post
Post posts the given ActivityPub object to the given URL.
internal/activitypub/client.go:77
↓ 23 callers
Method
Create
(actor *Actor, parent *Status, visibility Visibility, sensitive bool, spoilterText, language, note string)
models/status.go:338
↓ 21 callers
Function
NewActors
(db *gorm.DB)
models/actor.go:231
↓ 17 callers
Method
FindByURI
FindByURI returns an account by its URI if it exists locally.
models/actor.go:242
↓ 17 callers
Function
MockActor
MockActor creates a new actor in the database.
models/models_test.go:24
↓ 16 callers
Method
Header
()
models/actor.go:102
↓ 16 callers
Function
NewRelationships
(db *gorm.DB)
models/relationship.go:134
↓ 15 callers
Function
linkHeader
(w http.ResponseWriter, r *http.Request, newest, oldest snowflake.ID)
mastodon/mastodon.go:55
↓ 14 callers
Function
NewReactions
(db *gorm.DB)
models/reaction.go:120
↓ 13 callers
Method
Error
(ctx context.Context, msg string, data ...interface{})
main.go:83
↓ 13 callers
Method
String
()
internal/webfinger/webfinger.go:39
↓ 11 callers
Function
Params
Params decodes the request parameters of a POST request into the given struct based on the Content-Type header. It returns an error if the Content-Typ
internal/httpx/params.go:17
↓ 11 callers
Method
Status
(st *models.Status)
mastodon/serialisers.go:224
↓ 11 callers
Function
stringFromAny
(v any)
activitypub/activitypub.go:93
↓ 10 callers
Function
NewStatuses
(db *gorm.DB)
models/status.go:281
↓ 10 callers
Function
Now
Now returns the current time as a Snowflake ID.
internal/snowflake/id.go:30
↓ 9 callers
Method
Account
(a *models.Actor)
mastodon/serialisers.go:69
↓ 9 callers
Method
ToTime
ToTime converts a Snowflake ID to a time.Time.
internal/snowflake/id.go:25
↓ 9 callers
Method
UnmarshalJSON
(data []byte)
mastodon/types.go:14
↓ 8 callers
Method
FindOrCreateByURI
(uri string)
models/actor.go:253
↓ 8 callers
Function
NewAccounts
(db *gorm.DB)
models/account.go:99
↓ 8 callers
Function
PaginateStatuses
(r *http.Request)
models/pagination.go:125
↓ 8 callers
Method
WriteHeader
(int)
internal/to/json_test.go:22
↓ 8 callers
Method
findOrCreate
(actor, target *Actor)
models/relationship.go:249
↓ 8 callers
Function
findOrCreateReaction
(tx *gorm.DB, status *Status, actor *Actor)
models/reaction.go:233
↓ 8 callers
Function
forEach
forEach runs each function in the slice within the supplied transaction.
models/models.go:8
↓ 7 callers
Method
Info
(ctx context.Context, msg string, data ...interface{})
main.go:75
↓ 7 callers
Method
Relationship
(rel *models.Relationship)
mastodon/serialisers.go:172
↓ 7 callers
Method
URL
()
models/actor.go:223
↓ 7 callers
Function
sortStatuses
sortStatuses sorts the statuses by their ID, in descending order.
mastodon/mastodon.go:67
↓ 6 callers
Function
MockInstance
(t *testing.T, tx *gorm.DB, domain string)
models/models_test.go:65
↓ 6 callers
Function
MockStatus
(t *testing.T, tx *gorm.DB, actor *Actor, note string)
models/models_test.go:46
↓ 6 callers
Method
Name
()
models/account.go:32
↓ 6 callers
Function
NewInstances
(db *gorm.DB)
models/instance.go:42
↓ 6 callers
Function
PreloadReaction
PreloadReaction preloads all of a Reaction's relations and associations.
models/status.go:396
↓ 5 callers
Function
Filter
Filter returns a new slice containing all elements of the slice that satisfy the predicate function.
internal/algorithms/algorithms.go:14
↓ 5 callers
Method
Follow
Follow establishes a follow relationship between actor and the target.
models/relationship.go:203
↓ 5 callers
Method
ID
ID returns the URL for the ID resource for this Acct.
internal/webfinger/webfinger.go:49
↓ 5 callers
Function
NewClient
NewClient returns a new ActivityPub client.
internal/activitypub/client.go:44
↓ 5 callers
Function
Parse
(s string)
internal/snowflake/id.go:34
↓ 5 callers
Function
setupTestDB
(t *testing.T)
models/models_test.go:74
↓ 5 callers
Function
stringOrDefault
(s string, def string)
mastodon/mastodon.go:59
↓ 5 callers
Method
urlFor
(path string)
mastodon/serialisers.go:321
↓ 4 callers
Method
Favourite
(status *Status, actor *Actor)
models/reaction.go:142
↓ 4 callers
Method
Fetch
(ctx context.Context)
internal/webfinger/webfinger.go:83
↓ 4 callers
Method
FindByDomain
FindByDomain finds an instance by domain.
models/instance.go:47
↓ 4 callers
Method
Header
()
internal/to/json_test.go:18
↓ 4 callers
Method
Inbox
Inbox returns the actor's inbox URL, or shared inbox URL if applicable.
models/actor.go:83
↓ 4 callers
Method
Note
()
models/actor.go:126
↓ 4 callers
Function
PaginateRelationship
(r *http.Request)
models/pagination.go:92
↓ 4 callers
Function
anyToSlice
(v any)
activitypub/activitypub.go:125
↓ 4 callers
Method
pair
pair returns the pair of Relationships between actor and target.
models/relationship.go:237
↓ 4 callers
Function
publishedAndUpdated
publishedAndUpdated returns the published and updated times for the given object. If the object does not have a published time, an error is returned.
activitypub/inbox.go:286
↓ 3 callers
Method
AccountForActor
(actor *Actor)
models/account.go:103
↓ 3 callers
Function
AllTables
AllTables returns a slice of all tables in the database.
models/automigrate.go:4
↓ 3 callers
Method
Avatar
()
models/actor.go:94
↓ 3 callers
Method
FindByID
(id snowflake.ID)
models/status.go:332
↓ 3 callers
Function
GenerateRSAKeypair
()
internal/crypto/crypto.go:18
↓ 3 callers
Function
PaginateActors
pagination support for the Mastodon API.
models/pagination.go:12
↓ 3 callers
Method
PublicKeyID
()
internal/activitypub/client.go:39
↓ 3 callers
Method
Refresh
Refesh schedules a refresh of an actor's data.
models/actor.go:278
↓ 3 callers
Function
Sign
Sign signs the request using the given keyID and privateKey.
internal/httpsig/sign.go:25
↓ 3 callers
Function
TimeToID
TODO implement ID MarshalJSON and UnmarshalJSON methods. TimeToID converts a time.Time to a Snowflake ID.
internal/snowflake/id.go:16
↓ 3 callers
Method
Unfollow
Unfollow removes a follow relationship between actor and the target.
models/relationship.go:220
↓ 3 callers
Method
WebPushSubscription
(sub *models.PushSubscription)
mastodon/serialisers.go:684
↓ 3 callers
Method
createObject
(props map[string]any)
activitypub/inbox.go:264
↓ 3 callers
Method
mediaOriginalURL
(att *models.Attachment)
mastodon/serialisers.go:613
↓ 3 callers
Function
parseBool
parseBool parses a boolean value from a request parameter. If the parameter is not present, it returns false. If the parameter is present but cannot b
models/actor.go:354
↓ 3 callers
Function
process
process makes one pass through the objects matching the scope, calling fn for each one. If fn returns an error, the object is updated with the error a
workers/processor.go:12
↓ 3 callers
Function
rules
(i *models.Instance)
mastodon/instances.go:143
↓ 3 callers
Function
stream
Preview returns a preview of the attachment in the format requested by the file extension in the URL. func Preview(env *models.Env, w http.ResponseWri
media/proxy.go:95
↓ 3 callers
Function
stringFromAny
(v any)
models/object.go:253
↓ 3 callers
Method
validateSignature
()
activitypub/inbox.go:441
↓ 2 callers
Method
Acct
func (a *Actor) maybeScheduleRefresh(tx *gorm.DB) error { if !a.needsRefresh() { return nil } fmt.Println("scheduling refresh for", a.URI()) ret
models/actor.go:174
↓ 2 callers
Method
Bookmark
(status *Status, actor *Actor)
models/reaction.go:162
↓ 2 callers
Method
Cancel
()
internal/streaming/streaming.go:64
↓ 2 callers
Method
Error
Allows StatusError to satisfy the error interface.
internal/httpx/handler.go:26
↓ 2 callers
Method
Fetch
Fetch fetches the ActivityPub resource at the given URL and decodes it into the given object.
internal/activitypub/client.go:56
↓ 2 callers
Method
FindByURI
(uri string)
models/status.go:321
↓ 2 callers
Function
Follow
(actor, object *models.Actor)
activitypub/activities/activities.go:13
↓ 2 callers
Method
IsLocal
IsLocal indicates whether the actor is local to the instance.
models/actor.go:190
↓ 2 callers
Method
Language
()
models/status.go:131
↓ 2 callers
Function
Like
(actor *models.Actor, object string)
activitypub/activities/activities.go:22
↓ 2 callers
Method
List
(l *models.AccountList)
mastodon/serialisers.go:406
↓ 2 callers
Method
Locked
()
models/actor.go:110
↓ 2 callers
Method
LogMode
(level logger.LogLevel)
main.go:71
↓ 2 callers
Function
Parse
(query string)
internal/webfinger/webfinger.go:89
↓ 2 callers
Function
ParseRSAPrivateKey
ParseRSAPrivateKey parses a PEM encoded private key, and returns the public key and private key.
internal/crypto/crypto.go:47
↓ 2 callers
Method
Pin
(status *Status, actor *Actor)
models/reaction.go:124
↓ 2 callers
Method
PublicKey
()
models/actor.go:122
↓ 2 callers
Method
Reblog
Reblog creates a new status that is a reblog of the given status.
models/reaction.go:181
↓ 2 callers
Function
Reverse
Reverse reverses the order of the elements in the slice.
internal/algorithms/algorithms.go:36
next →
1–100 of 422, ranked by callers