Documentation ¶
Index ¶
- func InitSessionStore(secret string, db *gorm.DB, shouldCleanup bool) *gormstore.Store
- func Markdown(s string) template.HTML
- func NewRenderer(config RendererConfig) *echoview.ViewEngine
- type FileService
- type MenuService
- func (s *MenuService) Create(menu *models.Menu) error
- func (s *MenuService) CreateItem(menuItem *models.MenuItem) error
- func (s *MenuService) Delete(id uint) error
- func (s *MenuService) DeleteItem(id uint) error
- func (s *MenuService) Find(id uint) (models.Menu, error)
- func (s *MenuService) FindItem(id uint) (*models.MenuItem, error)
- func (s *MenuService) GetAll() (map[string]models.Menu, error)
- func (s *MenuService) GetAllForView() (*models.ViewMenus, error)
- func (s *MenuService) Update(menu *models.Menu) error
- func (s *MenuService) UpdateItem(menuItem *models.MenuItem) error
- type PostService
- type ProfileService
- type RendererConfig
- type Session
- func (s *Session) ClearAll() error
- func (s *Session) ClearValue(key interface{}) error
- func (s *Session) GetValue(key string) interface{}
- func (s *Session) LoggedIn() bool
- func (s *Session) Save() error
- func (s *Session) SetValue(key, value interface{}, shouldSave bool) error
- func (s *Session) UserID() int
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSessionStore ¶
InitSessionStore initializes the session storeage mechanism
func NewRenderer ¶
func NewRenderer(config RendererConfig) *echoview.ViewEngine
NewRenderer build and return a new renderer
Types ¶
type FileService ¶
FileService a service for managing files
func NewFileService ¶
func NewFileService(db *gorm.DB) *FileService
NewFileService returns a new file service
type MenuService ¶
MenuService a service to get the menus
func NewMenuService ¶
func NewMenuService(db *gorm.DB) *MenuService
NewMenuService returns a new menu service
func (*MenuService) Create ¶
func (s *MenuService) Create(menu *models.Menu) error
Create creates a menu
func (*MenuService) CreateItem ¶
func (s *MenuService) CreateItem(menuItem *models.MenuItem) error
CreateItem creates a menu item
func (*MenuService) DeleteItem ¶
func (s *MenuService) DeleteItem(id uint) error
DeleteItem delete's the menu item
func (*MenuService) Find ¶
func (s *MenuService) Find(id uint) (models.Menu, error)
Find attempts to find a menu and it's items by the menu id
func (*MenuService) FindItem ¶
func (s *MenuService) FindItem(id uint) (*models.MenuItem, error)
FindItem attempts to find a menu item by it's ID
func (*MenuService) GetAll ¶
func (s *MenuService) GetAll() (map[string]models.Menu, error)
GetAll get's all the menus
func (*MenuService) GetAllForView ¶
func (s *MenuService) GetAllForView() (*models.ViewMenus, error)
GetAllForView get's all menus in ViewMenus form
func (*MenuService) Update ¶
func (s *MenuService) Update(menu *models.Menu) error
Update updates a menu
func (*MenuService) UpdateItem ¶
func (s *MenuService) UpdateItem(menuItem *models.MenuItem) error
UpdateItem updates a menu item
type PostService ¶
PostService a service for getting, creating, and updating posts
func NewPostService ¶
func NewPostService(db *gorm.DB) *PostService
NewPostService builds a new PostService
func (*PostService) Create ¶
func (s *PostService) Create(post *models.Post) error
Create creates a new post in the database
func (*PostService) Delete ¶
func (s *PostService) Delete(post *models.Post) error
Delete delete's a post
func (*PostService) GetBySlug ¶
func (s *PostService) GetBySlug(slug string) (*models.Post, error)
GetBySlug attempts to get a post by slug
type ProfileService ¶
ProfileService a service to manage profiles
func NewProfileService ¶
func NewProfileService(db *gorm.DB) *ProfileService
NewProfileService returns a new ProfileService
func (*ProfileService) Create ¶
func (s *ProfileService) Create(profile *models.Profile) error
Create saves a new profile to the database
func (*ProfileService) GetByUserID ¶
func (s *ProfileService) GetByUserID(userID int) (*models.Profile, error)
GetByUserID gets a profile by user
type RendererConfig ¶
type RendererConfig struct { Root string `default:"views"` Extension string `default:".html"` Master string `default:"layouts/master"` Partials []string `required:"true"` DisableCache bool `default:"true"` }
RendererConfig configuration for our renderer
type Session ¶
Session a session that holds an internal session storage mechanism
func GetSession ¶
GetSession gets a session
func (*Session) ClearValue ¶
ClearValue clears a single value from the session
type UserService ¶
UserService a service to handle dealing with Users
func NewUserService ¶
func NewUserService(db *gorm.DB) *UserService
NewUserService returns a new UserService
func (*UserService) CheckPassword ¶
CheckPassword checks if a given password is correct for a user
func (*UserService) Create ¶
func (s *UserService) Create(user *models.User) error
Create creates a user using the given model
func (*UserService) GetByEmail ¶
func (s *UserService) GetByEmail(email string) (*models.User, error)
GetByEmail gets a user by email