Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidCalendarID(id string) bool
- type API
- func (api *API) GenTinyLink(contentID string) string
- func (api *API) GetAnonymousUser() (*User, error)
- func (api *API) GetAttachments(contentID string, params AttachmentParameters) (*ContentCollection, error)
- func (api *API) GetAuditRecords(params AuditParameters) (*AuditRecordCollection, error)
- func (api *API) GetAuditRecordsSince(params AuditSinceParameters) (*AuditRecordCollection, error)
- func (api *API) GetAuditRetention() (*AuditRetentionInfo, error)
- func (api *API) GetCalendarEvents(params CalendarEventsParameters) (*CalendarEventCollection, error)
- func (api *API) GetCalendars(params CalendarsParameters) (*CalendarCollection, error)
- func (api *API) GetContent(params ContentParameters) (*ContentCollection, error)
- func (api *API) GetContentByID(contentID string, params ContentIDParameters) (*Content, error)
- func (api *API) GetContentChildren(contentID string, params ChildrenParameters) (*Contents, error)
- func (api *API) GetContentChildrenByType(contentID, contentType string, params ChildrenParameters) (*ContentCollection, error)
- func (api *API) GetContentComments(contentID string, params ChildrenParameters) (*ContentCollection, error)
- func (api *API) GetContentHistory(contentID string, params ExpandParameters) (*History, error)
- func (api *API) GetCurrentUser(params ExpandParameters) (*User, error)
- func (api *API) GetDescendants(contentID string, params ExpandParameters) (*Contents, error)
- func (api *API) GetDescendantsOfType(contentID, descType string, params ExpandParameters) (*ContentCollection, error)
- func (api *API) GetGroup(groupName string, params ExpandParameters) (*Group, error)
- func (api *API) GetGroupMembers(groupName string, params CollectionParameters) (*UserCollection, error)
- func (api *API) GetGroups(params CollectionParameters) (*GroupCollection, error)
- func (api *API) GetLabels(contentID string, params LabelParameters) (*LabelCollection, error)
- func (api *API) GetRestrictions(contentID, parentPageId, spaceKey string) (*Restrictions, error)
- func (api *API) GetRestrictionsByOperation(contentID string, params ExpandParameters) (*Restrictions, error)
- func (api *API) GetRestrictionsForOperation(contentID, operation string, params CollectionParameters) (*Restriction, error)
- func (api *API) GetSpace(spaceKey string, params Parameters) (*Space, error)
- func (api *API) GetSpaceContent(spaceKey string, params SpaceParameters) (*Contents, error)
- func (api *API) GetSpaceContentWithType(spaceKey, contentType string, params SpaceParameters) (*Contents, error)
- func (api *API) GetSpaces(params SpaceParameters) (*SpaceCollection, error)
- func (api *API) GetUser(params UserParameters) (*User, error)
- func (api *API) GetUserGroups(params UserParameters) (*GroupCollection, error)
- func (api *API) IsWatchingContent(contentID string, params WatchParameters) (*WatchStatus, error)
- func (api *API) IsWatchingSpace(spaceKey string, params WatchParameters) (*WatchStatus, error)
- func (api *API) ListWatchers(params ListWatchersParameters) (*WatchInfo, error)
- func (api *API) ProfileURL(u *User) string
- func (api *API) Search(params SearchParameters) (*SearchResult, error)
- func (api *API) SearchContent(params ContentSearchParameters) (*ContentCollection, error)
- func (api *API) SetUserAgent(app, version string)
- type AttachmentParameters
- type AuditParameters
- type AuditRecord
- type AuditRecordCollection
- type AuditRetentionInfo
- type AuditSinceParameters
- type Body
- type Calendar
- type CalendarCollection
- type CalendarEvent
- type CalendarEventCollection
- type CalendarEventsParameters
- type CalendarUser
- type CalendarsParameters
- type ChildrenParameters
- type CollectionParameters
- type Container
- type ContainerID
- type Content
- type ContentCollection
- type ContentIDParameters
- type ContentParameters
- type ContentSearchParameters
- type Contents
- type Contributors
- type CustomEventType
- type Date
- type EmptyParameters
- type EventTypeReminder
- type ExpandParameters
- type ExtensionPosition
- type Extensions
- type Group
- type GroupCollection
- type History
- type Icon
- type Label
- type LabelCollection
- type LabelParameters
- type Links
- type ListWatchersParameters
- type Metadata
- type Operation
- type Parameters
- type PermsUser
- type Publishers
- type Resolution
- type Restriction
- type RestrictionData
- type Restrictions
- type SearchEntity
- type SearchParameters
- type SearchResult
- type Space
- type SpaceCollection
- type SpaceParameters
- type SubCalendar
- type Timestamp
- type User
- type UserCollection
- type UserParameters
- type Version
- type View
- type WatchInfo
- type WatchParameters
- type WatchStatus
- type Watcher
Constants ¶
const ( CONTENT_TYPE_ATTACHMENT = "attachment" CONTENT_TYPE_BLOGPOST = "blogpost" CONTENT_TYPE_COMMENT = "comment" CONTENT_TYPE_PAGE = "page" )
Content type
const ( SEARCH_EXCERPT_INDEXED = "indexed" SEARCH_EXCERPT_HIGHLIGHT = "highlight" SEARCH_EXCERPT_NONE = "none" )
Excerpt values
const ( SPACE_TYPE_PERSONAL = "personal" SPACE_TYPE_GLOBAL = "global" )
Space type
const ( SPACE_STATUS_CURRENT = "current" SPACE_STATUS_ARCHIVED = "archived" )
Content status
const ( CONTENT_STATUS_CURRENT = "current" CONTENT_STATUS_TRASHED = "trashed" CONTENT_STATUS_DRAFT = "draft" )
Space status
const ( UNITS_MINUTES = "minutes" UNITS_HOURS = "hours" UNITS_DAYS = "days" UNITS_MONTHS = "months" UNITS_YEARS = "years" )
Units
const ( OPERATION_READ = "read" OPERATION_UPDATE = "update" )
Operations types
const ( CALENDAR_CONTEXT_MY = "myCalendars" CALENDAR_CONTEXT_SPACE = "spaceCalendars" )
Calendar context
const ( // NAME is package name NAME = "Go-Confluence" // VERSION is package version VERSION = "5.1.2" )
Variables ¶
var ( ErrInitEmptyURL = errors.New("URL can't be empty") ErrInitEmptyUser = errors.New("User can't be empty") ErrInitEmptyPassword = errors.New("Password can't be empty") ErrNoPerms = errors.New("User does not have permission to use confluence") ErrQueryError = errors.New("Query cannot be parsed") ErrNoContent = errors.New("There is no content with the given id, or if the calling user does not have permission to view the content") ErrNoSpace = errors.New("There is no space with the given key, or if the calling user does not have permission to view the space") ErrNoUserPerms = errors.New("User does not have permission to view users") ErrNoUserFound = errors.New("User with the given username or userkey does not exist") )
API errors
Functions ¶
func IsValidCalendarID ¶
IsValidCalendarID validates calendar ID
Types ¶
type API ¶
type API struct { Client *fasthttp.Client // Client is client for http requests // contains filtered or unexported fields }
API is Confluence API struct
func (*API) GenTinyLink ¶
GenTinyLink generates tiny link for content with given ID
func (*API) GetAnonymousUser ¶
GetAnonymousUser fetch information about the how anonymous is represented in confluence https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#user-getAnonymous
func (*API) GetAttachments ¶
func (api *API) GetAttachments(contentID string, params AttachmentParameters) (*ContentCollection, error)
GetAttachments fetch list of attachment Content entities within a single container https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/child/attachment-getAttachments
func (*API) GetAuditRecords ¶
func (api *API) GetAuditRecords(params AuditParameters) (*AuditRecordCollection, error)
GetAuditRecords fetch a list of AuditRecord instances dating back to a certain time https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#audit-getAuditRecords
func (*API) GetAuditRecordsSince ¶
func (api *API) GetAuditRecordsSince(params AuditSinceParameters) (*AuditRecordCollection, error)
GetAuditRecordsSince fetch a list of AuditRecord instances dating back to a certain time https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#audit-getAuditRecords
func (*API) GetAuditRetention ¶
func (api *API) GetAuditRetention() (*AuditRetentionInfo, error)
GetAuditRetention fetch the current retention period https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#audit-getRetentionPeriod
func (*API) GetCalendarEvents ¶
func (api *API) GetCalendarEvents(params CalendarEventsParameters) (*CalendarEventCollection, error)
GetCalendarEvents fetch events from given calendar
func (*API) GetCalendars ¶
func (api *API) GetCalendars(params CalendarsParameters) (*CalendarCollection, error)
func (*API) GetContent ¶
func (api *API) GetContent(params ContentParameters) (*ContentCollection, error)
GetContent fetch list of Content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content-getContent
func (*API) GetContentByID ¶
func (api *API) GetContentByID(contentID string, params ContentIDParameters) (*Content, error)
GetContentByID fetch a piece of Content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content-getContentById
func (*API) GetContentChildren ¶
func (api *API) GetContentChildren(contentID string, params ChildrenParameters) (*Contents, error)
GetContentChildren fetch a map of the direct children of a piece of Content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/child-children
func (*API) GetContentChildrenByType ¶
func (api *API) GetContentChildrenByType(contentID, contentType string, params ChildrenParameters) (*ContentCollection, error)
GetContentChildrenByType the direct children of a piece of Content, limited to a single child type https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/child-childrenOfType
func (*API) GetContentComments ¶
func (api *API) GetContentComments(contentID string, params ChildrenParameters) (*ContentCollection, error)
GetContentComments fetch the comments of a content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/child-commentsOfContent
func (*API) GetContentHistory ¶
func (api *API) GetContentHistory(contentID string, params ExpandParameters) (*History, error)
GetContentHistory fetch the history of a particular piece of content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content-getHistory
func (*API) GetCurrentUser ¶
func (api *API) GetCurrentUser(params ExpandParameters) (*User, error)
GetCurrentUser fetch information about the current logged in user https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#user-getCurrent
func (*API) GetDescendants ¶
func (api *API) GetDescendants(contentID string, params ExpandParameters) (*Contents, error)
GetDescendants fetch a map of the descendants of a piece of Content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/descendant-descendants
func (*API) GetDescendantsOfType ¶
func (api *API) GetDescendantsOfType(contentID, descType string, params ExpandParameters) (*ContentCollection, error)
GetDescendantsOfType fetch the direct descendants of a piece of Content, limited to a single descendant type https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/descendant-descendantsOfType
func (*API) GetGroup ¶
func (api *API) GetGroup(groupName string, params ExpandParameters) (*Group, error)
GetGroup fetch the user group with the group name https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#group-getGroup
func (*API) GetGroupMembers ¶
func (api *API) GetGroupMembers(groupName string, params CollectionParameters) (*UserCollection, error)
GetGroupMembers fetch a collection of users in the given group https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#group-getMembers
func (*API) GetGroups ¶
func (api *API) GetGroups(params CollectionParameters) (*GroupCollection, error)
GetGroups fetch collection of user groups https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#group-getGroups
func (*API) GetLabels ¶
func (api *API) GetLabels(contentID string, params LabelParameters) (*LabelCollection, error)
GetLabels fetch the list of labels on a piece of Content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/label-labels
func (*API) GetRestrictions ¶
func (api *API) GetRestrictions(contentID, parentPageId, spaceKey string) (*Restrictions, error)
GetRestrictions returns restrictions for the content with permissions inheritance. Confluence API doesn't provide such an API method, so we use private JSON API.
func (*API) GetRestrictionsByOperation ¶
func (api *API) GetRestrictionsByOperation(contentID string, params ExpandParameters) (*Restrictions, error)
GetRestrictionsByOperation fetch info about all restrictions by operation https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/restriction-byOperation
func (*API) GetRestrictionsForOperation ¶
func (api *API) GetRestrictionsForOperation(contentID, operation string, params CollectionParameters) (*Restriction, error)
GetRestrictionsForOperation fetch info about all restrictions of given operation https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content/{id}/restriction-forOperation
func (*API) GetSpace ¶
func (api *API) GetSpace(spaceKey string, params Parameters) (*Space, error)
GetSpace fetch information about a space https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#space-space
func (*API) GetSpaceContent ¶
func (api *API) GetSpaceContent(spaceKey string, params SpaceParameters) (*Contents, error)
GetSpaceContent fetch the content in this given space https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#space-contents
func (*API) GetSpaceContentWithType ¶
func (api *API) GetSpaceContentWithType(spaceKey, contentType string, params SpaceParameters) (*Contents, error)
GetSpaceContentWithType fetch the content in this given space with the given type https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#space-contentsWithType
func (*API) GetSpaces ¶
func (api *API) GetSpaces(params SpaceParameters) (*SpaceCollection, error)
GetSpaces fetch information about a number of spaces https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#space-spaces
func (*API) GetUser ¶
func (api *API) GetUser(params UserParameters) (*User, error)
GetUser fetch information about a user identified by either user key or username https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#user-getUser
func (*API) GetUserGroups ¶
func (api *API) GetUserGroups(params UserParameters) (*GroupCollection, error)
GetUserGroups fetch collection of groups that the given user is a member of https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#user-getGroups
func (*API) IsWatchingContent ¶
func (api *API) IsWatchingContent(contentID string, params WatchParameters) (*WatchStatus, error)
IsWatchingContent fetch information about whether a user is watching a specified content https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#user/watch-isWatchingContent
func (*API) IsWatchingSpace ¶
func (api *API) IsWatchingSpace(spaceKey string, params WatchParameters) (*WatchStatus, error)
IsWatchingSpace fetch information about whether a user is watching a specified space https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#user/watch-isWatchingSpace
func (*API) ListWatchers ¶
func (api *API) ListWatchers(params ListWatchersParameters) (*WatchInfo, error)
ListWatchers fetch information about all watcher of given page
func (*API) ProfileURL ¶
ProfileURL return link to profile
func (*API) Search ¶
func (api *API) Search(params SearchParameters) (*SearchResult, error)
Search search for entities in Confluence using the Confluence Query Language (CQL) https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#search-search
func (*API) SearchContent ¶
func (api *API) SearchContent(params ContentSearchParameters) (*ContentCollection, error)
SearchContent fetch a list of content using the Confluence Query Language (CQL) https://docs.atlassian.com/ConfluenceServer/rest/7.3.4/#content-search
func (*API) SetUserAgent ¶
SetUserAgent set user-agent string based on app name and version
type AttachmentParameters ¶
type AttachmentParameters struct { Filename string `query:"filename"` MediaType string `query:"mediaType"` Expand []string `query:"expand"` Start int `query:"start"` Limit int `query:"limit"` }
AttachmentParameters is params for fetching attachments info
func (AttachmentParameters) ToQuery ¶
func (p AttachmentParameters) ToQuery() string
ToQuery convert params to URL query
func (AttachmentParameters) Validate ¶
func (p AttachmentParameters) Validate() error
Validate validates parameters
type AuditParameters ¶
type AuditParameters struct { StartDate time.Time `query:"startDate"` EndDate time.Time `query:"endDate"` SearchString string `query:"searchString"` Start int `query:"start"` Limit int `query:"limit"` }
AuditParameters is params for fetching audit data
func (AuditParameters) ToQuery ¶
func (p AuditParameters) ToQuery() string
ToQuery convert params to URL query
func (AuditParameters) Validate ¶
func (p AuditParameters) Validate() error
Validate validates parameters
type AuditRecord ¶
type AuditRecord struct { Author *User `json:"author"` RemoteAddress string `json:"remoteAddress"` CreationDate *Timestamp `json:"creationDate"` Summary string `json:"summary"` Description string `json:"description"` Category string `json:"category"` IsSysAdmin bool `json:"sysAdmin"` }
AuditRecord represents audit record
type AuditRecordCollection ¶
type AuditRecordCollection struct { Results []*AuditRecord `json:"results"` Start int `json:"start"` Limit int `json:"limit"` Size int `json:"size"` }
AuditRecordCollection contains paginated list of audit record
type AuditRetentionInfo ¶
AuditRetentionInfo contains info about retention time
type AuditSinceParameters ¶
type AuditSinceParameters struct { Number int `query:"number"` Units string `query:"units"` SearchString string `query:"searchString"` Start int `query:"start"` Limit int `query:"limit"` }
AuditSinceParameters is params for fetching audit data
func (AuditSinceParameters) ToQuery ¶
func (p AuditSinceParameters) ToQuery() string
ToQuery convert params to URL query
func (AuditSinceParameters) Validate ¶
func (p AuditSinceParameters) Validate() error
Validate validates parameters
type Body ¶
type Body struct { View *View `json:"view"` ExportView *View `json:"export_view"` StyledView *View `json:"styled_view"` StorageView *View `json:"storage"` }
Body contains content data
type Calendar ¶
type Calendar struct { UsersPermittedToView []*PermsUser `json:"usersPermittedToView"` UsersPermittedToEdit []*PermsUser `json:"usersPermittedToEdit"` GroupsPermittedToView []string `json:"groupsPermittedToView"` GroupsPermittedToEdit []string `json:"groupsPermittedToEdit"` Warnings []string `json:"warnings"` ChildSubCalendars []*Calendar `json:"childSubCalendars"` SubscriberCount int `json:"subscriberCount"` SubCalendar *SubCalendar `json:"subCalendar"` ReminderMe bool `json:"reminderMe"` IsHidden bool `json:"hidden"` IsEditable bool `json:"editable"` IsReloadable bool `json:"reloadable"` IsDeletable bool `json:"deletable"` IsEventsHidden bool `json:"eventsHidden"` IsWatchedViaContent bool `json:"watchedViaContent"` IsAdministrable bool `json:"administrable"` IsWatched bool `json:"watched"` IsEventsViewable bool `json:"eventsViewable"` IsEventsEditable bool `json:"eventsEditable"` IsSubscribedByCurrentUser bool `json:"subscribedByCurrentUser"` }
Calendar represents Team Calendars calendar
type CalendarCollection ¶
type CalendarCollection struct { Calendars []*Calendar `json:"payload"` Success bool `json:"success"` }
CalendarCollection contains slice with calendars
type CalendarEvent ¶
type CalendarEvent struct { Invitees []*CalendarUser `json:"invitees"` WorkingURL string `json:"workingUrl"` Description string `json:"description"` ClassName string `json:"className"` ShortTitle string `json:"shortTitle"` Title string `json:"title"` EventType string `json:"eventType"` ID string `json:"id"` CustomEventTypeID string `json:"customEventTypeId"` SubCalendarID string `json:"subCalendarId"` IconURL string `json:"iconUrl"` IconLink string `json:"iconLink"` MediumIconURL string `json:"mediumIconUrl"` BackgroundColor string `json:"backgroundColor"` BorderColor string `json:"borderColor"` TextColor string `json:"textColor"` ColorScheme string `json:"colorScheme"` Where string `json:"where"` FormattedStartDate string `json:"confluenceFormattedStartDate"` Start *Date `json:"start"` End *Date `json:"end"` OriginalStartDateTime *Date `json:"originalStartDateTime"` OriginalEndDateTime *Date `json:"originalEndDateTime"` IsExpandDates bool `json:"expandDates"` IsEditable bool `json:"editable"` IsAllDay bool `json:"allDay"` }
CalendarEvent represents Team Calendars event
type CalendarEventCollection ¶
type CalendarEventCollection struct { Events []*CalendarEvent `json:"events"` Success bool `json:"success"` }
CalendarEventCollection contains slice with events
type CalendarEventsParameters ¶
type CalendarEventsParameters struct { SubCalendarID string `query:"subCalendarId"` UserTimezoneID string `query:"userTimeZoneId"` Start time.Time `query:"start,timedate"` End time.Time `query:"end,timedate"` // contains filtered or unexported fields }
CalendarEventsParameters contains request params for events from Team Calendars API
func (CalendarEventsParameters) ToQuery ¶
func (p CalendarEventsParameters) ToQuery() string
ToQuery convert params to URL query
func (CalendarEventsParameters) Validate ¶
func (p CalendarEventsParameters) Validate() error
Validate validates parameters
type CalendarUser ¶
type CalendarUser struct { DisplayName string `json:"displayName"` Name string `json:"name"` ID string `json:"id"` Type string `json:"type"` AvatarIconURL string `json:"avatarIconUrl"` Email string `json:"email"` }
CalendarUser represents Team Calendars user
type CalendarsParameters ¶
type CalendarsParameters struct { IncludeSubCalendarID []string `query:"include,unwrap"` CalendarContext string `query:"calendarContext"` ViewingSpaceKey string `query:"viewingSpaceKey"` // contains filtered or unexported fields }
CalendarsParameters contains request params for calendars from Team Calendars API
func (CalendarsParameters) ToQuery ¶
func (p CalendarsParameters) ToQuery() string
ToQuery convert params to URL query
func (CalendarsParameters) Validate ¶
func (p CalendarsParameters) Validate() error
Validate validates parameters
type ChildrenParameters ¶
type ChildrenParameters struct { ParentVersion int `query:"parentVersion"` Location string `query:"location"` Depth string `query:"depth"` Expand []string `query:"expand"` Start int `query:"start"` Limit int `query:"limit"` }
ChildrenParameters is params for fetching content child info
func (ChildrenParameters) ToQuery ¶
func (p ChildrenParameters) ToQuery() string
ToQuery convert params to URL query
func (ChildrenParameters) Validate ¶
func (p ChildrenParameters) Validate() error
Validate validates parameters
type CollectionParameters ¶
type CollectionParameters struct { Expand []string `query:"expand"` Start int `query:"start"` Limit int `query:"limit"` }
CollectionParameters is params with pagination info
func (CollectionParameters) ToQuery ¶
func (p CollectionParameters) ToQuery() string
ToQuery convert params to URL query
func (CollectionParameters) Validate ¶
func (p CollectionParameters) Validate() error
Validate validates parameters
type Container ¶
type Container struct { ID ContainerID `json:"id"` Key string `json:"key"` // Space Name string `json:"name"` // Space Title string `json:"title"` // Page or blogpost Links *Links `json:"_links"` }
Container contains basic container info
type ContainerID ¶
type ContainerID string
ContainerID is container ID
func (*ContainerID) UnmarshalJSON ¶
func (c *ContainerID) UnmarshalJSON(b []byte) error
UnmarshalJSON is custom container ID unmarshaler
type Content ¶
type Content struct { ID string `json:"id"` Type string `json:"type"` Status string `json:"status"` Title string `json:"title"` Extensions *Extensions `json:"extensions"` Metadata *Metadata `json:"metadata"` Container *Container `json:"container"` Space *Space `json:"space"` Version *Version `json:"version"` Operations []*Operation `json:"operations"` Children *Contents `json:"children"` Ancestors []*Content `json:"ancestors"` Descendants *Contents `json:"descendants"` Body *Body `json:"body"` Links *Links `json:"_links"` }
Content contains content info
func (*Content) IsAttachment ¶
IsAttachment return true if content is attachment
type ContentCollection ¶
type ContentCollection struct { Results []*Content `json:"results"` Start int `json:"start"` Limit int `json:"limit"` Size int `json:"size"` }
ContentCollection represents paginated list of content
type ContentIDParameters ¶
type ContentIDParameters struct { Status string `query:"status"` Version int `query:"version"` Expand []string `query:"expand"` }
ContentIDParameters is params for fetching content info
func (ContentIDParameters) ToQuery ¶
func (p ContentIDParameters) ToQuery() string
ToQuery convert params to URL query
func (ContentIDParameters) Validate ¶
func (p ContentIDParameters) Validate() error
Validate validates parameters
type ContentParameters ¶
type ContentParameters struct { Type string `query:"type"` SpaceKey string `query:"spaceKey"` Title string `query:"title"` Status string `query:"status"` PostingDay time.Time `query:"postingDay"` Expand []string `query:"expand"` Start int `query:"start"` Limit int `query:"limit"` }
ContentParameters is params for fetching content info
func (ContentParameters) ToQuery ¶
func (p ContentParameters) ToQuery() string
ToQuery convert params to URL query
func (ContentParameters) Validate ¶
func (p ContentParameters) Validate() error
Validate validates parameters
type ContentSearchParameters ¶
type ContentSearchParameters struct { CQL string `query:"cql"` CQLContext string `query:"cqlcontext"` Expand []string `query:"expand"` Start int `query:"start"` Limit int `query:"limit"` }
ContentSearchParameters is params for searching content
func (ContentSearchParameters) ToQuery ¶
func (p ContentSearchParameters) ToQuery() string
ToQuery convert params to URL query
func (ContentSearchParameters) Validate ¶
func (p ContentSearchParameters) Validate() error
Validate validates parameters
type Contents ¶
type Contents struct { Attachments *ContentCollection `json:"attachment"` Comments *ContentCollection `json:"comment"` Pages *ContentCollection `json:"page"` Blogposts *ContentCollection `json:"blogposts"` }
Contents contains all types of content
type Contributors ¶
type Contributors struct {
Publishers *Publishers `json:"publishers"`
}
Contributors contains contributors list
type CustomEventType ¶
type CustomEventType struct { Created string `json:"created"` Icon string `json:"icon"` PeriodInMins int `json:"periodInMins"` CustomEventTypeID string `json:"customEventTypeId"` Title string `json:"title"` ParentSubCalendarID string `json:"parentSubCalendarId"` }
CustomEventType contains info about custom event type
type Date ¶
Date is RFC3339 encoded date
func (*Date) UnmarshalJSON ¶
UnmarshalJSON is custom Date format unmarshaler
type EmptyParameters ¶
type EmptyParameters struct { }
EmptyParameters is empty parameters
func (EmptyParameters) ToQuery ¶
func (p EmptyParameters) ToQuery() string
ToQuery convert params to URL query
func (EmptyParameters) Validate ¶
func (p EmptyParameters) Validate() error
Validate validates parameters
type EventTypeReminder ¶
type EventTypeReminder struct { EventTypeID string `json:"eventTypeId"` PeriodInMins int `json:"periodInMins"` IsCustomEventType bool `json:"isCustomEventType"` }
EventTypeReminder contains info about event reminder
type ExpandParameters ¶
type ExpandParameters struct {
Expand []string `query:"expand"`
}
ExpandParameters is params with field expand info
func (ExpandParameters) ToQuery ¶
func (p ExpandParameters) ToQuery() string
ToQuery convert params to URL query
func (ExpandParameters) Validate ¶
func (p ExpandParameters) Validate() error
Validate validates parameters
type ExtensionPosition ¶
type ExtensionPosition int
ExtensionPosition is extension position
func (*ExtensionPosition) UnmarshalJSON ¶
func (ep *ExtensionPosition) UnmarshalJSON(b []byte) error
UnmarshalJSON is custom position unmarshaler
type Extensions ¶
type Extensions struct { Position ExtensionPosition `json:"position"` // Page MediaType string `json:"mediaType"` // Attachment FileSize int `json:"fileSize"` // Attachment Comment string `json:"comment"` // Attachment Location string `json:"location"` // Comment Resolution *Resolution `json:"resolution"` // Comment }
Extensions contains info about content extensions
type GroupCollection ¶
type GroupCollection struct { Results []*Group `json:"results"` Start int `json:"start"` Limit int `json:"limit"` Size int `json:"size"` }
GroupCollection contains paginated list of groups
type History ¶
type History struct { CreatedBy *User `json:"createdBy"` CreatedDate *Date `json:"createdDate"` LastUpdated *Version `json:"lastUpdated"` PreviousVersion *Version `json:"previousVersion"` NextVersion *Version `json:"nextVersion"` Contributors *Contributors `json:"contributors"` IsLatest bool `json:"latest"` }
History contains info about content history
type Icon ¶
type Icon struct { Path string `json:"path"` Width int `json:"width"` Height int `json:"height"` IsDefault bool `json:"isDefault"` }
Icon contains icon info
type LabelCollection ¶
type LabelCollection struct { Result []*Label `json:"results"` Start int `json:"start"` Limit int `json:"limit"` Size int `json:"size"` }
LabelCollection contains paginated list of labels
type LabelParameters ¶
type LabelParameters struct { Prefix string `query:"prefix"` Start int `query:"start"` Limit int `query:"limit"` }
LabelParameters is params for fetching labels
func (LabelParameters) ToQuery ¶
func (p LabelParameters) ToQuery() string
ToQuery convert params to URL query
func (LabelParameters) Validate ¶
func (p LabelParameters) Validate() error
Validate validates parameters
type Links ¶
type Links struct { WebUI string `json:"webui"` TinyUI string `json:"tinyui"` Base string `json:"base"` }
Links contains links
type ListWatchersParameters ¶
type ListWatchersParameters struct {
PageID string `query:"pageId"`
}
ListWatchersParameters is params for fetching info about page watchers
func (ListWatchersParameters) ToQuery ¶
func (p ListWatchersParameters) ToQuery() string
ToQuery convert params to URL query
func (ListWatchersParameters) Validate ¶
func (p ListWatchersParameters) Validate() error
Validate validates parameters
type Metadata ¶
type Metadata struct { Labels *LabelCollection `json:"labels"` // Page MediaType string `json:"mediaType"` // Attachment }
Metadata contains metadata records
type Parameters ¶
Parameters is interface for parameters structs
type PermsUser ¶
type PermsUser struct { AvatarURL string `json:"avatarUrl"` Name string `json:"name"` DisplayName string `json:"fullName"` Key string `json:"id"` }
PermsUser represents Team Calendars permissions user
type Publishers ¶
Publishers contains info about users
type Resolution ¶
type Resolution struct { Status string `json:"status"` LastModifier *User `json:"lastModifier"` LastModifiedDate *Date `json:"lastModifiedDate"` }
Resolution contains resolution info
type Restriction ¶
type Restriction struct { Operation string `json:"operation"` Data *RestrictionData `json:"restrictions"` }
Restriction contains restriction info for single operation
type RestrictionData ¶
type RestrictionData struct { User *UserCollection `json:"user"` Group *GroupCollection `json:"group"` }
RestrictionData contains restrictions data
type Restrictions ¶
type Restrictions struct { Read *Restriction `json:"read"` Update *Restriction `json:"update"` }
Restrictions contains info about all restrictions
type SearchEntity ¶
type SearchEntity struct { Content *Content `json:"content"` Space *Space `json:"space"` User *User `json:"user"` Title string `json:"title"` Excerpt string `json:"excerpt"` URL string `json:"url"` EntityType string `json:"entityType"` LastModified *Date `json:"lastModified"` }
SearchEntity contains search result
type SearchParameters ¶
type SearchParameters struct { Expand []string `query:"expand"` CQL string `query:"cql"` CQLContext string `query:"cqlcontext"` Excerpt string `query:"excerpt"` Start int `query:"start"` Limit int `query:"limit"` IncludeArchivedSpaces bool `query:"includeArchivedSpaces"` }
SearchParameters is params for fetching search results
func (SearchParameters) ToQuery ¶
func (p SearchParameters) ToQuery() string
ToQuery convert params to URL query
func (SearchParameters) Validate ¶
func (p SearchParameters) Validate() error
Validate validates parameters
type SearchResult ¶
type SearchResult struct { Results []*SearchEntity `json:"results"` Start int `json:"start"` Limit int `json:"limit"` Size int `json:"size"` TotalSize int `json:"totalSize"` CQLQuery string `json:"cqlQuery"` SearchDuration int `json:"searchDuration"` }
SearchResult contains contains paginated list of search results
type Space ¶
type Space struct { ID int `json:"id"` Key string `json:"key"` Name string `json:"name"` Icon *Icon `json:"icon"` Type string `json:"type"` Links *Links `json:"_links"` }
Space contains info about space
func (*Space) IsArchived ¶
IsArchived return true if space is archived
func (*Space) IsPersonal ¶
IsPersonal return true if space is personal
type SpaceCollection ¶
type SpaceCollection struct { Results []*Space `json:"results"` Start int `json:"start"` Limit int `json:"limit"` Size int `json:"size"` }
SpaceCollection contains paginated list of spaces
type SpaceParameters ¶
type SpaceParameters struct { SpaceKey []string `query:"spaceKey,unwrap"` Expand []string `query:"expand"` Type string `query:"type"` Status string `query:"status"` Label string `query:"label"` Depth string `query:"depth"` Start int `query:"start"` Limit int `query:"limit"` Favourite bool `query:"favourite"` }
SpaceParameters is params for fetching info about space
func (SpaceParameters) ToQuery ¶
func (p SpaceParameters) ToQuery() string
ToQuery convert params to URL query
func (SpaceParameters) Validate ¶
func (p SpaceParameters) Validate() error
Validate validates parameters
type SubCalendar ¶
type SubCalendar struct { DisableEventTypes []string `json:"disableEventTypes"` CustomEventTypes []*CustomEventType `json:"customEventTypes"` SanboxEventTypeReminders []*EventTypeReminder `json:"sanboxEventTypeReminders"` Creator string `json:"creator"` TypeKey string `json:"typeKey"` Color string `json:"color"` TimeZoneID string `json:"timeZoneId"` Description string `json:"description"` Type string `json:"type"` SpaceKey string `json:"spaceKey"` SpaceName string `json:"spaceName"` Name string `json:"name"` ID string `json:"id"` IsWatchable bool `json:"watchable"` IsEventInviteesSupported bool `json:"eventInviteesSupported"` IsRestrictable bool `json:"restrictable"` }
SubCalendar represents Team Calendars sub-calendar
type Timestamp ¶
Timestamp is UNIX timestamp in ms
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON is custom Timestamp format unmarshaler
type User ¶
type User struct { Type string `json:"type"` Name string `json:"username"` Key string `json:"userKey"` ProfilePicture *Icon `json:"profilePicture"` DisplayName string `json:"displayName"` }
User contains user info
type UserCollection ¶
type UserCollection struct { Results []*User `json:"results"` Start int `json:"start"` Limit int `json:"limit"` Size int `json:"size"` }
UserCollection contains paginated list of users
type UserParameters ¶
type UserParameters struct { Key string `query:"key"` Username string `query:"username"` Expand []string `query:"expand"` Start int `query:"start"` Limit int `query:"limit"` }
UserParameters is params for fetching info about user
func (UserParameters) ToQuery ¶
func (p UserParameters) ToQuery() string
ToQuery convert params to URL query
func (UserParameters) Validate ¶
func (p UserParameters) Validate() error
Validate validates parameters
type Version ¶
type Version struct { Message string `json:"message"` By *User `json:"by"` When *Date `json:"when"` Number int `json:"number"` Content *Content `json:"content"` IsMinorEdit bool `json:"minorEdit"` IsHidden bool `json:"hidden"` }
Version contains info about content version
type WatchInfo ¶
type WatchInfo struct { PageWatchers []*Watcher `json:"pageWatchers"` SpaceWatchers []*Watcher `json:"spaceWatchers"` }
WatchInfo contains info about watchers
type WatchParameters ¶
type WatchParameters struct { Key string `query:"key"` Username string `query:"username"` ContentType string `query:"contentType"` }
WatchParameters is params for fetching info about watchers
func (WatchParameters) ToQuery ¶
func (p WatchParameters) ToQuery() string
ToQuery convert params to URL query
func (WatchParameters) Validate ¶
func (p WatchParameters) Validate() error
Validate validates parameters
type WatchStatus ¶
type WatchStatus struct {
IsWatching bool `json:"watching"`
}
WatchStatus contains watching status