serializer

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommentCreatedEvent   = "comment_created"
	CommentUpdatedEvent   = "comment_updated"
	CommentRemovedEvent   = "comment_removed"
	PageCreatedEvent      = "page_created"
	PageUpdatedEvent      = "page_updated"
	PageTrashedEvent      = "page_trashed"
	PageRestoredEvent     = "page_restored"
	PageRemovedEvent      = "page_removed"
	SubscriptionTypeSpace = "space_subscription"
	SubscriptionTypePage  = "page_subscription"
)
View Source
const (
	ConfluenceContentTypePage     = "page"
	ConfluenceContentTypeBlogPost = "blogpost"
	ConfluenceContentTypeComment  = "comment"
)

Variables

This section is empty.

Functions

func FormattedSubscriptionList

func FormattedSubscriptionList(channelSubscriptions StringSubscription) string

func UnmarshalCustomSubscription

func UnmarshalCustomSubscription(data []byte, typeJSONField string, customTypes map[string]reflect.Type) (interface{}, error)

UnmarshalCustomSubscription returns subscription from bytes.

Types

type BaseSubscription

type BaseSubscription struct {
	Alias     string   `json:"alias"`
	BaseURL   string   `json:"baseURL"`
	Events    []string `json:"events"`
	ChannelID string   `json:"channelID"`
	Type      string   `json:"subscriptionType"`
}

type Comment

type Comment struct {
	CreatorAccountID      string         `json:"creatorAccountId"`
	SpaceKey              string         `json:"spaceKey"`
	ModificationDate      int64          `json:"modificationDate"`
	LastModifierAccountID string         `json:"lastModifierAccountId"`
	Self                  string         `json:"self"`
	ID                    int            `json:"id"`
	CreationDate          int            `json:"creationDate"`
	ContentTypes          string         `json:"contentType"`
	Version               int            `json:"version"`
	Parent                *Page          `json:"parent"`
	InReplyTo             *ParentComment `json:"inReplyTo"`
}

type ConfluenceCloudEvent

type ConfluenceCloudEvent struct {
	UserAccountID string   `json:"userAccountId"`
	AccountType   string   `json:"accountType"`
	UpdateTrigger string   `json:"updateTrigger"`
	Timestamp     int      `json:"timestamp"`
	Comment       *Comment `json:"comment"`
	Page          *Page    `json:"page"`
}

func ConfluenceCloudEventFromJSON

func ConfluenceCloudEventFromJSON(data io.Reader) *ConfluenceCloudEvent

func (ConfluenceCloudEvent) GetNotificationPost

func (e ConfluenceCloudEvent) GetNotificationPost(eventType string) *model.Post

func (ConfluenceCloudEvent) GetPageID

func (e ConfluenceCloudEvent) GetPageID() string

func (ConfluenceCloudEvent) GetSpaceKey

func (e ConfluenceCloudEvent) GetSpaceKey() string

func (ConfluenceCloudEvent) GetURL

func (e ConfluenceCloudEvent) GetURL() string

type ConfluenceEvent

type ConfluenceEvent interface {
	GetNotificationPost(string) *model.Post
	GetURL() string
	GetSpaceKey() string
	GetPageID() string
}

type ConfluenceServerBlogPost

type ConfluenceServerBlogPost struct {
	CreatedAt   int64                `json:"created_at"`
	Title       string               `json:"title"`
	Version     int                  `json:"version"`
	CreatedBy   ConfluenceServerUser `json:"created_by"`
	URL         string               `json:"url"`
	Content     string               `json:"content"`
	Labels      []string             `json:"labels"`
	HTMLContent string               `json:"html_content"`
	ContentType string               `json:"content_type"`
	UpdatedAt   int64                `json:"updated_at"`
	UpdatedBy   ConfluenceServerUser `json:"updated_by"`
	ID          string               `json:"id"`
	Excerpt     string               `json:"excerpt"`
}

type ConfluenceServerComment

type ConfluenceServerComment struct {
	ParentComment    *ConfluenceServerParentComment `json:"parent"`
	DisplayTitle     string                         `json:"display_title"`
	IsInlineComment  bool                           `json:"is_inline_comment"`
	CreatedAt        int64                          `json:"created_at"`
	ThreadChangeDate int64                          `json:"thread_change_date"`
	DescendantsCount int                            `json:"descendants_count"`
	Title            *string                        `json:"title"`
	Version          int                            `json:"version"`
	CreatedBy        ConfluenceServerUser           `json:"created_by"`
	URL              string                         `json:"url"`
	Content          string                         `json:"content"`
	Labels           []string                       `json:"labels"`
	HTMLContent      string                         `json:"html_content"`
	Depth            int                            `json:"depth"`
	ContentType      string                         `json:"content_type"`
	UpdatedAt        int64                          `json:"updated_at"`
	UpdatedBy        ConfluenceServerUser           `json:"updated_by"`
	ID               string                         `json:"id"`
	Excerpt          string                         `json:"excerpt"`
	Status           string                         `json:"status"`
}

