Versions in this module Expand all Collapse all v1 v1.0.1 Oct 5, 2026 v1.0.0 Oct 5, 2026 Changes in this version + const DefaultBaseURL + const DefaultTimeout + const Version + var ErrConnection = errors.New("justpush: connection failed") + var ErrForbidden = errors.New("justpush: forbidden") + var ErrNotFound = errors.New("justpush: not found") + var ErrRateLimited = errors.New("justpush: rate limited") + var ErrSubscriptionExpired = errors.New("justpush: subscription expired") + var ErrUnauthorized = errors.New("justpush: unauthorized") + var ErrValidation = errors.New("justpush: validation failed") + var Sounds = []Sound + type APIError struct + Body []byte + Errors map[string][]string + Message string + RetryAfter time.Duration + StatusCode int + func (e *APIError) Error() string + func (e *APIError) Unwrap() error + type Acknowledgement struct + CallbackParams map[string]any + CallbackURL string + Interval time.Duration + MaxRetries int + Retry bool + type Button struct + ActionRequired bool + CTA string + URL string + type ButtonGroup struct + ActionRequired bool + Buttons []Button + CTA string + Name string + type Client struct + func New(token string, opts ...Option) (*Client, error) + func (c *Client) CreateTopic(ctx context.Context, in TopicInput) (*Topic, error) + func (c *Client) GetMessage(ctx context.Context, key string) (*MessageDetails, error) + func (c *Client) GetTopic(ctx context.Context, uuid string) (*Topic, error) + func (c *Client) Send(ctx context.Context, m *Message) (*SendResult, error) + func (c *Client) UpdateTopic(ctx context.Context, uuid string, in TopicInput) (*Topic, error) + func (c *Client) VerifyToken(ctx context.Context) error + type ConnectionError struct + Err error + func (e *ConnectionError) Error() string + func (e *ConnectionError) Unwrap() []error + type Image struct + Body string + Caption string + URL string + func ImageFromBytes(data []byte, caption string) Image + func ImageFromFile(path, caption string) (Image, error) + func ImageFromURL(url, caption string) Image + type Message struct + Acknowledge *Acknowledgement + ButtonGroups []ButtonGroup + Buttons []Button + Expiry time.Duration + Images []Image + Message string + Priority Priority + Sound Sound + Title string + Topic string + TopicToken string + type MessageDetails struct + ExpiresAt time.Time + IsAcknowledged bool + Key string + Message string + PendingActions json.RawMessage + Priority Priority + ProcessedAt time.Time + Raw json.RawMessage + ReceivedAt time.Time + RequiresAcknowledgement bool + Sound Sound + Title string + Topic *Topic + func (m *MessageDetails) UnmarshalJSON(data []byte) error + type Option func(*Client) + func WithBaseURL(baseURL string) Option + func WithHTTPClient(hc *http.Client) Option + func WithTimeout(d time.Duration) Option + type Priority int + const PriorityHigh + const PriorityHighest + const PriorityLow + const PriorityLowest + const PriorityNormal + func ParsePriority(s string) (Priority, error) + func (p Priority) String() string + type RateLimit struct + Known bool + Limit int + Remaining int + Reset time.Duration + type SendResult struct + Key string + RateLimit RateLimit + type Sound string + const SoundAlien + const SoundBike + const SoundBugle + const SoundCashRegister + const SoundClassical + const SoundClimb + const SoundCosmic + const SoundDefault + const SoundEcho + const SoundFalling + const SoundGamelan + const SoundIncoming + const SoundIntermission + const SoundMagic + const SoundMechanical + const SoundNone + const SoundPersistent + const SoundPianoBar + const SoundSiren + const SoundSpaceAlarm + const SoundTugboat + const SoundUpDown + const SoundVibrate + func ParseSound(s string) (Sound, error) + type Topic struct + APIToken string + Avatar string + HasCustomAvatar bool + Raw json.RawMessage + Slug string + Title string + UUID string + func (t *Topic) UnmarshalJSON(data []byte) error + type TopicInput struct + AvatarImage []byte + AvatarURL string + Title string + type ValidationError struct + Message string + func (e *ValidationError) Error() string + func (e *ValidationError) Is(target error) bool