server

package
v0.0.0-...-388b6e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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

func (*AppRegistry) Register

func (appreg *AppRegistry) Register(ctx context.Context, serverAddr string, selfURL *url.URL) (*stpb.AppRegState, error)

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 New

func New(st *storage.Storage, sessionManager *scs.SessionManager, inviteCode string, autoLogin types.UID, selfURL *url.URL, appRegistry *AppRegistry) *Server

func (*Server) ConfigHandler

func (s *Server) ConfigHandler(w http.ResponseWriter, req *http.Request)

func (*Server) Fetch

func (*Server) List

func (*Server) Login

func (*Server) Logout

func (*Server) RedirectHandler

func (s *Server) RedirectHandler(w http.ResponseWriter, req *http.Request)

func (*Server) RegisterOn

func (s *Server) RegisterOn(mux *http.ServeMux)

func (*Server) Search

func (*Server) SetRead

func (*Server) Token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL