Versions in this module Expand all Collapse all v1 v1.1.1 Sep 2, 2026 v1.0.0 Jul 28, 2026 Changes in this version + const DefaultBaseURL + const DefaultMaxRetryAttempts + const DefaultRetryBaseDelay + const DefaultRetryMaxDelay + const DefaultTimeout + const DefaultUserAgent + var ErrForbidden = errors.New("cryptopanic: forbidden — access or plan restriction") + var ErrInvalidQuery = errors.New("cryptopanic: invalid query parameters") + var ErrMissingAuthToken = errors.New(...) + var ErrRateLimited = errors.New("cryptopanic: rate limit exceeded") + var ErrServerError = errors.New("cryptopanic: server error") + var ErrUnauthorized = errors.New("cryptopanic: unauthorized — check your auth token") + func BoolPtr(b bool) *bool + func IntPtr(i int) *int + func StringPtr(s string) *string + func TimePtr(t time.Time) *time.Time + type APIError struct + Message string + RawBody []byte + RequestID string + Retried int + StatusCode int + func (e *APIError) Error() string + type Client struct + func New(authToken string, opts ...Option) *Client + func NewFromEnv(opts ...Option) (*Client, error) + func (c *Client) NewsRSS(ctx context.Context) (*RSSResponse, error) + func (c *Client) Portfolio(ctx context.Context) (*PortfolioResponse, error) + func (c *Client) Posts(ctx context.Context, query PostsQuery) (*PostsPage, error) + func (c *Client) PostsRSS(ctx context.Context, query PostsQuery) (*RSSResponse, error) + type Filter string + const FilterBearish + const FilterBullish + const FilterHot + const FilterImportant + const FilterLol + const FilterRising + const FilterSaved + type Kind string + const KindAll + const KindMedia + const KindNews + type Option func(*Client) + func WithBaseURL(url string) Option + func WithHTTPClient(client *http.Client) Option + func WithPlan(plan Plan) Option + func WithRetryPolicy(policy RetryPolicy) Option + func WithSleeper(s Sleeper) Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(ua string) Option + type PanicPeriod string + const PanicPeriod1h + const PanicPeriod24h + const PanicPeriod6h + type PanicSort string + const PanicSortAsc + const PanicSortDesc + type Plan string + const PlanDeveloper + const PlanEnterprise + const PlanGrowth + type PortfolioResponse struct + Raw json.RawMessage + type Post struct + Author *PostAuthor + Content *PostContent + CreatedAt *time.Time + Description string + ID int + Image *string + Instruments []PostInstrument + Kind string + OriginalURL string + PanicScore *int + PanicScore1h *int + PublishedAt *time.Time + Slug string + Source *PostSource + Title string + URL string + Votes *PostVotes + type PostAuthor struct + Avatar string + Facebook string + ID int + LinkedIn string + Name string + Slug string + Twitter string + URL string + type PostContent struct + Raw string + type PostInstrument struct + Change float64 + Code string + Currency string + ID int + Slug string + Title string + Volume float64 + type PostSource struct + CreatedAt *time.Time + Domain string + Path string + Region string + Title string + type PostVotes struct + Comments int + Disliked int + Important int + Liked int + Lol int + Negative int + Positive int + Saved int + Toxic int + type PostsPage struct + HasNext bool + HasPrevious bool + Next string + NextPage *int + Previous string + PreviousPage *int + Results []Post + type PostsQuery struct + Currencies []string + Filter Filter + Following *bool + Kind Kind + LastPull *time.Time + Page *int + PanicPeriod PanicPeriod + PanicSort PanicSort + Public *bool + Regions string + Search string + Size *int + WithContent *bool + func (q *PostsQuery) ToValues() url.Values + func (q *PostsQuery) Validate() error + type RSSResponse struct + Body string + type ResponseMetadata struct + Duration time.Duration + RequestID string + StatusCode int + type RetryPolicy struct + BaseDelay time.Duration + MaxAttempts int + MaxDelay time.Duration + type Sleeper interface + Sleep func(d time.Duration) bool