type ConfluenceServerEvent

type ConfluenceServerEvent struct {
	VersionComment string                    `json:"version_comment"`
	IsMinorEdit    bool                      `json:"is_minor_edit"`
	Creator        ConfluenceServerUser      `json:"creator"`
	ContentType    string                    `json:"content_type"`
	BaseURL        string                    `json:"base_url"`
	ContentURL     string                    `json:"content_url"`
	ContainerType  string                    `json:"container_type"`
	Comment        *ConfluenceServerComment  `json:"comment"`
	Page           *ConfluenceServerPage     `json:"page"`
	Blog           *ConfluenceServerBlogPost `json:"blog"`
	Event          string                    `json:"event"`
	Excerpt        string                    `json:"excerpt"`
	User           *ConfluenceServerUser     `json:"user"`
	Space          ConfluenceServerSpace     `json:"space"`
	Timestamp      int64                     `json:"timestamp"`
}

func ConfluenceServerEventFromJSON

func ConfluenceServerEventFromJSON(data io.Reader) *ConfluenceServerEvent

func (*ConfluenceServerEvent) GetBlogDisplayName

func (e *ConfluenceServerEvent) GetBlogDisplayName(withLink bool) string

func (*ConfluenceServerEvent) GetCommentPageOrBlogDisplayName

func (e *ConfluenceServerEvent) GetCommentPageOrBlogDisplayName(withLink bool) string

func (ConfluenceServerEvent) GetNotificationPost

func (e ConfluenceServerEvent) GetNotificationPost(eventType string) *model.Post

func (*ConfluenceServerEvent) GetPageDisplayName

func (e *ConfluenceServerEvent) GetPageDisplayName(withLink bool) string

func (ConfluenceServerEvent) GetPageID

func (e ConfluenceServerEvent) GetPageID() string

func (*ConfluenceServerEvent) GetSpaceDisplayName

func (e *ConfluenceServerEvent) GetSpaceDisplayName(withLink bool) string

func (ConfluenceServerEvent) GetSpaceKey

func (e ConfluenceServerEvent) GetSpaceKey() string

func (ConfluenceServerEvent) GetURL

func (e ConfluenceServerEvent) GetURL() string

func (*ConfluenceServerEvent) GetUserDisplayName

func (e *ConfluenceServerEvent) GetUserDisplayName(withLink bool) string

func (*ConfluenceServerEvent) GetUserFirstName

func (e *ConfluenceServerEvent) GetUserFirstName() string

type ConfluenceServerPage

type ConfluenceServerPage struct {
	IsHomePage    bool                           `json:"is_home_page"`
	CreatedAt     int64                          `json:"created_at"`
	Title         string                         `json:"title"`
	Content       string                         `json:"content"`
	HTMLContent   string                         `json:"html_content"`
	IsDeleted     bool                           `json:"is_deleted"`
	ContentType   string                         `json:"content_type"`
	UpdatedAt     int64                          `json:"updated_at"`
	IsDraft       bool                           `json:"is_draft"`
	ID            string                         `json:"id"`
	Ancestors     []ConfluenceServerPageAncestor `json:"ancestors"`
	IsRootLevel   bool                           `json:"is_root_level"`
	ContentID     int                            `json:"content_id"`
	IsIndexable   bool                           `json:"is_indexable"`
	Version       int                            `json:"version"`
	CreatedBy     ConfluenceServerUser           `json:"created_by"`
	URL           string                         `json:"url"`
	Labels        []string                       `json:"labels"`
	TinyURL       string                         `json:"tiny_url"`
	UpdatedBy     ConfluenceServerUser           `json:"updated_by"`
	EditURL       string                         `json:"edit_url"`
	IsUnpublished bool                           `json:"is_unpublished"`
	Position      interface{}                    `json:"position"`
	Excerpt       string                         `json:"excerpt"`
	IsCurrent     bool                           `json:"is_current"`
}

type ConfluenceServerPageAncestor

type ConfluenceServerPageAncestor struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

