Documentation
¶
Overview ¶
Package urlarg provides utilities for parsing Basecamp URLs into IDs. This allows users to paste URLs from the browser as command arguments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractCommentWithProject ¶
ExtractCommentWithProject extracts a comment ID and project ID from an argument. For URLs with a fragment (e.g., #__recording_789), returns the comment ID. For URLs without a fragment, returns the recording ID (same as ExtractWithProject). Returns (commentOrRecordingID, projectID).
func ExtractID ¶
ExtractID extracts the primary ID from an argument. If the argument is a Basecamp URL, extracts the recording ID. Otherwise, returns the argument as-is (assumed to be an ID).
func ExtractIDs ¶
ExtractIDs extracts IDs from multiple arguments, handling URLs.
func ExtractProjectID ¶
ExtractProjectID extracts the project (bucket) ID from an argument. If the argument is a Basecamp URL, extracts the bucket ID. Otherwise, returns the argument as-is.
func ExtractWithProject ¶
ExtractWithProject extracts both the recording ID and project ID from an argument. Returns (recordingID, projectID). If projectID is empty, it wasn't in the URL.
Types ¶
type Parsed ¶
type Parsed struct {
AccountID string
ProjectID string // BucketID in Basecamp terminology
Type string // e.g., "todos", "messages", "cards"
RecordingID string
CommentID string
}
Parsed represents components extracted from a Basecamp URL.