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 ¶
var DefaultOptions SynapseOpts = SynapseOpts{ TokenLifetime: 1 * time.Hour, ClientTokenLifetime: 1 * time.Hour, }
Click to show internal directories.
Click to hide internal directories.