type ConfluenceServerParentComment

type ConfluenceServerParentComment struct {
	CreatedAt   int64                `json:"created_at"`
	Title       *string              `json:"title"`
	Version     int                  `json:"version"`
	CreatedBy   ConfluenceServerUser `json:"created_by"`
	URL         string               `json:"url"`
	Content     string               `json:"content"`
	Labels      []string             `json:"labels"`
	HTMLContent string               `json:"html_content"`
	ContentType string               `json:"content_type"`
	UpdatedAt   int64                `json:"updated_at"`
	UpdatedBy   ConfluenceServerUser `json:"updated_by"`
	ID          string               `json:"id"`
	Excerpt     string               `json:"excerpt"`
}

type ConfluenceServerSpace

type ConfluenceServerSpace struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Key         string `json:"key"`
	URL         string `json:"url"`
	Status      string `json:"status"`
}

type ConfluenceServerUser

type ConfluenceServerUser struct {
	FullName string `json:"full_name"`
	Email    string `json:"email"`
	URL      string `json:"url"`
	Username string `json:"username"`
}

type Page

type Page struct {
	CreatorAccountID      string `json:"creatorAccountId"`
	SpaceKey              string `json:"spaceKey"`
	ModificationDate      int64  `json:"modificationDate"`
	LastModifierAccountID string `json:"lastModifierAccountId"`
	Self                  string `json:"self"`
	ID                    int    `json:"id"`
	Title                 string `json:"title"`
	CreationDate          int    `json:"creationDate"`
	ContentTypes          string `json:"contentType"`
	Version               int    `json:"version"`
}

type PageSubscription

type PageSubscription struct {
	PageID string `json:"pageID"`
	BaseSubscription
}

func PageSubscriptionFromJSON

func PageSubscriptionFromJSON(data io.Reader) (PageSubscription, error)

func (PageSubscription) Add

func (ps PageSubscription) Add(s *Subscriptions)

func (PageSubscription) Edit

func (ps PageSubscription) Edit(s *Subscriptions)

func (PageSubscription) GetFormattedSubscription

func (ps PageSubscription) GetFormattedSubscription() string

func (PageSubscription) IsValid

func (ps PageSubscription) IsValid() error

func (PageSubscription) Name

func (ps PageSubscription) Name() string

func (PageSubscription) Remove

func (ps PageSubscription) Remove(s *Subscriptions)

func (PageSubscription) ValidateSubscription

func (ps PageSubscription) ValidateSubscription(subs *Subscriptions) error

type ParentComment

type ParentComment struct {
	ID string `json:"id"`
}

type SpaceSubscription

type SpaceSubscription struct {
	SpaceKey string `json:"spaceKey"`
	BaseSubscription
}

func SpaceSubscriptionFromJSON

func SpaceSubscriptionFromJSON(data io.Reader) (SpaceSubscription, error)

func (SpaceSubscription) Add

func (ss SpaceSubscription) Add(s *Subscriptions)

func (SpaceSubscription) Edit

func (ss SpaceSubscription) Edit(s *Subscriptions)

func (SpaceSubscription) GetFormattedSubscription

func (ss SpaceSubscription) GetFormattedSubscription() string

func (SpaceSubscription) IsValid

func (ss SpaceSubscription) IsValid() error

func (SpaceSubscription) Name

func (ss SpaceSubscription) Name() string

func (SpaceSubscription) Remove

func (ss SpaceSubscription) Remove(s *Subscriptions)

func (SpaceSubscription) ValidateSubscription

func (ss SpaceSubscription) ValidateSubscription(subs *Subscriptions) error

type StringArrayMap

type StringArrayMap map[string][]string

type StringSubscription

type StringSubscription map[string]Subscription

func (*StringSubscription) UnmarshalJSON

func (s *StringSubscription) UnmarshalJSON(data []byte) error

type Subscription

type Subscription interface {
	Add(*Subscriptions)
	Remove(*Subscriptions)
	Edit(*Subscriptions)
	Name() string
	GetFormattedSubscription() string
	IsValid() error
	ValidateSubscription(*Subscriptions) error
}

type Subscriptions

type Subscriptions struct {
	ByChannelID   map[string]StringSubscription
	ByURLPagID    map[string]StringArrayMap
	ByURLSpaceKey map[string]StringArrayMap
}

func NewSubscriptions

func NewSubscriptions() *Subscriptions

func SubscriptionsFromJSON

func SubscriptionsFromJSON(bytes []byte) (*Subscriptions, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL