handler

package
v0.0.0-...-8ed6344 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: GPL-3.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(mf *multipart.File, fname string)

func CreateFiles

func CreateFiles(mf *multipart.File, fname string)

func (ph *PostsHandler) PostNew(w http.ResponseWriter, r *http.Request) {

func (ph *PostsHandler) choseParty(w http.ResponseWriter, r *http.Request) {

	if r.Method == http.MethodPost {
		pst := entities.Post{}
		pst.Name = r.FormValue("name")
		pst.Writer = r.FormValue("writer")
		pst.Disc = r.FormValue("description")

		mf, fh, err := r.FormFile("vid")
		if err != nil {
			panic(err)
		}
		defer mf.Close()

		pst.Vid = fh.Filename

		CreateFiles(&mf, fh.Filename)
		log.Print(pst)

		_, errs := ph.pstServ.StorePost(&pst)
		if errs != nil {
			panic(errs)
		}

		http.Redirect(w, r, "/posts", http.StatusSeeOther)
	} else {
		ph.tmpl.ExecuteTemplate(w, "upload.post", nil)
	}
}

Types

type AdminPartiesHandler

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

func (*AdminPartiesHandler) AdminParties

func (ph *AdminPartiesHandler) AdminParties(w http.ResponseWriter, r *http.Request)

func (*AdminPartiesHandler) AdminPartiesDelete

func (ph *AdminPartiesHandler) AdminPartiesDelete(w http.ResponseWriter, r *http.Request)

func (*AdminPartiesHandler) AdminPartiesUpdate

func (ph *AdminPartiesHandler) AdminPartiesUpdate(w http.ResponseWriter, r *http.Request)

func (*AdminPartiesHandler) Parties

func (ph *AdminPartiesHandler) Parties(w http.ResponseWriter, r *http.Request)

func (*AdminPartiesHandler) PartiesNew

func (ph *AdminPartiesHandler) PartiesNew(w http.ResponseWriter, r *http.Request)

type AdminPostsHandler

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

func NewAdminPostHandler

func NewAdminPostHandler(T *template.Template, PS post.PostService, csKey []byte) *AdminPostsHandler

func (*AdminPostsHandler) AdminPostDelete

func (ph *AdminPostsHandler) AdminPostDelete(w http.ResponseWriter, r *http.Request)

func (*AdminPostsHandler) AdminPostsUpdate

func (ph *AdminPostsHandler) AdminPostsUpdate(w http.ResponseWriter, r *http.Request)

func (*AdminPostsHandler) PostNew

func (ph *AdminPostsHandler) PostNew(w http.ResponseWriter, r *http.Request)

func (*AdminPostsHandler) Posts

type EventHandler

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

func NewEventHandler

func NewEventHandler(T *template.Template, ES Event.EventService) *EventHandler

func (*EventHandler) DeleteEvents

func (eh *EventHandler) DeleteEvents(w http.ResponseWriter, r *http.Request)

func (*EventHandler) EventNew

func (ph *EventHandler) EventNew(w http.ResponseWriter, r *http.Request)

func (*EventHandler) Events

func (ph *EventHandler) Events(w http.ResponseWriter, r *http.Request)

func (*EventHandler) UpdateEvents

func (eh *EventHandler) UpdateEvents(w http.ResponseWriter, r *http.Request)

type PartiesHandler

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

type PostsHandler

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

func NewPostHandler

func NewPostHandler(T *template.Template, PS post.PostService) *PostsHandler

func (*PostsHandler) Posts

func (ph *PostsHandler) Posts(w http.ResponseWriter, r *http.Request)

type VoterHandler

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

func NewVoterHandler

func NewVoterHandler(T *template.Template, AS voters.VotersService,
	sessServ voters.SessionService,
	role voters.RoleService, vtrsess *entities.Session, csKye []byte) *VoterHandler

func (*VoterHandler) AdminUsers

func (uh *VoterHandler) AdminUsers(w http.ResponseWriter, r *http.Request)

func (*VoterHandler) AdminUsersDelete

func (uh *VoterHandler) AdminUsersDelete(w http.ResponseWriter, r *http.Request)

func (*VoterHandler) AdminUsersNew

func (uh *VoterHandler) AdminUsersNew(w http.ResponseWriter, r *http.Request)

func (*VoterHandler) AdminUsersUpdate

func (uh *VoterHandler) AdminUsersUpdate(w http.ResponseWriter, r *http.Request)

func (*VoterHandler) Authenticated

func (uh *VoterHandler) Authenticated(next http.Handler) http.Handler

func (*VoterHandler) Authorized

func (uh *VoterHandler) Authorized(next http.Handler) http.Handler

func (*VoterHandler) Login

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

func (*VoterHandler) Logout

func (uh *VoterHandler) Logout(w http.ResponseWriter, r *http.Request)

func (*VoterHandler) Register4Event

func (uh *VoterHandler) Register4Event(w http.ResponseWriter, r *http.Request)

func (*VoterHandler) Signup

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

func (*VoterHandler) Vote

func (uh *VoterHandler) Vote(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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