config

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: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	WebKey = "puzzleWeb"

	DefaultFavicon = "/favicon.ico"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig interface {
	GetLogger() log.Logger
	GetLoggerGetter() log.LoggerGetter
}

type BaseConfigExtracter

type BaseConfigExtracter interface {
	BaseConfig
	GetServiceTimeOut() time.Duration
	ExtractLocalesConfig() LocalesConfig
	ExtractLoginConfig() LoginConfig
	ExtractAdminConfig() AdminConfig
	ExtractSettingsConfig() SettingsConfig
	ExtractProfileConfig() ProfileConfig
}

type BlogConfig

type BlogConfig struct {
	ServiceConfig[blogservice.BlogService]
	MarkdownService markdownservice.MarkdownService
	CommentService  forumservice.CommentService
	Domain          string
	Port            string
	DateFormat      string
	PageSize        uint64
	ExtractSize     uint64
	FeedFormat      string
	FeedSize        uint64
	Args            []string
}

type ForumConfig

type ForumConfig struct {
	ServiceConfig[forumservice.ForumService]
	PageSize uint64
	Args     []string
}

type LocalesConfig

type LocalesConfig struct {
	Logger         log.Logger
	LoggerGetter   log.LoggerGetter
	Domain         string
	SessionTimeOut int
	AllLang        []string
}

type ServiceConfig

type ServiceConfig[ServiceType any] struct {
	Logger       log.Logger // for init phase (have the context)
	LoggerGetter log.LoggerGetter
	Service      ServiceType
}

func MakeServiceConfig

func MakeServiceConfig[ServiceType any](c BaseConfig, service ServiceType) ServiceConfig[ServiceType]

func (*ServiceConfig[ServiceType]) GetLogger

func (c *ServiceConfig[ServiceType]) GetLogger() log.Logger

func (*ServiceConfig[ServiceType]) GetLoggerGetter added in v1.10.4

func (c *ServiceConfig[ServiceType]) GetLoggerGetter() log.LoggerGetter

type SessionConfig

type SessionConfig struct {
	ServiceConfig[sessionservice.SessionService]
	Domain  string
	TimeOut int
}

type SiteConfig

type SiteConfig struct {
	ServiceConfig[sessionservice.SessionService]
	TemplateService    templateservice.TemplateService
	Domain             string
	Port               string
	SessionTimeOut     int
	MaxMultipartMemory int64
	StaticFileSystem   http.FileSystem
	FaviconPath        string
	Page404Url         string
	LangPicturePaths   map[string]string
}

func (*SiteConfig) ExtractSessionConfig

func (sc *SiteConfig) ExtractSessionConfig() SessionConfig

func (*SiteConfig) ExtractTemplateConfig

func (sc *SiteConfig) ExtractTemplateConfig() TemplateConfig

type WikiConfig

type WikiConfig struct {
	ServiceConfig[wikiservice.WikiService]
	MarkdownService markdownservice.MarkdownService
	Args            []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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