clarify initialisation of APIs order in comments

This commit is contained in:
Sam Wedgwood 2023-07-19 13:07:04 +01:00
parent 9803337075
commit 46d558db29
2 changed files with 6 additions and 0 deletions

View file

@ -28,6 +28,9 @@ import (
) )
// NewInternalAPI returns a concrete implementation of the internal API. // NewInternalAPI returns a concrete implementation of the internal API.
//
// Many of the methods provided by this API depend on access to a federation API, and so
// you may wish to call `SetFederationAPI` on the returned struct to avoid nil-dereference errors.
func NewInternalAPI( func NewInternalAPI(
processContext *process.ProcessContext, processContext *process.ProcessContext,
cfg *config.Dendrite, cfg *config.Dendrite,

View file

@ -36,6 +36,9 @@ import (
// NewInternalAPI returns a concrete implementation of the internal API. Callers // NewInternalAPI returns a concrete implementation of the internal API. Callers
// can call functions directly on the returned API or via an HTTP interface using AddInternalRoutes. // can call functions directly on the returned API or via an HTTP interface using AddInternalRoutes.
//
// Creating a new instance of the user API requires a roomserver API with a federation API set
// using its `SetFederationAPI` method, other you may get nil-dereference errors.
func NewInternalAPI( func NewInternalAPI(
processContext *process.ProcessContext, processContext *process.ProcessContext,
dendriteCfg *config.Dendrite, dendriteCfg *config.Dendrite,