admin

package
v0.0.0-...-1bc63cf Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: GPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blog

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

Blog ...

func BlogPost

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

BlogPost ...

func Categories

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

Categories ...

func Category

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

Category ...

func Course

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

Course ...

func Courses

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

Courses ...

func DeleteCategory

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

DeleteCategory ...

func DeleteCourse

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

DeleteCourse ...

func DeleteCourseInDB

func DeleteCourseInDB(db *sql.DB, slug string) error

DeleteCourseInDB ...

func DeleteModule

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

DeleteModule ...

func DeleteModuleInDB

func DeleteModuleInDB(db *sql.DB, slug string) error

DeleteModuleInDB ...

func DeleteQuestions

func DeleteQuestions(db *sql.DB, sessionID int) error

DeleteQuestions ...

func DeleteSession

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

DeleteSession ...

func DeleteSessionInDB

func DeleteSessionInDB(db *sql.DB, slug string) error

DeleteSessionInDB ...

func DropCategoryItems

func DropCategoryItems(db *sql.DB, categoryID int) error

DropCategoryItems ...

func DropToolbar

func DropToolbar(db *sql.DB) error

DropToolbar ...

func Files

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

Files ...

func FooterCategories

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

FooterCategories ...

func FooterCategory

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

FooterCategory ...

func GetCategoryIDFromName

func GetCategoryIDFromName(db *sql.DB, name string) (int, error)

GetCategoryIDFromName ...

func GetCourse

func GetCourse(db *sql.DB, slug string) (course.Course, error)

GetCourse ...

func GetCourseFromName

func GetCourseFromName(db *sql.DB, name string) (int, string, error)

GetCourseFromName ...

func GetCourses

func GetCourses(db *sql.DB) ([]course.Course, error)

GetCourses ...

func GetSessionBySlugs

func GetSessionBySlugs(db *sql.DB, course, module, session string) (string, int, int, error)

GetSessionBySlugs ...

func GetSessionText

func GetSessionText(db *sql.DB, sessionID int) (string, error)

GetSessionText ...

func GetSessionsYoutube

func GetSessionsYoutube(db *sql.DB, sessionID int) (string, string, error)

GetSessionsYoutube ...

func Group

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

Group ...

func Groups

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

Groups ...

func HandleSessionMultipleChoice

func HandleSessionMultipleChoice(w http.ResponseWriter, r *http.Request, db *sql.DB, name string, sessionID int)

HandleSessionMultipleChoice ...

func HandleSessionText

func HandleSessionText(w http.ResponseWriter, r *http.Request, db *sql.DB, name string, sessionID int)

HandleSessionText ...

func HandleSessionYoutube

func HandleSessionYoutube(w http.ResponseWriter, r *http.Request, db *sql.DB, name string, sessionID int)

HandleSessionYoutube ...

func Index

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

Index ...

func InsertAccessLog

func InsertAccessLog(db *sql.DB, accessTime time.Time, method, path, remoteAddress, userAgent string, speed int) error

InsertAccessLog ...

func InsertCourseInDB

func InsertCourseInDB(db *sql.DB, name, description string, categoryID int) (string, error)

InsertCourseInDB ...

func InsertMultipleChoiceOptionInDB

func InsertMultipleChoiceOptionInDB(db *sql.DB, option course.Option, questionID int64) error

InsertMultipleChoiceOptionInDB ...

func InsertMultipleChoiceQuestionInDB

func InsertMultipleChoiceQuestionInDB(db *sql.DB, questionText string, sessionID int) (int64, error)

InsertMultipleChoiceQuestionInDB ...

func InsertNewBlogPost

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

InsertNewBlogPost ...

func InsertNewBlogPostInDB

func InsertNewBlogPostInDB(db *sql.DB, title, text string) (string, error)

InsertNewBlogPostInDB ...

func InsertNewCategory

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

InsertNewCategory ...

func InsertNewCategoryInDB

func InsertNewCategoryInDB(db *sql.DB, name string) (string, error)

InsertNewCategoryInDB ...

func InsertNewCourse

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

InsertNewCourse ...

func InsertNewGroup

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

InsertNewGroup ...

func InsertNewGroupInDB

func InsertNewGroupInDB(db *sql.DB, name string) error

InsertNewGroupInDB ...

func InsertNewModule

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

InsertNewModule ...

func InsertNewModuleInDB

func InsertNewModuleInDB(db *sql.DB, name, description, course string) (string, error)

InsertNewModuleInDB ...

func InsertNewPage

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

InsertNewPage ...

func InsertNewPageInDB

func InsertNewPageInDB(db *sql.DB, title, text, slug string) error

