Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractBucketID ¶ added in v0.15.0
ExtractBucketID extracts the bucket ID from a Basecamp URL
func ExtractUploadIDFromURL ¶ added in v0.15.0
ExtractUploadIDFromURL extracts the upload ID from a download or app URL
func IsBlobURL ¶ added in v0.15.3
IsBlobURL returns true if the URL is a blob/preview URL that cannot be downloaded via OAuth. Blob URLs use Google Cloud Storage with session cookie authentication instead of OAuth tokens. These URLs typically contain "/blobs/" or use the "preview.3.basecamp.com" subdomain.
Types ¶
type Attachment ¶
type Attachment struct {
SGID string
ContentType string
Filename string
URL string
Href string
Width string
Height string
Caption string
}
Attachment represents a Basecamp attachment with metadata
func ParseAttachments ¶
func ParseAttachments(htmlContent string) []Attachment
ParseAttachments extracts all bc-attachment elements from HTML content
func (*Attachment) GetDisplayName ¶
func (a *Attachment) GetDisplayName() string
GetDisplayName returns the best display name for the attachment
func (*Attachment) IsImage ¶
func (a *Attachment) IsImage() bool
IsImage returns true if the attachment is an image based on its content type
type DownloadResult ¶ added in v0.15.3
type DownloadResult struct {
UploadID int64
SourceURL string // The URL that worked (either URL or Href)
IsBlobURL bool // True if this is a blob URL that can't be downloaded via API
BlobURL string // The blob URL for user reference (if IsBlobURL is true)
}
DownloadResult contains the result of attempting to extract download information
func TryExtractUploadID ¶ added in v0.15.3
func TryExtractUploadID(att *Attachment) (*DownloadResult, error)
TryExtractUploadID attempts to extract an upload ID from an attachment. It first tries the URL field, then falls back to the Href field if available. If both fail and the URL is a blob URL, it returns a result indicating the blob URL so callers can provide appropriate user guidance.