client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT 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
}

Client manages communication with Immich server.

func New

func New(baseURL, apiKey string) (*Client, error)

New returns a new Immich http client.

func NewWithHTTPClient

func NewWithHTTPClient(baseURL *url.URL, apiKey string, hc *http.Client) *Client

NewWithHTTPClient returns a new Immich http client.

func (*Client) Do

func (c *Client) Do(req *http.Request, value any) (err error)

Do sends an API request and returns the API response. If the HTTP response is in the 2xx range, unmarshal the response body into value.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method string, res *url.URL, body any) (*http.Request, error)

NewRequest creates an API requrest. A relative URL can be provided in res URL instance. If specified, the value pointed to by body JSON encoded and included in as the request body.

Jump to

Keyboard shortcuts

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