Documentation
¶
Overview ¶
Package pushover implements the bounded HTTP boundary for the Pushover API.
Index ¶
- type Backoff
- type Client
- type HTTPClient
- func (c *HTTPClient) Limits(ctx context.Context, token string) (LimitsResponse, error)
- func (c *HTTPClient) Send(ctx context.Context, payload domain.TargetPayload) (SendResponse, error)
- func (c *HTTPClient) Sounds(ctx context.Context, token string) (SoundsResponse, error)
- func (c *HTTPClient) ValidateRecipient(ctx context.Context, token, user string, devices []string) (RecipientValidation, error)
- type LimitsResponse
- type RecipientValidation
- type SendError
- type SendResponse
- type Sound
- type SoundsResponse
- type TransmissionPhase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Send(context.Context, domain.TargetPayload) (SendResponse, error)
ValidateRecipient(context.Context, string, string, []string) (RecipientValidation, error)
Sounds(context.Context, string) (SoundsResponse, error)
Limits(context.Context, string) (LimitsResponse, error)
}
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient is safe for sequential reuse. The production constructor fixes its endpoint and transport; NewTestClient exists solely for hermetic TLS tests.
func NewClient ¶
func NewClient(backoff Backoff) *HTTPClient
NewClient returns a production client with normal TLS verification and no proxy or redirect support.
func NewTestClient ¶
NewTestClient permits a hermetic HTTPS endpoint and client. It deliberately rejects cleartext endpoints so tests cannot accidentally weaken TLS policy.
func (*HTTPClient) Limits ¶
func (c *HTTPClient) Limits(ctx context.Context, token string) (LimitsResponse, error)
func (*HTTPClient) Send ¶
func (c *HTTPClient) Send(ctx context.Context, payload domain.TargetPayload) (SendResponse, error)
func (*HTTPClient) Sounds ¶
func (c *HTTPClient) Sounds(ctx context.Context, token string) (SoundsResponse, error)
func (*HTTPClient) ValidateRecipient ¶
func (c *HTTPClient) ValidateRecipient(ctx context.Context, token, user string, devices []string) (RecipientValidation, error)
type LimitsResponse ¶
type RecipientValidation ¶
type SendError ¶
type SendError struct {
Cause error
Phase TransmissionPhase
TransmissionPossible bool
}
SendError retains an internal cause for programmatic classification. Its string form is fixed so credentials, paths, and hostile upstream text stay out of diagnostics.
type SendResponse ¶
type SoundsResponse ¶
type TransmissionPhase ¶
type TransmissionPhase string
const ( PhaseBeforeDial TransmissionPhase = "before_dial" PhaseConnect TransmissionPhase = "connect" PhaseTLS TransmissionPhase = "tls" PhaseWrite TransmissionPhase = "write" PhaseRead TransmissionPhase = "read" PhaseDecode TransmissionPhase = "decode" )