InsertNewPageInDB ...

func InsertNewPodcastPost

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

InsertNewPodcastPost ...

func InsertNewPodcastPostInDB

func InsertNewPodcastPostInDB(db *sql.DB, title, text, file string) (string, error)

InsertNewPodcastPostInDB ...

func InsertNewSession

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

InsertNewSession ...

func InsertNewSessionInDB

func InsertNewSessionInDB(db *sql.DB, name string, moduleSlug string, sessionType int) (string, int64, error)

InsertNewSessionInDB ...

func InsertNewSessionTextInDB

func InsertNewSessionTextInDB(db *sql.DB, sessionID int64, text string) error

InsertNewSessionTextInDB ...

func InsertNewSessionYoutubeInDB

func InsertNewSessionYoutubeInDB(db *sql.DB, sessionID int64, text, youtube string) error

InsertNewSessionYoutubeInDB ...

func InsertNewSetting

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

InsertNewSetting ...

func InsertNewSettingInDB

func InsertNewSettingInDB(db *sql.DB, key, value string) error

InsertNewSettingInDB ...

func Module

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

Module ...

func NewBlogPost

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

NewBlogPost ...

func NewCategory

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

NewCategory ...

func NewCourse

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

NewCourse ...

func NewFile

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

NewFile ...

func NewGroup

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

NewGroup ...

func NewModule

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

NewModule ...

func NewPage

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

NewPage ...

func NewPodcastPost

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

NewPodcastPost ...

func NewSession

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

NewSession ...

func NewSetting

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

NewSetting ...

func Pages

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

Pages ...

func Podcast

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

Podcast ...

func PodcastPost

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

PodcastPost ...

func RemoveFile

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

RemoveFile ...

func Session

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

Session ...

func Setting

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

Setting ...

func Settings

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

Settings ...

func SingleFile

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

SingleFile ...

func SinglePage

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

SinglePage ...

func Ticket

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

Ticket ...

func Tickets

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

Tickets ...

func Toolbar

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

Toolbar ...

func UpdateBlogPost

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

UpdateBlogPost ...

func UpdateBlogPostInDB

func UpdateBlogPostInDB(db *sql.DB, title, text, slug string) error

UpdateBlogPostInDB ...

func UpdateCategory

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

UpdateCategory ...

func UpdateCategoryInDatabase

func UpdateCategoryInDatabase(db *sql.DB, newName string, slug string) error

UpdateCategoryInDatabase ...

func UpdateCategoryItems

func UpdateCategoryItems(db *sql.DB, categoryID int, value string) error

UpdateCategoryItems ...

func UpdateCourse

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

UpdateCourse ...

func UpdateCourseInDB

func UpdateCourseInDB(db *sql.DB, name, description, slug string, categoryID int) error

UpdateCourseInDB ...

func UpdateFooter

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

UpdateFooter ...

func UpdateGroup

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

UpdateGroup ...

func UpdateGroupInDB

func UpdateGroupInDB(db *sql.DB, newName, oldName string) error

UpdateGroupInDB ...

func UpdateModule

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

UpdateModule ...

func UpdateModuleInDB

func UpdateModuleInDB(db *sql.DB, name, description, slug string, courseID int) error

UpdateModuleInDB ...

func UpdateMultipleChoiceInDB

func UpdateMultipleChoiceInDB(db *sql.DB, questions []course.Question, sessionID int) error

UpdateMultipleChoiceInDB ...

func UpdatePage

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

UpdatePage ...

func UpdatePageInDB

func UpdatePageInDB(db *sql.DB, title, text, slug string) error

UpdatePageInDB ...

func UpdatePodcastPost

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

UpdatePodcastPost ...

func UpdatePodcastPostInDB

func UpdatePodcastPostInDB(db *sql.DB, title, text, file, slug string) error

UpdatePodcastPostInDB ...

func UpdateSession

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

UpdateSession ...

func UpdateSessionNameInDB

func UpdateSessionNameInDB(db *sql.DB, name string, id int) error

UpdateSessionNameInDB ...

func UpdateSessionTextInDB

func UpdateSessionTextInDB(db *sql.DB, text string, id int) error

UpdateSessionTextInDB ...

func UpdateSessionYoutubeInDB

func UpdateSessionYoutubeInDB(db *sql.DB, text, youtube string, id int) error

UpdateSessionYoutubeInDB ...

func UpdateSetting

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

UpdateSetting ...

func UpdateSettingWithName

func UpdateSettingWithName(db *sql.DB, name, value string) error

UpdateSettingWithName ...

func UpdateTicket

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

UpdateTicket ...

func UpdateToolbar

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

