API surface for initialisng application? #523

Open
opened 2023-07-21 12:50:27 +00:00 by decentral1se · 0 comments

In both cwtchbot c34d073059/bot.go (L73-L118) and cairde f5f90e8347/cairde.go (L188-L256) we need to prepare everything required to make the app := app.NewApp(acn, m.userDir, settingsFile) call which involves some code that is starting to look like boilerplate?

Would it be an idea to put this behind an API surface? E.g. a top-level Launch() application.App? There's maybe a few configurables to pass in which could follow the options approach of sarah/cwtchbot#2?

In both `cwtchbot` https://git.openprivacy.ca/sarah/cwtchbot/src/commit/c34d0730593178407a4b8855a8baa28ad6283b5f/bot.go#L73-L118 and `cairde` https://git.coopcloud.tech/decentral1se/cairde/src/commit/f5f90e8347b5cd1f5df73abc7b717640ff13e063/cairde.go#L188-L256 we need to prepare everything required to make the `app := app.NewApp(acn, m.userDir, settingsFile)` call which involves some code that is starting to look like boilerplate? Would it be an idea to put this behind an API surface? E.g. a top-level `Launch() application.App`? There's maybe a few configurables to pass in which could follow the options approach of https://git.openprivacy.ca/sarah/cwtchbot/pulls/2?
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch#523
No description provided.