clearbit / clearbit-go Goto Github PK
View Code? Open in Web Editor NEWGo bindings for Clearbit
License: MIT License
Go bindings for Clearbit
License: MIT License
I was looking to leverage the enrichment API but it looks like you don't support it through the golang API?
Maybe something like
clearbit.NewClient(clearbit.WithLogging(logger))
Risk API support would be great!
You might find it helpful to set (or allow to be set) a user agent for each version of the library, besides the default ("Go-http-client/1.1")
Go 1.11 module support
https://github.com/golang/go/wiki/Modules#how-to-define-a-module
I'm getting this error in production:
Simple fix would be converting the marketCap
string field to an int. However, I'm concerned that the API isn't returning a consistent type.
@davidlumley @mattatcha - can you confirm the API return type? Until this is fixed, enrichment is erroring in our app while chewing through our quota . . .
At the moment it's difficult to configure the timeout for each request. Ideally we could pass a context.Context to the request which would allow us to cancel a request when it is made.
I can't check the test results without a clearbit key. There should be either:
I'm getting this error while unmarshalling a company right now:
json: cannot unmarshal string into Go struct field .estimatedAnnualRevenue of type int
Debugging clearbit errors in our code has become a nightmare. This is what it looks like in our logs:
ERROR: clearbit:
Manually debugging, I've realized that this is because the API is returning codes like 404 or 422.
Internally, we end up wrapping the errors with github.com/pkg/errors and having to return different types of errors:
res, resp, err := s.ClearbitClient.Person.FindCombined(clearbit.PersonFindParams{
Email: r.Email,
})
if resp.StatusCode == 202 {
// Deferred
return r, errTryAgainLater
} else if resp.StatusCode == 404 {
return r, errEmailNotFound
} else if resp.StatusCode == 422 {
return r, errInvalid
} else if err != nil {
return r, errors.Wrap(err, fmt.Sprintf("code %d", r.StatusCode))
}
I propose that this package either (1) has named error types that it returns (e.g. ErrNotFound), or that it at least wraps all errs with the API response status code.
Getting this error in production:
json: cannot unmarshal number into Go struct field .id of type string,
It's stopping this library from completing enrichment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.