MCPcopy Create free account
hub / github.com/basecamp/hey-cli / resolvePostingTopicID

Function resolvePostingTopicID

internal/cmd/sdk.go:126–138  ·  view source on GitHub ↗

--- Posting topic ID helper --- resolvePostingTopicID extracts the topic ID from an SDK Posting. The SDK Posting doesn't have a TopicID field, so we parse from AppUrl.

(p generated.Posting)

Source from the content-addressed store, hash-verified

124// resolvePostingTopicID extracts the topic ID from an SDK Posting.
125// The SDK Posting doesn't have a TopicID field, so we parse from AppUrl.
126func resolvePostingTopicID(p generated.Posting) int64 {
127 if i := strings.LastIndex(p.AppUrl, "/topics/"); i >= 0 {
128 segment := p.AppUrl[i+len("/topics/"):]
129 // Strip trailing path components or query strings
130 if j := strings.IndexAny(segment, "/?#"); j >= 0 {
131 segment = segment[:j]
132 }
133 if id, err := strconv.ParseInt(segment, 10, 64); err == nil {
134 return id
135 }
136 }
137 return p.Id
138}
139
140// --- Calendar helpers ---
141

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected