router

package
v0.0.0-...-16954e5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserIDSession = "user_id"
)

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, config *Config) (*mux.Router, error)

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) *responseWriter

Types

type App

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

App is the struct for the homepage or the user profile homepage

func (*App) GetObject

func (a *App) GetObject(w http.ResponseWriter, r *http.Request)

type Config

type Config struct {
	SessionKey, RedisAddr, RedisPassword, GmailEmail,
	GmailPassword, AccessSecret, MinioEndpoint, MinioUser, MinioPassword string
}

type UserLogin

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

UserLogin specific handler group for user interactions similar to app but differs in handling especially error

func (*UserLogin) Get

func (ul *UserLogin) Get(w http.ResponseWriter, r *http.Request)

Get should always redirect to "/" if the user is logged in otherwise go back to "/login" to relogin

func (*UserLogin) Post

func (u *UserLogin) Post(w http.ResponseWriter, r *http.Request)

type UserRegister

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

UserRegister this is created so that the error field has few accessors; not that unique to App

func (*UserRegister) Get

func (ur *UserRegister) Get(w http.ResponseWriter, r *http.Request)

Get should always redirect to "/" if the user is logged in otherwise go back to "/login" to relogin

func (*UserRegister) Post

func (ur *UserRegister) Post(w http.ResponseWriter, r *http.Request)

type UserSettings

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

UserSettings this is created so that the error field has few accessors; not that unique to App

func (*UserSettings) AcceptEmailVerif

func (us *UserSettings) AcceptEmailVerif(w http.ResponseWriter, r *http.Request)

func (*UserSettings) Get

func (us *UserSettings) Get(w http.ResponseWriter, r *http.Request)

func (*UserSettings) GetAccount

func (us *UserSettings) GetAccount(w http.ResponseWriter, r *http.Request)

func (*UserSettings) GetPrivacy

func (us *UserSettings) GetPrivacy(w http.ResponseWriter, r *http.Request)

func (*UserSettings) GetProfile

func (us *UserSettings) GetProfile(w http.ResponseWriter, r *http.Request)

func (*UserSettings) SetAccount

func (us *UserSettings) SetAccount(w http.ResponseWriter, r *http.Request)

func (*UserSettings) SetPrivacy

func (us *UserSettings) SetPrivacy(w http.ResponseWriter, r *http.Request)

func (*UserSettings) SetProfile

func (us *UserSettings) SetProfile(w http.ResponseWriter, r *http.Request)

func (*UserSettings) VerifyEmail

func (us *UserSettings) VerifyEmail(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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