Documentation ¶
Index ¶
- func AuthMiddleware[T any](auth Auth, next apiutil.Endpoint[T]) apiutil.Endpoint[*T]
- func NewPubblrRouter(cfg PubblrRouterConfig, baseRouter chi.Router) (chi.Router, error)
- func NewPubblrServer(config PubblrRouterConfig, baseRouter chi.Router) *http.Server
- type Auth
- type CreateAccountRequest
- type CreateAccountResponse
- type DB
- type LoginRequest
- type Middleware
- type PubblrRouter
- func (router *PubblrRouter) Create(create *activitystreams.Create) (activitystreams.ObjectIface, apiutil.Status)
- func (router *PubblrRouter) Deliver(activity activitystreams.ActivityIface)
- func (router *PubblrRouter) GetFollowers(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetFollowersPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetFollowing(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetFollowingPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetInbox(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetInboxItem(r *http.Request) (activitystreams.ActivityIface, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetInboxPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetLiked(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetLikedPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetObject(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetOutbox(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetOutboxActivity(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetOutboxPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetStream(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetStreamFollowers(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetStreamFollowersPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetStreamPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetStreams(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
- func (router *PubblrRouter) GetUser(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
- func (router *PubblrRouter) Login(r *http.Request) (string, http.Header, apiutil.Status)
- func (router *PubblrRouter) PostObject(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
- func (router *PubblrRouter) PostToInbox(r *http.Request) (*activitystreams.ActivityIface, http.Header, apiutil.Status)
- func (router *PubblrRouter) PostUser(r *http.Request) (*CreateAccountResponse, http.Header, apiutil.Status)
- type PubblrRouterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func NewPubblrRouter ¶
func NewPubblrServer ¶
func NewPubblrServer(config PubblrRouterConfig, baseRouter chi.Router) *http.Server
Types ¶
type CreateAccountRequest ¶
type CreateAccountRequest struct { Password string `json:"password"` Actor activitystreams.ActorIface `json:"actor"` }
type CreateAccountResponse ¶
type CreateAccountResponse struct { Actor activitystreams.ActorIface `json:"actor"` JWT string `json:"jwt"` }
type DB ¶
type DB interface { CreateObject(obj activitystreams.ObjectIface, user string, baseIdUrl url.URL) (activitystreams.ObjectIface, error) CreateInboxItem(item activitystreams.ActivityIface, user string) (activitystreams.ActivityIface, error) CreateOutboxItem(act activitystreams.ActivityIface, user string, baseIdUrl url.URL) (activitystreams.ActivityIface, error) GetOutboxItem(user, id string) (activitystreams.ActivityIface, error) GetInboxPage(user string, page, pageSize int) ([]activitystreams.ActivityIface, error) GetInboxCount(user string) (int, error) GetInboxItem(user, id string) (activitystreams.ActivityIface, error) GetOutboxPage(user string, page, pageSize int) ([]activitystreams.ActivityIface, error) GetOutboxCount(user string) (int, error) GetObject(user, typ, id string) (activitystreams.ObjectIface, error) CreateUser(user activitystreams.ActorIface, username, password string, baseIdUrl url.URL) (activitystreams.ActorIface, error) GetUser(username string) (activitystreams.ActorIface, error) CheckPassword(username, password string) error }
type LoginRequest ¶
type Middleware ¶
func SetContentType ¶
func SetContentType(contentType string) Middleware
type PubblrRouter ¶
type PubblrRouter struct { chi.Router Database DB Logger apiutil.Logger Auth Auth // contains filtered or unexported fields }
func (*PubblrRouter) Create ¶
func (router *PubblrRouter) Create(create *activitystreams.Create) (activitystreams.ObjectIface, apiutil.Status)
func (*PubblrRouter) Deliver ¶
func (router *PubblrRouter) Deliver(activity activitystreams.ActivityIface)
func (*PubblrRouter) GetFollowers ¶
func (router *PubblrRouter) GetFollowers(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
func (*PubblrRouter) GetFollowersPage ¶
func (router *PubblrRouter) GetFollowersPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
func (*PubblrRouter) GetFollowing ¶
func (router *PubblrRouter) GetFollowing(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
func (*PubblrRouter) GetFollowingPage ¶
func (router *PubblrRouter) GetFollowingPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
func (*PubblrRouter) GetInbox ¶
func (router *PubblrRouter) GetInbox(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
func (*PubblrRouter) GetInboxItem ¶
func (router *PubblrRouter) GetInboxItem(r *http.Request) (activitystreams.ActivityIface, http.Header, apiutil.Status)
func (*PubblrRouter) GetInboxPage ¶
func (router *PubblrRouter) GetInboxPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
func (*PubblrRouter) GetLiked ¶
func (router *PubblrRouter) GetLiked(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
func (*PubblrRouter) GetLikedPage ¶
func (router *PubblrRouter) GetLikedPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
func (*PubblrRouter) GetObject ¶
func (router *PubblrRouter) GetObject(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
func (*PubblrRouter) GetOutbox ¶
func (router *PubblrRouter) GetOutbox(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
OUTBOX
func (*PubblrRouter) GetOutboxActivity ¶
func (router *PubblrRouter) GetOutboxActivity(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
func (*PubblrRouter) GetOutboxPage ¶
func (router *PubblrRouter) GetOutboxPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
func (*PubblrRouter) GetStream ¶
func (router *PubblrRouter) GetStream(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
func (*PubblrRouter) GetStreamFollowers ¶
func (router *PubblrRouter) GetStreamFollowers(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
func (*PubblrRouter) GetStreamFollowersPage ¶
func (router *PubblrRouter) GetStreamFollowersPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
func (*PubblrRouter) GetStreamPage ¶
func (router *PubblrRouter) GetStreamPage(r *http.Request) (*activitystreams.CollectionPage, http.Header, apiutil.Status)
func (*PubblrRouter) GetStreams ¶
func (router *PubblrRouter) GetStreams(r *http.Request) (*activitystreams.Collection, http.Header, apiutil.Status)
func (*PubblrRouter) GetUser ¶
func (router *PubblrRouter) GetUser(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
func (*PubblrRouter) PostObject ¶
func (router *PubblrRouter) PostObject(r *http.Request) (activitystreams.ObjectIface, http.Header, apiutil.Status)
func (*PubblrRouter) PostToInbox ¶
func (router *PubblrRouter) PostToInbox(r *http.Request) (*activitystreams.ActivityIface, http.Header, apiutil.Status)
func (*PubblrRouter) PostUser ¶
func (router *PubblrRouter) PostUser(r *http.Request) (*CreateAccountResponse, http.Header, apiutil.Status)
type PubblrRouterConfig ¶
type PubblrRouterConfig struct { MountPath string `json:"mountPath"` Database database.PubblrDatabaseConfig `json:"database"` Logger logging.PubblrLoggerConfig `json:"logger"` Auth auth.AuthConfig `json:"auth"` Host string `json:"host"` Port int `json:"port"` PageSize int `json:"pageSize"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.