Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Package name for the NewCfClient function. #97

Open
davejohnston opened this issue Aug 30, 2022 · 1 comment
Open

Change Package name for the NewCfClient function. #97

davejohnston opened this issue Aug 30, 2022 · 1 comment

Comments

@davejohnston
Copy link
Contributor

davejohnston commented Aug 30, 2022

Currently to create a new CfClient we have to import the package 'client'. And call NewCfClient. This isn't very go idiomatic.
We probably need to support the API at this stage, but should create a package called harness or flags and define the NewCfClient in it. That way when instantiating the client the user would call

client := flags.NewCfClient(sdkKey string, options ...ConfigOption)

We can have the current NewCfClient call the new one, to maintain backwards compatability i.e.
package client

func NewCfClient(sdkKey string, options ...ConfigOption) (*CfClient, error) {
    return flags.NewCfClient(sdkKey, options)
}
@enver-bisevac
Copy link
Contributor

enver-bisevac commented Aug 30, 2022

@davejohnston What do you think about this ff := client.New(sdkKey string, options ...ConfigOption) it doesn require any breaking change just add New function. Later we can introduce new package ffclient in root of the project
`client := ffclient.New(sdkKey, options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants