Repository navigation
v1.0.0
Upgrading from v0.2.0 needs small code changes: New takes two arguments, and Bootstrap() is gone (see Removed). It also needs Cove v1.0.0 and a project token. What behaves differently is listed first.
Behaviour changes
- Requests time out after 15 seconds (
WithTimeoutto change it) instead of waiting forever. - The client uses its own
http.Client: settings made onhttp.DefaultClientno longer apply (useWithHTTPClient). Redirects aren't followed. - Error text keeps
Unexpected Status Nand adds Cove's explanation after it:... Unexpected Status 404: not_found: secret not found. - Keys are checked before anything is sent;
?,#or../in a key can no longer reach a different URL.
Added
APIErrorand sentinel errors forerrors.Is:ErrNotFound,ErrUnauthorized,ErrForbidden,ErrAlreadyExists,ErrInvalidKey,ErrBootstrapClosed....Contextversions of every method.GetSecrets(keys...): several secrets in one request (Cove'sPOST /v0/batch), naming every missing key.LoadOrBootstrap(path): onboarding in one call (reads a saved token, or fetches and saves it safely).WaitForReady(ctx): waits until Cove and its database are up.ValidateKey,WithTimeout,WithHTTPClient, doc comments, examples, and CI on Go 1.21 and the latest Go.
Removed
Bootstrap()and theSecretValuetype. UseLoadOrBootstrap(path), which also saves the token and sets it on the client.- The platform name:
New(baseURL, token)replacesNew(baseURL, clientSecret, platformName), andClient.Platformis gone. Cove 1.0 records a request under its token's name, soX-Cove-Sourceis no longer sent. Client.ClientSecretis nowClient.Token.
Works with
Cove v1.0.0 and later. It doesn't support Cove v0.2.0: upgrade Cove first, then the client.