node

package
v0.0.0-...-0fba574 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 17 Imported by: 0

README

markdown-to-confluence/node readme

    the node package is to enable 
    reading through a repo and 
    create a tree of content on confluence

Diagram of node recursive methodology

The package contains one exported struct:
// Node struct enables creation of a page tree
Node{}
The package contains two exported methods:
Node{}

// this method begins the generation of a page tree in confluence for a repo project path.
// it ruturns a boolean confirming 'is projectPath a valid folder path'.
Start(projectPath string, client *confluence.APIClient) bool

// this method begins the deletion of pages in confluence that do not exist in
// local repository project path - it can be called after Instantiate method is called and returns true.
Delete()

Documentation

Overview

Package node is to enable reading through a repo and create a tree of content on confluence

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAPIClient

func SetAPIClient(client APIClienter)

SetAPIClient sets a confluence.APIClient object into the node package

Types

type APIClienter

type APIClienter interface {
	CreatePage(root int, contents *markdown.FileContents, isroot bool) (int, error)
	DeletePage(pageID int) error
	UpdatePage(pageID int, pageVersion int64, pageContents *markdown.FileContents,
		originalPage confluence.PageResults) (bool, error)
	FindPage(title string, many bool) (*confluence.PageResults, error)
	UploadAttachment(filename string, id int, index bool, indexid int) error
}

APIClienter is interface for confluence API client and mock tests

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node struct enables creation of a page tree

func (*Node) Delete

func (node *Node) Delete()

Delete method starts loop through node.branches and calls this method on each subnode of the node if node.id != 0 (i.e not the root node) then it calls method findPagesToDelete

func (*Node) Start

func (node *Node) Start(projectMasterID int, projectPath string, onlyDocs bool) bool

Start method begins the generation of a tree of the repo for confluence first it validates whether the project path is a folder if yes then it sets the rootDir as the project path folder name then begins the recursive method generateMaster and returns bool - if true then it means pages have been created/updated/checked on confluence and there is markdown content in the folder

func (*Node) Tree

func (node *Node) Tree()

Tree - print out what has been generated

type Page

type Page struct {
	// contains filtered or unexported fields
}

Page - test pages are generated and stored in here

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

Tree - capture what has been generated

Jump to

Keyboard shortcuts

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