Files
yetano-clients/atlassian/confluence/types.go
T
terminarandClaude Opus 5.5 6a97dbd4c6 Shared Atlassian clients: atlassian/jira and atlassian/confluence
New library module yetano.dev/yetano/yetano-clients (owner decision
2026-11-01) replacing the three own Jira clients in yareco, yabaratla
and yamcp:

- atlassian: Options, Auth (api_token, basic, bearer/pat, cookie),
  Deployment (Cloud/Data Center), TLS, APIError and sentinel errors.
- atlassian/internal/transport: retry with backoff on 5xx/connection
  errors, shared adaptive 429 throttle honouring Retry-After (from
  yabaratla/yareco), CA file, proxy, cross-host redirect hardening,
  response cap (from yamcp), startAt pagination, file downloads.
- atlassian/jira: typed reads (projects, versions, fields, issues,
  comments, changelog, editmeta, transitions), JQL search on Cloud
  (/search/jql) and Data Center, classic search pages, issue writes,
  ADF/plain-text bodies per deployment, custom-field helpers.
- atlassian/confluence: small content API client (CQL search, pages,
  spaces, current user, create/update page with version check,
  comment, label), taken over from yamcp.

Standard library only; tests against httptest servers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 14:11:00 +01:00

95 lines
2.5 KiB
Go

package confluence
// Content is a page, blog post or comment.
type Content struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status"`
Title string `json:"title"`
Space *SpaceRef `json:"space"`
Version *Version `json:"version"`
Body *Body `json:"body"`
Ancestors []ContentRef `json:"ancestors"`
Links *Links `json:"_links"`
}
// ContentRef is a minimal content reference (ancestors, children, home
// page).
type ContentRef struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
}
// SpaceRef identifies a space inside content.
type SpaceRef struct {
ID int `json:"id,omitempty"`
Key string `json:"key"`
Name string `json:"name,omitempty"`
}
// Version is a content version.
type Version struct {
Number int `json:"number"`
When string `json:"when"`
By *User `json:"by"`
}
// Body holds the storage-format body when expanded.
type Body struct {
Storage *BodyRepresentation `json:"storage"`
}
// BodyRepresentation is one body format ("storage", "plain", ...).
type BodyRepresentation struct {
Value string `json:"value"`
Representation string `json:"representation"`
}
// Links are the _links of a content object.
type Links struct {
WebUI string `json:"webui"`
Base string `json:"base"`
}
// User is a Confluence account: AccountID on Cloud, Username on
// Server/Data Center.
type User struct {
AccountID string `json:"accountId"`
Username string `json:"username"`
DisplayName string `json:"displayName"`
Email string `json:"email"`
AccountEmail string `json:"accountEmail,omitempty"`
}
// ContentList is one page of content.
type ContentList struct {
Results []Content `json:"results"`
Start int `json:"start"`
Limit int `json:"limit"`
Size int `json:"size"`
}
// Space is a Confluence space.
type Space struct {
ID int `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Type string `json:"type"`
Status string `json:"status"`
Description *SpaceDescription `json:"description"`
Homepage *ContentRef `json:"homepage"`
}
// SpaceDescription holds the expanded plain description.
type SpaceDescription struct {
Plain *BodyRepresentation `json:"plain"`
}
// SpaceList is one page of spaces.
type SpaceList struct {
Results []Space `json:"results"`
Start int `json:"start"`
Limit int `json:"limit"`
Size int `json:"size"`
}