handler

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticator

func Authenticator(next http.Handler) http.Handler

func ChangeSessionRole

func ChangeSessionRole(w http.ResponseWriter, r *http.Request)

func HandlerWithHeaders

func HandlerWithHeaders(
	title, endpoint string,
	fetcherHeaders, uiHeaders map[string]string,
) http.HandlerFunc

HandlerWithHeaders sets up the playground. fetcherHeaders are used by the playground's fetcher instance and will not be visible in the UI. uiHeaders are default headers that will show up in the UI headers editor.

func Login

func Login(w http.ResponseWriter, r *http.Request)

TODO: 1. sanitize error messages; 2. move to api; 3. add logs;

func Playground

func Playground(title, endpoint string) http.HandlerFunc

Handler responsible for setting up the playground

func Signup

func Signup(w http.ResponseWriter, r *http.Request)

TODO: 1. sanitize error messages; 2. move to api; 3. add logs;

Types

type ChangeSessionRoleRequest

type ChangeSessionRoleRequest struct {
	Role string
}

type LoginFormData

type LoginFormData struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type SignupFormData

type SignupFormData struct {
	Email     string `json:"email"`
	Password  string `json:"password"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

type User

type User interface {
	DefaultRole(ctx context.Context) (*ent.Role, error)
}

Jump to

Keyboard shortcuts

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