Documentation
¶
Index ¶
- type ClearbitCategory
- type ClearbitCompany
- type ClearbitCompanySuggestion
- type ClearbitError
- type ClearbitErrorResponse
- type ClearbitMetrics
- type ClearbitSite
- type Client
- func (c *Client) FindCompanyByDomain(ctx context.Context, domain string) (*ClearbitCompany, error)
- func (c *Client) FindCompanyByName(ctx context.Context, name string) (*ClearbitCompany, error)
- func (c *Client) IsReady(ctx context.Context) error
- func (c *Client) SuggestCompanies(ctx context.Context, query string) ([]ClearbitCompanySuggestion, error)
- type Config
- type OrganizationSearcher
- func (s *OrganizationSearcher) IsReady(ctx context.Context) error
- func (s *OrganizationSearcher) QueryOrganizations(ctx context.Context, criteria model.OrganizationSearchCriteria) (*model.Organization, error)
- func (s *OrganizationSearcher) SuggestOrganizations(ctx context.Context, criteria model.OrganizationSuggestionCriteria) (*model.OrganizationSuggestionsResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClearbitCategory ¶
type ClearbitCategory struct {
Sector string `json:"sector"`
IndustryGroup string `json:"industryGroup"`
Industry string `json:"industry"`
SubIndustry string `json:"subIndustry"`
}
ClearbitCategory contains industry classification
type ClearbitCompany ¶
type ClearbitCompany struct {
// Name is the company name
Name string `json:"name"`
// LegalName is the legal name of the company
LegalName string `json:"legalName"`
// Domain is the company's primary domain
Domain string `json:"domain"`
// Site contains the company's website information
Site *ClearbitSite `json:"site,omitempty"`
// Category contains industry classification
Category *ClearbitCategory `json:"category,omitempty"`
// Metrics contains company size and other metrics
Metrics *ClearbitMetrics `json:"metrics,omitempty"`
// Description is a description of the company
Description string `json:"description"`
}
ClearbitCompany represents the company data structure returned by Clearbit API
type ClearbitCompanySuggestion ¶ added in v0.4.1
type ClearbitCompanySuggestion struct {
// Name is the company name
Name string `json:"name"`
// Domain is the company's primary domain
Domain string `json:"domain"`
// Logo is the URL to the company's logo (can be null)
Logo *string `json:"logo"`
}
ClearbitCompanySuggestion represents a company suggestion from the autocomplete API
type ClearbitError ¶
ClearbitError represents error details
type ClearbitErrorResponse ¶
type ClearbitErrorResponse struct {
Error *ClearbitError `json:"error,omitempty"`
}
ClearbitErrorResponse represents an error response from Clearbit API
type ClearbitMetrics ¶
type ClearbitMetrics struct {
Employees *int `json:"employees,omitempty"`
EmployeesRange string `json:"employeesRange"`
}
ClearbitMetrics contains company metrics
type ClearbitSite ¶
type ClearbitSite struct {
URL string `json:"url"`
}
ClearbitSite contains website information
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Clearbit API client
func (*Client) FindCompanyByDomain ¶
FindCompanyByDomain searches for a company by domain using Clearbit's Company API
func (*Client) FindCompanyByName ¶
FindCompanyByName searches for a company by name using Clearbit's Company API
func (*Client) SuggestCompanies ¶ added in v0.4.1
func (c *Client) SuggestCompanies(ctx context.Context, query string) ([]ClearbitCompanySuggestion, error)
SuggestCompanies searches for company suggestions using Clearbit's Autocomplete API
type Config ¶
type Config struct {
// APIKey is the Clearbit API key for authentication
APIKey string
// BaseURL is the base URL for Clearbit Company API (default: https://company.clearbit.com)
BaseURL string
// AutocompleteBaseURL is the base URL for Clearbit Autocomplete API (default: https://autocomplete.clearbit.com)
AutocompleteBaseURL string
// Timeout is the HTTP client timeout for API requests
Timeout time.Duration
// MaxRetries is the maximum number of retry attempts for failed requests
MaxRetries int
// RetryDelay is the delay between retry attempts
RetryDelay time.Duration
}
Config holds the configuration for Clearbit API client
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults
type OrganizationSearcher ¶
type OrganizationSearcher struct {
// contains filtered or unexported fields
}
OrganizationSearcher implements the port.OrganizationSearcher interface using Clearbit API
func NewOrganizationSearcher ¶
func NewOrganizationSearcher(ctx context.Context, config Config) (*OrganizationSearcher, error)
NewOrganizationSearcher creates a new Clearbit-based organization searcher
func (*OrganizationSearcher) IsReady ¶
func (s *OrganizationSearcher) IsReady(ctx context.Context) error
IsReady checks if the Clearbit API is ready to serve requests
func (*OrganizationSearcher) QueryOrganizations ¶
func (s *OrganizationSearcher) QueryOrganizations(ctx context.Context, criteria model.OrganizationSearchCriteria) (*model.Organization, error)
QueryOrganizations searches for organizations using Clearbit API
func (*OrganizationSearcher) SuggestOrganizations ¶ added in v0.4.1
func (s *OrganizationSearcher) SuggestOrganizations(ctx context.Context, criteria model.OrganizationSuggestionCriteria) (*model.OrganizationSuggestionsResult, error)
SuggestOrganizations returns organization suggestions using Clearbit Autocomplete API