views

package
v0.0.0-...-f7e652a Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2015 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

This package implements all the functions which will answer users' requests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AboutHandler

func AboutHandler(w http.ResponseWriter, req *http.Request)

Display the "About" page

func GetUserId

func GetUserId(req *http.Request) int64

Get the user's id if he is authenticated, 0 otherwise

func Login

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

Handle a login request

func MainPageHandler

func MainPageHandler(w http.ResponseWriter, req *http.Request)

Handle the homepage

func MediaThumbnailHandler

func MediaThumbnailHandler(w http.ResponseWriter, req *http.Request)

IMDB media proxy

func RedirectIfNotAdmin

func RedirectIfNotAdmin(w http.ResponseWriter, req *http.Request) bool

Check if the user has admin rights. If he is not authenticated, he will be redirected to the signin page If he is authenticated but without admin rights, a StatusForbidden code is set The function returns whether or not the user is unauthorized

func RedirectIfNotAuthenticated

func RedirectIfNotAuthenticated(w http.ResponseWriter, req *http.Request) bool

Check if the user is authenticated If he is not authenticated, he will be redirected to the signin page The function returns whether or not the user is unauthorized

func SignInHandler

func SignInHandler(w http.ResponseWriter, req *http.Request)

Display the sign in page

func Signout

func Signout(w http.ResponseWriter, req *http.Request)

Handle a sign out request

func Signup

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

Handle a sign up request

func StreamMedia

func StreamMedia(w http.ResponseWriter, req *http.Request)

Stream a media

func SubtitlesServerHandler

func SubtitlesServerHandler(w http.ResponseWriter, req *http.Request)

Serve subtitle files

func VideoDetailHandler

func VideoDetailHandler(w http.ResponseWriter, req *http.Request)

Return video informations

func VideoGetAllHandler

func VideoGetAllHandler(w http.ResponseWriter, req *http.Request)

Return a Json object with all the authorized videos

func VideoGetSubtitles

func VideoGetSubtitles(w http.ResponseWriter, req *http.Request)

Call the OpenSubtitles API

func VideoMenuHandler

func VideoMenuHandler(w http.ResponseWriter, req *http.Request)

Display the video homepage

Types

type About

type About struct {
	Appname             string
	Version             string
	Date                string
	Author              string
	Website             string
	IsUserAuthenticated bool
	IsUserAdmin         bool
	ViewName            string
}

type ViewInfo

type ViewInfo struct {
	IsUserAuthenticated bool
	IsUserAdmin         bool
	ViewName            string
}

Basic informations about the view to display and the user

func GetViewInfo

func GetViewInfo(req *http.Request, viewName string) ViewInfo

Fille a ViewInfo variable

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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