services

package
v0.0.0-...-5bb3154 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateRequestScope = 1000

	// RequestTagName is a tag name used for a request injection
	RequestTagName = "request"
	// RequestTagName is a tag name used for a request injection
	FormTagName = "form"

	// SessionCookieID is default name of session cookie
	SessionCookieID = "session"
	// SessionCookieLength is default length of session id (storaged by cookie)
	SessionIDLength = 128
	// SessionCookieLifetime is a lifetime of cookie
	SessionLifetime = 365 * 24
	// SessionExpire is key to read expire time from session
	SessionExpireKey = "session.expire"

	// DefaultTemplatePath is a default path for temapates
	DefaultTemplatePath = "./cmsapp/templates"

	// DefaultDatabaseEngine is default engine for database
	DefaultDatabaseEngine = "sqlite3"
	// DefaultDatabaseUrl is default url/path for database
	DefaultDatabaseUrl = "./database/sqlite3_database.db"
)
View Source
const (
	// DatabaseService is a key to access database storage service
	DatabaseService = "DatabaseService"
	// RouterKey is a key to access router service
	RouterService = "RouterService"
	// SessionStorageService is a key to access session storage service
	SessionStorageService = "SessionStorageService"
	// SessionManagerService is a key to access session manager service
	SessionManagerService = "SessionManagerService"
	// TemplateProviderService is a key to access template manager service
	TemplateService = "TemplateService"
	// CryptProviderService is a key to access crypting/encrypting manager service
	CryptService = "CryptService"
	// MailerService provide mail system
	MailerService = "MailerService"
	// LoggerService provide logger
	LoggerService = "LoggerService"
	// LoggerService provide logger
	TranslateService = "TranslateService"
	// SignupActionService provide user register service
	SignupActionService = "SignupAction"
	// ResetPasswordActionService provide user reset password service
	ResetPasswordActionService = "ResetPasswordAction"
)
View Source
const (
	CutTextTF  = "CutText"
	MessagesTF = "Messages"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypt

type Crypt interface {
	Hash(pass string) (string, error)
	Compare(hashedPass, pass string) (bool, error)
}

type Fixture

type Fixture interface {
	Load(dp app.Injector, scope app.Scope, filespace filesystem.Filespace, path string) (err error)
}

type Fragment

type Fragment struct {
	ID   int64
	HTML string
}

type FragmentStorage

type FragmentStorage interface {
	Get(key string) (result *Fragment)
}

type FragmentTemplateHelper

type FragmentTemplateHelper interface {
	RenderFragment(key, defaultValue string) (result template.HTML)
	RenderFragmentEditor(key, defaultValue string) (result template.HTML)
}

type Logger

type Logger interface {
	DevLog(format string, data ...interface{})
	TestLog(format string, data ...interface{})
	ProdLog(format string, data ...interface{})
	ErrorLog(format string, data ...interface{})
	IsProdLVL() bool
	IsDevLVL() bool
	IsTestLVL() bool
}

type Mailer

type Mailer interface {
	Send(to, name string, data interface{}, attachments []goatmail.Attachment, scope app.Scope) error
}

type MuxHandler

type MuxHandler func(http.ResponseWriter, *http.Request)

MuxHandler is function for standard mux input

type ResetPasswordAction

type ResetPasswordAction interface {
	SimpleReset(scope app.Scope, user *entities.User, password string) (err error)
}

type Router

type Router interface {
	ServeStatic(prefix, path string)
	OnGet(path string, handler ScopeHandler)
	OnPost(path string, handler ScopeHandler)
	OnPut(path string, handler ScopeHandler)
	OnDelete(path string, handler ScopeHandler)
	On(methods []string, path string, handler ScopeHandler)
	Host() string
	Start() error
	AddFactory(name string, factory dependency.Factory) error
}

type SchemaCreator

type SchemaCreator interface {
	CreateSchema() error
}

type ScopeHandler

type ScopeHandler func(app.Scope) error

ScopeHandler is a router service handler

type SessionManager

type SessionManager interface {
	Get(scope app.Scope, secret string) (session *entities.Session, err error)
	Create(scope app.Scope, user *entities.User) (session *entities.Session, err error)
	Delete(scope app.Scope, secret string) (err error)
}

type SignupAction

type SignupAction interface {
	Signup(form *forms.Signup, scope app.Scope) (msgs messages.MessageMap, err error)
}

type Template

type Template interface {
	AddFunc(name string, f interface{}) error
	View(layoutName, viewName string, eventScope app.EventScope) (*template.Template, error)
}

type Translate

type Translate interface {
	Translate(key string, values ...interface{}) (string, error)
	TranslateFor(key, prefix string, values ...interface{}) (string, error)
	Langs() []string
	Default() string
}

Jump to

Keyboard shortcuts

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