lib

package
v0.0.0-...-fb722fa Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEndpoint provides an example endpoint for users
	DefaultEndpoint = "https://mydomain.atlassian.net/wiki"

	// Parallelism determines how many files to convert and upload at a time
	Parallelism = 5
)

Variables

View Source
var ParentIndex = make(map[string]string)

ParentIndex caches parent page Ids for futures reference

Functions

This section is empty.

Types

type Ancestor

type Ancestor struct {
	ID string `json:"id,omitempty"`
}

Ancestor TODO: move this to go-confluence api

type Markdown2Confluence

type Markdown2Confluence struct {
	Space               string
	Comment             string
	Title               string
	File                string
	Ancestor            string
	Debug               bool
	UseDocumentTitle    bool
	WithHardWraps       bool
	Since               int
	Username            string
	Password            string
	AccessToken         string
	Endpoint            string
	Parent              string
	SourceMarkdown      []string
	ExcludeFilePatterns []string
	// contains filtered or unexported fields
}

Markdown2Confluence stores the settings for each run

func (*Markdown2Confluence) CreateClient

func (m *Markdown2Confluence) CreateClient()

CreateClient returns a new markdown clietn

func (*Markdown2Confluence) IsExcluded

func (m *Markdown2Confluence) IsExcluded(p string) bool

func (*Markdown2Confluence) Run

func (m *Markdown2Confluence) Run() []error

Run the sync

func (*Markdown2Confluence) SourceEnvironmentVariables

func (m *Markdown2Confluence) SourceEnvironmentVariables()

SourceEnvironmentVariables overrides Markdown2Confluence with any environment variables that are set

  • CONFLUENCE_USERNAME
  • CONFLUENCE_PASSWORD
  • CONFLUENCE_ENDPOINT

func (Markdown2Confluence) Validate

func (m Markdown2Confluence) Validate() error

Validate required configs are set

type MarkdownFile

type MarkdownFile struct {
	Path     string
	Title    string
	Parents  []string
	Ancestor string
}

MarkdownFile contains information about the file to upload

func (*MarkdownFile) FindOrCreateAncestor

func (f *MarkdownFile) FindOrCreateAncestor(m *Markdown2Confluence, client *confluence.Client, ancestorID, parent string) (string, error)

FindOrCreateAncestor creates an empty page to represent a local "folder" name

func (*MarkdownFile) FindOrCreateAncestors

func (f *MarkdownFile) FindOrCreateAncestors(m *Markdown2Confluence) (ancestorID string, err error)

FindOrCreateAncestors creates an empty page to represent a local "folder" name

func (*MarkdownFile) FormattedPath

func (f *MarkdownFile) FormattedPath() (s string)

FormattedPath returns the Path with Parents

func (*MarkdownFile) String

func (f *MarkdownFile) String() (urlPath string)

func (*MarkdownFile) Upload

func (f *MarkdownFile) Upload(m *Markdown2Confluence) (urlPath string, err error)

Upload a markdown file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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