client

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 10 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
}

Client is used to interact with an EDV server.

func New

func New(edvServerURL string, opts ...Option) *Client

New returns a new instance of an EDV client.

func (*Client) Batch added in v0.1.5

func (c *Client) Batch(vaultID string, batch *models.Batch, opts ...ReqOption) ([]string, error)

Batch performs batch operations within a vault. Requires the EDV server to support the Batch extension.

func (*Client) CreateDataVault

func (c *Client) CreateDataVault(config *models.DataVaultConfiguration, opts ...ReqOption) (string, []byte, error)

CreateDataVault sends the EDV server a request to create a new data vault. The location of the newly created data vault is returned.

func (*Client) CreateDocument

func (c *Client) CreateDocument(vaultID string, document *models.EncryptedDocument, opts ...ReqOption) (string, error)

CreateDocument sends the EDV server a request to store the specified document. The location of the newly created document is returned.

func (*Client) DeleteDocument added in v0.1.5

func (c *Client) DeleteDocument(vaultID, docID string, opts ...ReqOption) error

DeleteDocument sends the EDV server a request to delete the specified document.

func (*Client) QueryVault

func (c *Client) QueryVault(vaultID, name, value string, opts ...ReqOption) ([]string, error)

QueryVault queries the given vault and returns the URLs of all documents that match the given query.

func (*Client) QueryVaultForFullDocuments added in v0.1.5

func (c *Client) QueryVaultForFullDocuments(vaultID, name, value string,
	opts ...ReqOption) ([]models.EncryptedDocument, error)

QueryVaultForFullDocuments queries the given vault and returns all documents that match the given query. Requires the EDV server to support the ReturnFullDocumentsOnQuery extension.

func (*Client) ReadAllDocuments

func (c *Client) ReadAllDocuments(vaultID string, opts ...ReqOption) ([]models.EncryptedDocument, error)

ReadAllDocuments sends the EDV server a request to retrieve all the documents within the specified vault.

func (*Client) ReadDocument

func (c *Client) ReadDocument(vaultID, docID string, opts ...ReqOption) (*models.EncryptedDocument, error)

ReadDocument sends the EDV server a request to retrieve the specified document. The requested document is returned.

func (*Client) UpdateDocument added in v0.1.5

func (c *Client) UpdateDocument(vaultID, docID string, document *models.EncryptedDocument, opts ...ReqOption) error

UpdateDocument sends the EDV server a request to update the specified document.

type Option

type Option func(opts *Client)

Option configures the edv client

func WithHeaders added in v0.1.5

func WithHeaders(addHeadersFunc addHeaders) Option

WithHeaders option is for setting additional http request headers

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig option is for definition of secured HTTP transport using a tls.Config instance

type ReqOption added in v0.1.5

type ReqOption func(opts *ReqOpts)

ReqOption edv req option

func WithRequestHeader added in v0.1.5

func WithRequestHeader(addHeadersFunc addHeaders) ReqOption

WithRequestHeader option is for setting additional http request headers

type ReqOpts added in v0.1.5

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

ReqOpts is used to interact with an EDV operation.

Jump to

Keyboard shortcuts

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