client

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: BSD-3-Clause Imports: 18 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultClient

func GetDefaultClient(timeout time.Duration) (*http.Client, error)

Types

type AppwriteError

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

AppwriteError represents an error of a client request

func (*AppwriteError) Error

func (ce *AppwriteError) Error() string

func (*AppwriteError) GetMessage

func (ce *AppwriteError) GetMessage() string

func (*AppwriteError) GetResponse added in v0.7.0

func (ce *AppwriteError) GetResponse() string

func (*AppwriteError) GetStatusCode

func (ce *AppwriteError) GetStatusCode() int

type Client

type Client struct {
	Client     *http.Client
	Headers    map[string]string
	Endpoint   string
	Timeout    time.Duration
	SelfSigned bool
	ChunkSize  int64
}

Client is the client struct to access Appwrite services

func New

func New(optionalSetters ...ClientOption) Client

Initialize a new Appwrite client with a given timeout

func (*Client) AddHeader

func (client *Client) AddHeader(key string, value string)

AddHeader add a new custom header that the Client should send on each request

func (*Client) Call

func (client *Client) Call(method string, path string, headers map[string]interface{}, params map[string]interface{}) (*ClientResponse, error)

Call an API using Client

func (*Client) FileUpload

func (client *Client) FileUpload(url string, headers map[string]interface{}, params map[string]interface{}, paramName string, uploadId string) (*ClientResponse, error)

func (*Client) String

func (client *Client) String() string

type ClientOption

type ClientOption func(*Client) error

type ClientResponse

type ClientResponse struct {
	Status     string
	StatusCode int
	Header     http.Header
	Result     interface{}
	Type       string
}

ClientResponse - represents the client response

Jump to

Keyboard shortcuts

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