documents

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(client *rest.Client) *Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, doc Document) (*http.Response, error)

Create posts the content of the document to the server using http POST to create new document. NOTE: some of the arguments of the document are ignored due the design of the HTTP API.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id string, version int) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, id string) (*http.Response, error)

func (*Client) List

func (c *Client) List(ctx context.Context, requestOptions rest.RequestOptions) (*http.Response, error)

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, id string, version int, doc Document) (*http.Response, error)

Patch patches the content of the document to the server using http PATCH to change the document. NOTE: some of the arguments of the document are ignored due the design of the HTTP API.

func (*Client) Trash

func (c *Client) Trash(ctx context.Context, id string) (*http.Response, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, id string, data []byte, requestOptions rest.RequestOptions) (*http.Response, error)

type Document

type Document struct {
	Kind       string
	Name       string
	ExternalID string
	Public     bool
	Content    []byte
}

Jump to

Keyboard shortcuts

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