UpdateToolbar ...

func UpdateValue

func UpdateValue(db *sql.DB, value string) error

UpdateValue ...

func UploadNewFile

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

UploadNewFile ...

func User

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

User ...

func Users

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

Users ...

Types

type BlogPageData

type BlogPageData struct {
	Title         string
	Paths         []helpers.Path
	Posts         []blog.PostData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

BlogPageData ...

type BlogPostData

type BlogPostData struct {
	Title string
	Text  string
	Slug  string
}

BlogPostData ...

type BlogPostPageData

type BlogPostPageData struct {
	Title string
	Paths []helpers.Path
	Post  blog.PostData
}

BlogPostPageData ...

type CategoriesData

type CategoriesData struct {
	Title         string
	Paths         []helpers.Path
	Categories    []CategoryData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

CategoriesData ...

type CategoryData

type CategoryData struct {
	Name string
	Slug string
}

CategoryData ...

func GetCategories

func GetCategories(db *sql.DB) ([]CategoryData, error)

GetCategories ...

func GetCategory

func GetCategory(db *sql.DB, slug string) (CategoryData, error)

GetCategory ...

type CategoryPageData

type CategoryPageData struct {
	Title    string
	Paths    []helpers.Path
	Category CategoryData
}

CategoryPageData ...

type CoursePageData

type CoursePageData struct {
	Title         string
	Paths         []helpers.Path
	Course        course.Course
	Categories    []CategoryData
	Modules       []ModuleData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

CoursePageData ...

type CoursesPageData

type CoursesPageData struct {
	Title         string
	Paths         []helpers.Path
	Courses       []course.Course
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

CoursesPageData ...

type FilesPageData

type FilesPageData struct {
	Title         string
	Paths         []helpers.Path
	Files         []string
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

FilesPageData ...

type FooterCategoryData

type FooterCategoryData struct {
	Title string
	Slug  string
}

FooterCategoryData ...

func GetFooterCategories

func GetFooterCategories(db *sql.DB) ([]FooterCategoryData, error)

GetFooterCategories ...

func GetFooterCategory

func GetFooterCategory(db *sql.DB, slug string) (FooterCategoryData, int, error)

GetFooterCategory ...

type FooterCategoryPage

type FooterCategoryPage struct {
	Title         string
	Paths         []helpers.Path
	Category      FooterCategoryData
	ToolbarItems  []ToolbarData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

FooterCategoryPage ...

type FooterPage

type FooterPage struct {
	Title         string
	Paths         []helpers.Path
	Categories    []FooterCategoryData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

FooterPage ...

type GroupData

type GroupData struct {
	Name string
}

GroupData ...

func GetGroupByName

func GetGroupByName(db *sql.DB, name string) (GroupData, error)

GetGroupByName ...

func GetGroups

func GetGroups(db *sql.DB) ([]GroupData, error)

GetGroups ...

type GroupPageData

type GroupPageData struct {
	Title string
	Paths []helpers.Path
	Group GroupData
}

GroupPageData ...

type GroupUserData

type GroupUserData struct {
	Name         string
	UserIsMember bool
}

GroupUserData ...

func GetGroupsUserIsPartOf

func GetGroupsUserIsPartOf(db *sql.DB, username string) ([]GroupUserData, error)

GetGroupsUserIsPartOf ...

type GroupsData

type GroupsData struct {
	Title         string
	Paths         []helpers.Path
	Groups        []GroupData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

GroupsData ...

type IndexPageData

type IndexPageData struct {
	Title     string
	Paths     []helpers.Path
	PageViews int
	Errors    int
	Tickets   int
	Revenue   int
	Pages     []PageStats
}

IndexPageData ...

type ModuleData

type ModuleData struct {
	Name        string
	Description string
	Slug        string
	Course      string
}

ModuleData ...

func GetModuleAndCourseBySlug

func GetModuleAndCourseBySlug(db *sql.DB, slug string) (ModuleData, error)

GetModuleAndCourseBySlug ...

func GetModulesByCourseSlug

func GetModulesByCourseSlug(db *sql.DB, slug string) ([]ModuleData, error)

GetModulesByCourseSlug ...

type ModulePageData

type ModulePageData struct {
	Title         string
	Paths         []helpers.Path
	Module        ModuleData
	CourseSlug    string
	Courses       []course.Course
	Sessions      []SessionData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

ModulePageData ...

type NewCoursePage

type NewCoursePage struct {
	Title      string
	Paths      []helpers.Path
	Categories []CategoryData
}

NewCoursePage ...

type Page

type Page struct {
	Title string
	Paths []helpers.Path
}

Page ...

type PageData

type PageData struct {
	Title string
	Text  string
	Slug  string
}

PageData ...

func GetPage

func GetPage(db *sql.DB, slug string) (PageData, error)

GetPage ...

func GetPages

func GetPages(db *sql.DB) ([]PageData, error)

GetPages ...

type PageStats

type PageStats struct {
	Path  string
	Views int
	Speed int
}

PageStats ...

func GetPageStats

func GetPageStats(db *sql.DB) ([]PageStats, error)

GetPageStats ...

type PagesData

type PagesData struct {
	Title         string
	Paths         []helpers.Path
	Pages         []PageData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

PagesData ...

type PodcastPageData

type PodcastPageData struct {
	Title         string
	Paths         []helpers.Path
	Posts         []podcast.PostData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

PodcastPageData ...

type PodcastPostData

type PodcastPostData struct {
	Title string
	Text  string
	Slug  string
}

PodcastPostData ...

type PodcastPostPageData

type PodcastPostPageData struct {
	Title string
	Paths []helpers.Path
	Post  podcast.PostData
}

PodcastPostPageData ...

type SessionBody

type SessionBody struct {
	Name      string
	Questions []course.Question
}

SessionBody ...

type SessionData

type SessionData struct {
	Name string
	Slug string
}

SessionData ...

func GetSessionsByModuleSlug

func GetSessionsByModuleSlug(db *sql.DB, slug string) ([]SessionData, error)

GetSessionsByModuleSlug ...

type SessionMultipleChoice

type SessionMultipleChoice struct {
	Title     string
	Paths     []helpers.Path
	Name      string
	Questions []course.Question
}

SessionMultipleChoice ...

type SessionText

type SessionText struct {
	Title string
	Paths []helpers.Path
	Name  string
	Text  string
}

SessionText ...

type SessionYoutube

type SessionYoutube struct {
	Title   string
	Paths   []helpers.Path
	Name    string
	Text    string
	Youtube string
}

SessionYoutube ...

type SettingData

type SettingData struct {
	Name  string
	Value string
}

SettingData ...

func GetSettingFromName

func GetSettingFromName(db *sql.DB, name string) (SettingData, error)

GetSettingFromName ...

func GetSettings

func GetSettings(db *sql.DB) ([]SettingData, error)

GetSettings ...

type SettingPageData

type SettingPageData struct {
	Title  string
	Paths  []helpers.Path
	Option SettingData
}

SettingPageData ...

type SettingsData

type SettingsData struct {
	Title         string
	Paths         []helpers.Path
	Options       []SettingData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

SettingsData ...

type SinglePageData

type SinglePageData struct {
	Title string
	Paths []helpers.Path
	Page  PageData
}

SinglePageData ...

type TicketData

type TicketData struct {
	Title     string
	User      string
	Solved    bool
	Slug      string
	Responses []string
}

TicketData ...

func GetTicket

func GetTicket(db *sql.DB, slug string) (TicketData, error)

GetTicket ...

func GetTickets

func GetTickets(db *sql.DB) ([]TicketData, error)

GetTickets ...

type TicketPageData

type TicketPageData struct {
	Title  string
	Paths  []helpers.Path
	Ticket TicketData
}

TicketPageData ...

type TicketsPageData

type TicketsPageData struct {
	Title   string
	Paths   []helpers.Path
	Tickets []TicketData
}

TicketsPageData ...

type ToolbarData

type ToolbarData struct {
	Title  string
	Active bool
}

ToolbarData ...

func GetFooterItems

func GetFooterItems(db *sql.DB, footerID int) ([]ToolbarData, error)

GetFooterItems ...

func GetToolbar

func GetToolbar(db *sql.DB) ([]ToolbarData, error)

GetToolbar ...

type ToolbarPage

type ToolbarPage struct {
	Title         string
	Paths         []helpers.Path
	ToolbarItems  []ToolbarData
	NewItemButton bool
	NewItemText   string
	NewItemLink   string
}

ToolbarPage ...

type UserData

type UserData struct {
	Username string
	Email    string
}

UserData ...

func GetUserByUsername

func GetUserByUsername(db *sql.DB, username string) (UserData, error)

GetUserByUsername ...

func GetUsers

func GetUsers(db *sql.DB) ([]UserData, error)

GetUsers ...

type UserPageData

type UserPageData struct {
	Title  string
	Paths  []helpers.Path
	User   UserData
	Groups []GroupUserData
}

UserPageData ...

type UsersData

type UsersData struct {
	Title string
	Paths []helpers.Path
	Users []UserData
}

UsersData ...

Jump to

Keyboard shortcuts

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