Documentation
¶
Index ¶
- Constants
- func NewSessionManager(st *storage.Storage) *scs.SessionManager
- type AppRegistry
- type MastopoofConfig
- type Server
- func (s *Server) Authorize(ctx context.Context, req *connect.Request[pb.AuthorizeRequest]) (*connect.Response[pb.AuthorizeResponse], error)
- func (s *Server) ConfigHandler(w http.ResponseWriter, req *http.Request)
- func (s *Server) Fetch(ctx context.Context, req *connect.Request[pb.FetchRequest]) (*connect.Response[pb.FetchResponse], error)
- func (s *Server) List(ctx context.Context, req *connect.Request[pb.ListRequest]) (*connect.Response[pb.ListResponse], error)
- func (s *Server) Login(ctx context.Context, req *connect.Request[pb.LoginRequest]) (*connect.Response[pb.LoginResponse], error)
- func (s *Server) Logout(ctx context.Context, req *connect.Request[pb.LogoutRequest]) (*connect.Response[pb.LogoutResponse], error)
- func (s *Server) RedirectHandler(w http.ResponseWriter, req *http.Request)
- func (s *Server) RegisterOn(mux *http.ServeMux)
- func (s *Server) Search(ctx context.Context, req *connect.Request[pb.SearchRequest]) (*connect.Response[pb.SearchResponse], error)
- func (s *Server) SetRead(ctx context.Context, req *connect.Request[pb.SetReadRequest]) (*connect.Response[pb.SetReadResponse], error)
- func (s *Server) SetStatus(ctx context.Context, req *connect.Request[pb.SetStatusRequest]) (*connect.Response[pb.SetStatusResponse], error)
- func (s *Server) Token(ctx context.Context, req *connect.Request[pb.TokenRequest]) (*connect.Response[pb.TokenResponse], error)
- func (s *Server) UpdateSettings(ctx context.Context, req *connect.Request[pb.UpdateSettingsRequest]) (*connect.Response[pb.UpdateSettingsResponse], error)
Constants ¶
View Source
const AppMastodonScopes = "read write push"
View Source
const OutOfBandURI = "urn:ietf:wg:oauth:2.0:oob"
URI to use in oauth to indicate that no redirection should happen but instead the user should copy/paste the auth code explictly.
Variables ¶
This section is empty.
Functions ¶
func NewSessionManager ¶
func NewSessionManager(st *storage.Storage) *scs.SessionManager
Types ¶
type AppRegistry ¶
type AppRegistry struct {
// contains filtered or unexported fields
}
AppRegistry manages app registration on Mastodon servers mastodon clients.
func NewAppRegistry ¶
func NewAppRegistry(st *storage.Storage) *AppRegistry
func (*AppRegistry) MastodonClient ¶
func (appreg *AppRegistry) MastodonClient(appRegState *stpb.AppRegState, accessToken string) *mastodon.Client
type MastopoofConfig ¶
type MastopoofConfig struct {
Src string `json:"src"`
DefServer string `json:"defServer"`
Invite bool `json:"invite"`
}
MastopoofConfig is data that is being sent upfront to the frontend. See common.ts for more details.
type Server ¶
type Server struct {
// Config to send to the frontend.
// Do not modify once it is serving.
FrontendConfig MastopoofConfig
// contains filtered or unexported fields
}
func (*Server) ConfigHandler ¶
func (s *Server) ConfigHandler(w http.ResponseWriter, req *http.Request)
func (*Server) RedirectHandler ¶
func (s *Server) RedirectHandler(w http.ResponseWriter, req *http.Request)
func (*Server) RegisterOn ¶
func (*Server) UpdateSettings ¶
Click to show internal directories.
Click to hide internal directories.