deepgram / deepgram-go-sdk

Go SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
33 stars 28 forks source link

organize `deepgram` package files into a single folder #11

Closed davidalpert closed 1 year ago

davidalpert commented 2 years ago

Proposed changes

I propose reorganizing deepgram package source files into a single folder.

Context

It is unusual to the point of non-idiomatic to have Go source files from different folders.

In the current HEAD commit we have the deepgram package used in two different folders:

  1. at the root: ./deepgram.go; and
  2. inside the types folder: ./types/prerecorded.go

Possible Implementation

I suggest refactoring the deepgram package source files into a single folder, either at the root (which is common for library repos) or into a source folder (e.g. ./deepgram) which is also common for Go packages, to collect source code for a package into a folder named for that package.

At this point I would suggest moving ./types/prerecorded.go into the root which still requires importing with an alias:

import (
    deepgram "github.com/deepgram-devs/go-sdk"
)

The other approach, to move all the deepgram package files into a new folder ./deepgram would allow importing like this:

import (
    "github.com/deepgram-devs/go-sdk/deepgram"
)

A third option might be to organize the code into multiple packages named for related concerns, if you have multiple related concerns, like transcriptions, invitations, etc, but with only a few files a single package is probably sufficient.

jpvajda commented 1 year ago

Closing as this seems to be resolved by #15