client

package
v0.0.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: BSD-3-Clause Imports: 18 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) GetStatusCode

func (ce *AppwriteError) GetStatusCode() int

type Client

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

Client is the client struct to access Appwrite services

func NewClient

func NewClient() Client

NewClient initializes a new Appwrite client with a given timeout

func (*Client) AddHeader

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

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

func (*Client) Call

func (clt *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 (clt *Client) FileUpload(url string, headers map[string]interface{}, params map[string]interface{}, paramName string, uploadId string) (*ClientResponse, error)

func (*Client) SetChunkSize

func (clt *Client) SetChunkSize(size int64)

SetChunkSize sets the chunk size for file upload

func (*Client) SetEndpoint

func (clt *Client) SetEndpoint(endpoint string)

SetEndpoint sets the default endpoint to which the Client connects to

func (*Client) SetForwardedUserAgent

func (clt *Client) SetForwardedUserAgent(value string)

The user agent string of the client that made the request

func (*Client) SetJWT

func (clt *Client) SetJWT(value string)

Your secret JSON Web Token

func (*Client) SetKey

func (clt *Client) SetKey(value string)

Your secret API key

func (*Client) SetLocale

func (clt *Client) SetLocale(value string)

func (*Client) SetProject

func (clt *Client) SetProject(value string)

Your project ID

func (*Client) SetSelfSigned

func (clt *Client) SetSelfSigned(status bool)

SetSelfSigned sets the condition that specify if the Client should allow connections to a server using a self-signed certificate

func (*Client) SetSession

func (clt *Client) SetSession(value string)

The user session to authenticate with

func (*Client) SetTimeout

func (clt *Client) SetTimeout(timeout time.Duration) error

func (*Client) String

func (clt *Client) String() string

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