puzzleweb

package
v1.11.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionName = "Session"
)

Variables

This section is empty.

Functions

func CreateTemplate

func CreateTemplate(redirecter common.TemplateRedirecter) gin.HandlerFunc

func GetLocalesManager

func GetLocalesManager(c *gin.Context) common.LocalesManager

func GetLogger

func GetLogger(c *gin.Context) log.Logger

func GetRequestedUserId

func GetRequestedUserId(c *gin.Context) uint64

func GetSessionUserId

func GetSessionUserId(c *gin.Context) uint64

func InitNoELementMsg

func InitNoELementMsg(data gin.H, size int, c *gin.Context)

func Run

func Run(ginLogger *zap.Logger, sites ...SiteAndConfig) error

Types

type GroupDisplay

type GroupDisplay struct {
	Id           uint64
	Name         string
	DisplayName  string
	Roles        []RoleDisplay
	AddableRoles []RoleDisplay
}

func NewGroupDisplay

func NewGroupDisplay(id uint64, name string) *GroupDisplay

type Page

type Page struct {
	Widget Widget
	// contains filtered or unexported fields
}

func MakeHiddenPage

func MakeHiddenPage(name string) Page

func MakeHiddenStaticPage

func MakeHiddenStaticPage(name string, groupId uint64, templateName string) Page

func MakePage

func MakePage(name string) Page

func MakeStaticPage

func MakeStaticPage(name string, groupId uint64, templateName string) Page

func (Page) AddStaticPages

func (p Page) AddStaticPages(pageGroup parser.StaticPagesConfig) bool

func (Page) AddSubPage

func (p Page) AddSubPage(page Page) bool

func (Page) GetSubPage

func (p Page) GetSubPage(name string) (Page, bool)

func (Page) GetSubPageWithPath

func (p Page) GetSubPageWithPath(path string) (Page, bool)

type PageDesc

type PageDesc struct {
	Name string
	Url  string
}

type RoleDisplay

type RoleDisplay struct {
	Name    string
	Actions []string
}

func MakeRoleDisplay

func MakeRoleDisplay(role adminservice.Role) RoleDisplay

type Session

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

func GetSession

func GetSession(c *gin.Context) *Session

func (*Session) AsMap

func (s *Session) AsMap() map[string]string

Writing in the returned map will not be saved.

func (*Session) Delete

func (s *Session) Delete(key string)

func (*Session) Load

func (s *Session) Load(key string) string

func (*Session) Store

func (s *Session) Store(key string, value string)

type SettingsManager

type SettingsManager struct {
	config.SettingsConfig
	InitSettings  func(*gin.Context) map[string]string
	CheckSettings func(map[string]string, *gin.Context) error
}

func NewSettingsManager

func NewSettingsManager(settingsConfig config.SettingsConfig) *SettingsManager

func (*SettingsManager) Get

func (m *SettingsManager) Get(ctx context.Context, userId uint64, c *gin.Context) map[string]string

func (*SettingsManager) Update

func (m *SettingsManager) Update(ctx context.Context, userId uint64, settings map[string]string) error

type Site

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

func NewSite

func NewSite(configExtracter config.BaseConfigExtracter, localesManager common.LocalesManager, settingsManager *SettingsManager) *Site

func (*Site) AddDefaultData

func (site *Site) AddDefaultData(adder common.DataAdder)

func (*Site) AddPage

func (site *Site) AddPage(page Page)

func (*Site) AddStaticPages

func (site *Site) AddStaticPages(pageGroup parser.StaticPagesConfig) bool

func (*Site) GetPage

func (site *Site) GetPage(name string) (Page, bool)

func (*Site) GetPageWithPath

func (site *Site) GetPageWithPath(path string) (Page, bool)

func (*Site) Run

func (site *Site) Run(siteConfig config.SiteConfig) error

func (*Site) RunListener added in v1.10.1

func (site *Site) RunListener(siteConfig config.SiteConfig, listener net.Listener) error

type SiteAndConfig

type SiteAndConfig struct {
	Site   *Site
	Config config.SiteConfig
}

type Widget

type Widget interface {
	LoadInto(gin.IRouter)
}

Jump to

Keyboard shortcuts

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