-
Notifications
You must be signed in to change notification settings - Fork 6
V2 Migration
When I initially developed the library, there was some trickery done to get things to work (e.g. URL buidling), and I was ok with how I built it, but I felt I could do better.
So I decided to create a V2 where I fix some issues that were bugging me, make things easier to use, and remove the inefficient code.
Major changes were mostly centralized around the building of the ConfigClient
(now Client
).
No longer are there separate functions that need to be called to build a Client
. Instead there is a single New
function that can be provided a number of options to build the client.
V1 exposed a number of functions that built or retrieved unrelated data. These have been removed to slim down the APIs and make things easier to maintain.
V1 allowed only files of type JSON or YAML to be retrieved from the Config Server. Now XML files can be retrieved. Also, for any files that do not fit into these formats (e.g. Text or Properties), there are new functions - GetFileRaw
and GetFromFromBranchRaw
.
-
ConfigClient
is nowClient
- Functions
NewLocalClientFromEnv
,NewLocalClient
,NewCloudClient
, andNewOAuth2Client
are removed- Use the universal
New
function and instead pass options (e.g.LocalEnv
,Local
,DefaultCFService
, andOAuth2
)
- Use the universal
-
GetConfiguration
no longer takes a slice of strings for the profiles, but is a variadic argument
The following functions have been removed,
GetLocalCredentials
NewOAuth2HTTPClient
NewOAuth2Config
GetCloudCredentials
-
NotFoundError
has been renamed toResourceNotFoundError