confluence

package
v0.0.0-...-82a4113 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() terraform.ResourceProvider

Provider returns the ResourceProvider for Confluence

Types

type Attachment

type Attachment struct {
	Id       string           `json:"id,omitempty"`
	Metadata *Metadata        `json:"metadata,omitempty"`
	Title    string           `json:"title,omitempty"` // filename
	Type     string           `json:"type,omitempty"`  // always "attachment"
	Version  *Version         `json:"version,omitempty"`
	Links    *AttachmentLinks `json:"_links,omitempty"`
}

Attachment is a primary resource in Confluence

type AttachmentLinks struct {
	Context  string `json:"context,omitempty"`  // "/wiki"
	Download string `json:"download,omitempty"` // prefix with Context
}

AttachmentLinks is part of Content

type AttachmentResults

type AttachmentResults struct {
	Results []Attachment `json:"results,omitempty"`
}

type Body

type Body struct {
	Storage *Storage `json:"storage,omitempty"`
}

Body is part of Content

type Client

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

Client provides a connection to the Confluence API

func NewClient

func NewClient(input *NewClientInput) *Client

NewClient returns an authenticated client ready to use

func (*Client) CreateAttachment

func (c *Client) CreateAttachment(attachment *Attachment, data, pageId string) (*Attachment, error)

func (*Client) CreateContent

func (c *Client) CreateContent(content *Content) (*Content, error)

func (*Client) Delete

func (c *Client) Delete(path string) error

Delete uses the client to send a DELETE request

func (*Client) DeleteAttachment

func (c *Client) DeleteAttachment(id, pageId string) error

func (*Client) DeleteContent

func (c *Client) DeleteContent(id string) error

func (*Client) Get

func (c *Client) Get(path string, result interface{}) error

Get uses the client to send a GET request

func (*Client) GetAttachment

func (c *Client) GetAttachment(id string) (*Attachment, error)

func (*Client) GetAttachmentBody

func (c *Client) GetAttachmentBody(attachment *Attachment) (string, error)

func (*Client) GetContent

func (c *Client) GetContent(id string) (*Content, error)

func (*Client) GetString

func (c *Client) GetString(path string) (string, error)

GetString uses the client to send a GET request and returns a string

func (*Client) Post

func (c *Client) Post(path string, body interface{}, result interface{}) error

Post uses the client to send a POST request

func (*Client) PostForm

func (c *Client) PostForm(path, filename, body string, result interface{}) error

PostForm uses the client to send a multi-part form POST request

func (*Client) Put

func (c *Client) Put(path string, body interface{}, result interface{}) error

Put uses the client to send a PUT request

func (*Client) PutForm

func (c *Client) PutForm(path, filename, body string, result interface{}) error

PutForm uses the client to send a multi-part form PUT request

func (*Client) URL

func (c *Client) URL(path string) string

URL returns the public URL for a given path

func (*Client) UpdateAttachment

func (c *Client) UpdateAttachment(attachment *Attachment, data, pageId string) (*Attachment, error)

func (*Client) UpdateContent

func (c *Client) UpdateContent(content *Content) (*Content, error)

type Content

type Content struct {
	Id        string        `json:"id,omitempty"`
	Type      string        `json:"type,omitempty"`
	Title     string        `json:"title,omitempty"`
	Space     *Space        `json:"space,omitempty"`
	Version   *Version      `json:"version,omitempty"`
	Body      *Body         `json:"body,omitempty"`
	Links     *ContentLinks `json:"_links,omitempty"`
	Ancestors []*Content    `json:"ancestors,omitempty"`
}

Content is a primary resource in Confluence

type ContentLinks struct {
	Context string `json:"context,omitempty"`
	WebUI   string `json:"webui,omitempty"`
}

ContentLinks is part of Content

type ErrorResponse

type ErrorResponse struct {
	StatusCode int `json:"statusCode,omitempty"`
	Data       struct {
		Authorized bool     `json:"authorized,omitempty"`
		Valid      bool     `json:"valid,omitempty"`
		Errors     []string `json:"errors,omitempty"`
		Successful bool     `json:"successful,omitempty"`
	} `json:"data,omitempty"`
	Message string `json:"message,omitempty"`
}

ErrorResponse describes why a request failed

func (*ErrorResponse) String

func (e *ErrorResponse) String() string

type Metadata

type Metadata struct {
	MediaType string `json:"mediaType,omitempty"`
}

Metadata is part of an Attachment

type NewClientInput

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

NewClientInput provides information to connect to the Confluence API

type Space

type Space struct {
	Key string `json:"key,omitempty"`
}

Space is part of Content

type Storage

type Storage struct {
	Value          string `json:"value,omitempty"`
	Representation string `json:"representation,omitempty"`
}

Storage is part of Body

type Version

type Version struct {
	Number int `json:"number,omitempty"`
}

Version is part of Content

Jump to

Keyboard shortcuts

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