Skip to content

Extend service interface pattern to decouple service from APIRouter #4

@critt

Description

@critt

I previously added an interface that GCPService could implement so the sockets handlers and whatever service they use to to process audio data aren't tightly coupled.

There is a similar coupling going on with the APIRouter used for the REST endpoints:

@router.get("/getSupportedLanguages")
async def get_supported_languages():
    return GCPService.get_supported_languages()

Let's do the same thing here:

  1. Create an interface, like IRestService or something
  2. Have GCPService implement that one too
  3. Refactor APIRouter to interact with the interface instead of GCPService

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions