server

package
v0.0.0-...-51943a4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionDuration = 4 * 24 * time.Hour
	OAuth2TokenURL  = "https://discord.com/api/v10/oauth2/token"

	DevRedirectURI  = "http://localhost:3000/login"
	ProdRedirectURI = "https://www.emojihunt.org/login"

	CookieName = "session"
)

Variables

This section is empty.

Functions

func SetChangeIDHeader

func SetChangeIDHeader(c echo.Context, id int64)

func Start

func Start(ctx context.Context, prod bool, ably *ably.Realtime,
	discord *discord.Client, state *state.Client, sync *sync.Client)

Types

type AuthenticateParams

type AuthenticateParams struct {
	Code string `form:"code"`
}

type AuthenticateResponse

type AuthenticateResponse struct {
	Username string `json:"username"`
}

type DiscoveryParams

type DiscoveryParams struct {
	PuzzlesURL         string `form:"puzzles_url"`
	CookieName         string `form:"cookie_name"`
	CookieValue        string `form:"cookie_value"`
	GroupMode          bool   `form:"group_mode"`
	GroupSelector      string `form:"group_selector"`
	RoundNameSelector  string `form:"round_name_selector"`
	PuzzleListSelector string `form:"puzzle_list_selector"`
	PuzzleItemSelector string `form:"puzzle_item_selector"`
	WebsocketURL       string `form:"websocket_url"`
	WebsocketToken     string `form:"websocket_token"`
}

type IDParams

type IDParams struct {
	ID int64 `param:"id"`
}

type PuzzleParams

type PuzzleParams struct {
	ID             int64         `param:"id"`
	Name           string        `form:"name"`
	Answer         string        `form:"answer"`
	Round          int64         `form:"round"`
	Status         status.Status `form:"status"`
	Note           string        `form:"note"`
	Location       string        `form:"location"`
	PuzzleURL      string        `form:"puzzle_url"`
	SpreadsheetID  string        `form:"spreadsheet_id"`
	DiscordChannel string        `form:"discord_channel"`
	Meta           bool          `form:"meta"`
	VoiceRoom      string        `form:"voice_room"`
	Reminder       time.Time     `form:"reminder"`
}

type RoundParams

type RoundParams struct {
	ID              int64  `param:"id"`
	Name            string `form:"name"`
	Emoji           string `form:"emoji"`
	Hue             int64  `form:"hue"`
	Sort            int64  `form:"sort"`
	Special         bool   `form:"special"`
	DriveFolder     string `form:"drive_folder"`
	DiscordCategory string `form:"discord_category"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) Authenticate

func (s *Server) Authenticate(c echo.Context) error

func (*Server) AuthenticationMiddleware

func (s *Server) AuthenticationMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func (*Server) CreatePuzzle

func (s *Server) CreatePuzzle(c echo.Context) error

func (*Server) CreateRound

func (s *Server) CreateRound(c echo.Context) error

func (*Server) DeletePuzzle

func (s *Server) DeletePuzzle(c echo.Context) error

func (*Server) DeleteRound

func (s *Server) DeleteRound(c echo.Context) error

func (*Server) ErrorHandler

func (s *Server) ErrorHandler(err error, c echo.Context)

func (*Server) GetDiscovery

func (s *Server) GetDiscovery(c echo.Context) error

func (*Server) GetPuzzle

func (s *Server) GetPuzzle(c echo.Context) error

func (*Server) GetRound

func (s *Server) GetRound(c echo.Context) error

func (*Server) ListHome

func (s *Server) ListHome(c echo.Context) error

func (*Server) ListPuzzles

func (s *Server) ListPuzzles(c echo.Context) error

func (*Server) ListRounds

func (s *Server) ListRounds(c echo.Context) error

func (*Server) RequestAblyToken

func (s *Server) RequestAblyToken(c echo.Context) error

func (*Server) SentryMiddleware

func (s *Server) SentryMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func (*Server) TestDiscovery

func (s *Server) TestDiscovery(c echo.Context) error

func (*Server) UpdateDiscovery

func (s *Server) UpdateDiscovery(c echo.Context) error

func (*Server) UpdatePuzzle

func (s *Server) UpdatePuzzle(c echo.Context) error

func (*Server) UpdateRound

func (s *Server) UpdateRound(c echo.Context) error

Jump to

Keyboard shortcuts

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