Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Complete MVP implementation of the Cast GHL Conversation Provider bridge: - Go module setup with chi router and mongo-driver dependencies - Config loading with env var validation and defaults - MongoDB token store with upsert, get, update, delete operations - Cast.ph SMS client with 429 retry logic and typed errors - Phone number normalization (E.164 ↔ Philippine local format) - GHL OAuth 2.0 install/callback/refresh flow - GHL webhook handler with ECDSA signature verification (async dispatch) - GHL API client for message status updates and inbound message stubs - Multi-stage Dockerfile, docker-compose with MongoDB, Woodpecker CI pipeline - Unit tests for phone normalization, Cast client, GHL webhook, and OAuth handlers Co-Authored-By: SideKx <sidekx.ai@sds.dev>
26 lines
550 B
Go
26 lines
550 B
Go
package cast
|
|
|
|
import "fmt"
|
|
|
|
type SendRequest struct {
|
|
To string `json:"to"`
|
|
Message string `json:"message"`
|
|
SenderID string `json:"sender_id,omitempty"`
|
|
}
|
|
|
|
type SendResponse struct {
|
|
Success bool `json:"success"`
|
|
MessageID string `json:"message_id,omitempty"`
|
|
Parts int `json:"parts,omitempty"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
type CastAPIError struct {
|
|
StatusCode int
|
|
APIError string
|
|
}
|
|
|
|
func (e *CastAPIError) Error() string {
|
|
return fmt.Sprintf("cast api error (HTTP %d): %s", e.StatusCode, e.APIError)
|
|
}
|