client

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: LGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyServerURL   = errors.New("empty contentserver url provided")
	ErrInvalidServerURL = errors.New("invalid contentserver url provided")
)

Functions

func NewHTTPTransport

func NewHTTPTransport(server string, client *http.Client) transport

NewHTTPTransport will create a new http transport for the given server and client. Caution: the provided server url is not validated!

func NewSocketTransport

func NewSocketTransport(server string, connectionPoolSize int, waitTimeout time.Duration) transport

Types

type Client

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

Client a content server client

func NewClient

func NewClient(
	server string,
	connectionPoolSize int,
	waitTimeout time.Duration,
) (c *Client, err error)

func NewClientWithTransport

func NewClientWithTransport(
	transport transport,
) (c *Client, err error)

func NewHTTPClient

func NewHTTPClient(server string) (c *Client, err error)

NewHTTPClient constructs a new client to talk to the contentserver. It returns an error if the provided url is empty or invalid.

func NewHTTPClientWithTransport

func NewHTTPClientWithTransport(transport transport) (c *Client, err error)

func (*Client) GetContent

func (c *Client) GetContent(request *requests.Content) (*content.SiteContent, error)

GetContent request site content

func (*Client) GetNodes

func (c *Client) GetNodes(env *requests.Env, nodes map[string]*requests.Node) (map[string]*content.Node, error)

GetNodes request nodes

func (*Client) GetRepo

func (c *Client) GetRepo() (map[string]*content.RepoNode, error)

GetRepo get the whole repo

func (*Client) GetURIs

func (c *Client) GetURIs(dimension string, IDs []string) (map[string]string, error)

GetURIs resolve uris for ids in a dimension

func (*Client) ShutDown

func (c *Client) ShutDown()

func (*Client) Update

func (c *Client) Update() (*responses.Update, error)

Update tell the server to update itself

Jump to

Keyboard shortcuts

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