Documentation
¶
Index ¶
- Constants
- Variables
- func GetGitStartAndEndLine(gitInfo *GitInfo, localStartLine, localEndLine int) (int, int, error)
- type Channels
- type Component
- type ConfluenceClient
- type ConfluencePlugin
- type DiffType
- type DiscordPlugin
- type Document
- type EmptyFolder
- type FileSystemPlugin
- type Folder
- type GitInfo
- type GitPlugin
- type IPlugin
- type ISlackClient
- type ISourceItem
- type ListFoldersResponse
- type Option
- type Page
- type PageBody
- type PageVersion
- type PaligoClient
- type PaligoItem
- type PaligoPlugin
- type Plugin
- type PluginChannels
- type SlackPlugin
- type Space
- type StringBuilderPool
- type TokenType
Constants ¶
const ( PALIGO_RATE_LIMIT_CHECK_INTERVAL = 5 * time.Second PALIGO_DOCUMENT_SHOW_LIMIT = 50 PALIGO_FOLDER_SHOW_LIMIT = 50 )
https://paligo.net/docs/apidocs/en/index-en.html#UUID-a5b548af-9a37-d305-f5a8-11142d86fe20
Variables ¶
var ( ErrUnsupportedTokenType = errors.New("unsupported token type") ErrEmptyCloudID = errors.New("empty cloudID") ErrUnexpectedHTTPStatus = errors.New("unexpected http status") )
var ErrFileDiffSizeExceeded = errors.New("file diff size exceeded")
var (
ErrHTTPSRequired = errors.New("must use https")
)
Functions ¶
Types ¶
type Channels ¶
type Channels struct {
Items chan ISourceItem
Errors chan error
// contains filtered or unexported fields
}
func (*Channels) GetErrorsCh ¶ added in v4.3.0
func (*Channels) GetItemsCh ¶ added in v4.3.0
func (c *Channels) GetItemsCh() chan ISourceItem
type Component ¶
type Component struct {
PaligoItem
Subtype string `json:"subtype"`
Creator int `json:"creator"`
Owner int `json:"owner"`
Author int `json:"author"`
CreatedAt int `json:"created_at"`
ModifiedAt int `json:"modified_at"`
Checkout bool `json:"checkout"`
CheckoutUser string `json:"checkout_user"`
ParentResource int `json:"parent_resource"`
Taxonomies []interface{} `json:"taxonomies"`
ReleaseStatus string `json:"release_status"`
Content string `json:"content"`
Languages []string `json:"languages"`
External []interface{} `json:"external"`
CustomAttributes []interface{} `json:"custom_attributes"`
}
type ConfluenceClient ¶ added in v4.6.0
type ConfluenceClient interface {
WalkAllPages(ctx context.Context, limit int, visit func(*Page) error) error
WalkPagesByIDs(ctx context.Context, pageIDs []string, limit int, visit func(*Page) error) error
WalkPagesBySpaceIDs(ctx context.Context, spaceIDs []string, limit int, visit func(*Page) error) error
WalkPageVersions(ctx context.Context, pageID string, limit int, visit func(int) error) error
FetchPageAtVersion(ctx context.Context, pageID string, version int) (*Page, error)
WalkSpacesByKeys(ctx context.Context, spaceKeys []string, limit int, visit func(*Space) error) error
WikiBaseURL() string
}
ConfluenceClient defines the operations required by the Confluence plugin. Methods stream results via visitor callbacks and handle pagination internally.
func NewConfluenceClient ¶ added in v4.6.0
func NewConfluenceClient(baseWikiURL, username string, tokenType TokenType, tokenValue string) (ConfluenceClient, error)
NewConfluenceClient constructs a ConfluenceClient for the given base wiki URL (e.g., https://<company id>.atlassian.net/wiki). If username and token are non-empty, requests use HTTP Basic Auth.
type ConfluencePlugin ¶
type ConfluencePlugin struct {
Plugin
SpaceIDs []string
SpaceKeys []string
PageIDs []string
History bool
// contains filtered or unexported fields
}
func (*ConfluencePlugin) DefineCommand ¶
func (p *ConfluencePlugin) DefineCommand(items chan ISourceItem, errs chan error) (*cobra.Command, error)
func (*ConfluencePlugin) GetName ¶
func (p *ConfluencePlugin) GetName() string
type DiscordPlugin ¶
type DiscordPlugin struct {
Token string
Guilds []string
Channels []string
Count int
BackwardDuration time.Duration
Session *discordgo.Session
// contains filtered or unexported fields
}
func (*DiscordPlugin) DefineCommand ¶
func (p *DiscordPlugin) DefineCommand(items chan ISourceItem, errors chan error) (*cobra.Command, error)
func (*DiscordPlugin) GetName ¶
func (p *DiscordPlugin) GetName() string
type Document ¶
type Document struct {
PaligoItem
Content string `json:"content"`
Languages []string `json:"languages"`
}
type EmptyFolder ¶
type EmptyFolder struct {
PaligoItem
Children string `json:"children"`
}
type FileSystemPlugin ¶
func (*FileSystemPlugin) DefineCommand ¶
func (p *FileSystemPlugin) DefineCommand(items chan ISourceItem, errors chan error) (*cobra.Command, error)
func (*FileSystemPlugin) GetName ¶
func (p *FileSystemPlugin) GetName() string
type Folder ¶
type Folder struct {
PaligoItem
Children []PaligoItem `json:"children"`
}
type GitInfo ¶
type GitInfo struct {
Hunks []*gitdiff.TextFragment
ContentType DiffType
}
type GitPlugin ¶
func (*GitPlugin) DefineCommand ¶
type IPlugin ¶
type IPlugin interface {
GetName() string
DefineCommand(items chan ISourceItem, errors chan error) (*cobra.Command, error)
}
func NewConfluencePlugin ¶ added in v4.6.0
func NewConfluencePlugin() IPlugin
func NewGitPlugin ¶ added in v4.3.0
func NewGitPlugin() IPlugin
type ISlackClient ¶
type ISourceItem ¶
type ListFoldersResponse ¶
type ListFoldersResponse struct {
Page int `json:"page"`
NextPage string `json:"next_page"`
TotalPages int `json:"total_pages"`
Folders []EmptyFolder `json:"folders"`
}
type Page ¶ added in v4.6.0
type Page struct {
ID string `json:"id"`
Status string `json:"status"`
Title string `json:"title"`
SpaceID string `json:"spaceId"`
Type string `json:"type"`
Body PageBody `json:"body"`
Links map[string]string `json:"_links"`
Version PageVersion `json:"version"`
}
Page represents a Confluence page
type PageBody ¶ added in v4.6.0
type PageBody struct {
Storage *struct {
Value string `json:"value"`
} `json:"storage,omitempty"`
}
PageBody contains the Storage-Format body of a page.
type PageVersion ¶ added in v4.6.0
type PageVersion struct {
Number int `json:"number"`
}
PageVersion models the "version" object returned by Confluence.
type PaligoClient ¶
type PaligoClient struct {
Instance string
// contains filtered or unexported fields
}
type PaligoItem ¶
type PaligoPlugin ¶
func (*PaligoPlugin) DefineCommand ¶
func (p *PaligoPlugin) DefineCommand(items chan ISourceItem, errors chan error) (*cobra.Command, error)
func (*PaligoPlugin) GetAuthorizationHeader ¶
func (p *PaligoPlugin) GetAuthorizationHeader() string
func (*PaligoPlugin) GetCredentials ¶
func (p *PaligoPlugin) GetCredentials() (string, string)
func (*PaligoPlugin) GetName ¶
func (p *PaligoPlugin) GetName() string
type PluginChannels ¶ added in v4.3.0
type PluginChannels interface {
GetItemsCh() chan ISourceItem
GetErrorsCh() chan error
}
func NewChannels ¶ added in v4.3.0
func NewChannels(opts ...Option) PluginChannels
type SlackPlugin ¶
func (*SlackPlugin) DefineCommand ¶
func (p *SlackPlugin) DefineCommand(items chan ISourceItem, errors chan error) (*cobra.Command, error)
func (*SlackPlugin) GetName ¶
func (p *SlackPlugin) GetName() string
type Space ¶ added in v4.6.0
type Space struct {
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
Links map[string]string `json:"_links"`
}
Space represents a Confluence space
type StringBuilderPool ¶ added in v4.3.0
type StringBuilderPool struct {
// contains filtered or unexported fields
}
StringBuilderPool provides thread-safe object pooling for string builders
func (*StringBuilderPool) Get ¶ added in v4.3.0
func (p *StringBuilderPool) Get() *strings.Builder
Get retrieves a string builder from the pool
func (*StringBuilderPool) Put ¶ added in v4.3.0
func (p *StringBuilderPool) Put(sb *strings.Builder)
Put returns a string builder to the pool with size limits
func (*StringBuilderPool) Stats ¶ added in v4.3.0
func (p *StringBuilderPool) Stats() (gets, puts, discards, news int64, efficiency float64)
Stats returns pool efficiency statistics