server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory manages all server-level services, and generates individual domain factories for each domain

func NewFactory

func NewFactory(storage config.Storage, embeddedFiles embed.FS) *Factory

NewFactory uses the provided configuration data to generate a new Factory if there are any errors connecting to a domain's datasource, NewFactory will derp.Report the error, but will continue loading without those domains.

func (*Factory) ByContext

func (factory *Factory) ByContext(ctx echo.Context) (*domain.Factory, error)

ByContext retrieves a domain using an echo.Context

func (*Factory) ByDomainID

func (factory *Factory) ByDomainID(domainID string) (config.Domain, *domain.Factory, error)

ByDomainID retrieves a domain using a DomainID

func (*Factory) ByDomainName

func (factory *Factory) ByDomainName(name string) (*domain.Factory, error)

ByDomainName retrieves a domain using a Domain Name

func (*Factory) Config

func (factory *Factory) Config() config.Config

Config returns the current configuration for the Factory

func (*Factory) DeleteDomain

func (factory *Factory) DeleteDomain(domainID string) error

DeleteDomain removes a domain from the Factory

func (*Factory) DeleteProvider

func (factory *Factory) DeleteProvider(providerID string) error

DeleteConnection removes a domain from the Factory

func (*Factory) DomainByID

func (factory *Factory) DomainByID(domainID string) (config.Domain, error)

DomainByID finds a domain in the configuration by its ID

func (*Factory) EditorJS

func (factory *Factory) EditorJS() *goeditorjs.HTMLEngine

EditorJS returns the EditorJS adapter for the Content service

func (*Factory) Email

func (factory *Factory) Email() *service.ServerEmail

Email returns the global email service

func (*Factory) Filesystem

func (factory *Factory) Filesystem() service.Filesystem

Filesystem returns the global filesystem service

func (*Factory) FuncMap

func (factory *Factory) FuncMap() template.FuncMap

FuncMap returns the global funcMap (used by all templates)

func (*Factory) Icons

func (factory *Factory) Icons() icon.Provider

Icons returns the global icon collection

func (*Factory) ListDomains

func (factory *Factory) ListDomains() []config.Domain

ListDomains returns a list of all domains in the Factory

func (*Factory) NormalizeHostname

func (factory *Factory) NormalizeHostname(hostname string) string

NormalizeHostname removes some inconsistencies in host names, including a leading "www", if present

func (*Factory) PutDomain

func (factory *Factory) PutDomain(configuration config.Domain) error

PutDomain adds a domain to the Factory

func (*Factory) PutProvider

func (factory *Factory) PutProvider(oauthClient config.Provider) error

PutConnection adds a domain to the Factory

func (*Factory) Steranko

func (factory *Factory) Steranko(ctx echo.Context) (*steranko.Steranko, error)

Steranko implements the steranko.Factory method, used for locating the specific steranko instance used by a domain.

func (*Factory) Template

func (factory *Factory) Template() *service.Template

Template returns the global template service

func (*Factory) Theme

func (factory *Factory) Theme() *service.Theme

Theme returns the global theme service

func (*Factory) UpdateConfig

func (factory *Factory) UpdateConfig(value config.Config) error

UpdateConfig updates the configuration for the Factory

func (*Factory) Widget

func (factory *Factory) Widget() *service.Widget

Widget returns the global widget service

Jump to

Keyboard shortcuts

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