synapse

package
v0.0.0-...-b20cf72 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadModuleFunc

type LoadModuleFunc func() types.ModuleConfig

type SynapseConfig

type SynapseConfig struct {

	// List of modules injected and that need to be load at startup
	Modules []types.ModuleConfig
	// Function that handle the database connection and return the Gorm dialector
	DatabaseConn types.DatabaseConnFunc
	Opts         SynapseOpts
	// contains filtered or unexported fields
}

func NewSynapseService

func NewSynapseService(DbConnFunc types.DatabaseConnFunc, Options *SynapseOpts) (*SynapseConfig, error)

Create a new Synapse service.

@param DbConnFunc - A function that must return a `gorm.Dialector` that handle the connection to the database.

@param Options - Handle the options of the service

func (SynapseConfig) GetCoreConfig

func (sc SynapseConfig) GetCoreConfig() types.ModuleConfig

func (*SynapseConfig) Init

func (sc *SynapseConfig) Init(e *echo.Echo) error

Initialize all the components in the configuration like the Database service, run the migrations, load all the middlewares from each module, load all the routes from every module etc. etc

func (*SynapseConfig) LoadModules

func (sc *SynapseConfig) LoadModules(modules ...LoadModuleFunc) error

Load the given modules into the Synapse service config.

This must be invoked before the synapseConfig.Init()

type SynapseOpts

type SynapseOpts struct {
	TokenLifetime       time.Duration
	ClientTokenLifetime time.Duration
}
var DefaultOptions SynapseOpts = SynapseOpts{
	TokenLifetime:       1 * time.Hour,
	ClientTokenLifetime: 1 * time.Hour,
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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