client

package
v0.0.0-...-fff8c72 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClient

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

func NewAuthClient

func NewAuthClient(url string, headers map[string]string) *AuthClient

func (*AuthClient) Login

func (a *AuthClient) Login(body LoginParams) (*AuthResponse, *KontenbaseError)

func (*AuthClient) Logout

func (a *AuthClient) Logout() (*AuthResponse, *KontenbaseError)

func (*AuthClient) Register

func (a *AuthClient) Register(body RegisterParams) (*AuthResponse, *KontenbaseError)

func (*AuthClient) SaveToken

func (a *AuthClient) SaveToken(token string)

func (*AuthClient) Token

func (a *AuthClient) Token() string

func (*AuthClient) Update

func (a *AuthClient) Update(body map[string]interface{}) (*ProfileResponse, *KontenbaseError)

func (*AuthClient) User

type AuthResponse

type AuthResponse struct {
	Status     int
	StatusText string
	User       map[string]interface{}
	Token      string
}

type BulkResponse

type BulkResponse struct {
	Status     int                      `json:"status"`
	StatusText string                   `json:"statusText"`
	Data       []map[string]interface{} `json:"data"`
	Limit      int                      `json:"limit"`
	Skip       int                      `json:"skip"`
}

type Callback

type Callback func(event string, payload map[string]interface{}) error

type HTTPClient

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

func NewHTTPClient

func NewHTTPClient(baseUrl string, headers map[string]string) *HTTPClient

func (*HTTPClient) Delete

func (h *HTTPClient) Delete(path string, headers map[string]string) (*HTTPResponse, *KontenbaseError)

func (*HTTPClient) Get

func (h *HTTPClient) Get(path string, headers map[string]string) (*HTTPResponse, *KontenbaseError)

func (*HTTPClient) Patch

func (h *HTTPClient) Patch(path string, rawBody interface{}, headers map[string]string) (*HTTPResponse, *KontenbaseError)

func (*HTTPClient) Post

func (h *HTTPClient) Post(path string, rawBody interface{}, headers map[string]string) (*HTTPResponse, *KontenbaseError)

func (*HTTPClient) Send

func (h *HTTPClient) Send(method string, path string, rawBody interface{}, headers map[string]string) (*HTTPResponse, *KontenbaseError)

type HTTPResponse

type HTTPResponse struct {
	StatusCode int
	StatusText string
	Data       interface{}
	Header     http.Header
}

type KontenbaseError

type KontenbaseError struct {
	Message    string
	Status     int
	StatusText string
}

func (*KontenbaseError) Error

func (err *KontenbaseError) Error() string

type LoginParams

type LoginParams struct {
	Email    string `json:"email" validate:"required"`
	Password string `json:"password" validate:"required"`
}

type Message

type Message struct {
	Event   string                 `json:"eventType"`
	Payload map[string]interface{} `json:"payload"`
}

type ProfileResponse

type ProfileResponse struct {
	Status     int
	StatusText string
	User       map[string]interface{}
}

type QueryClient

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

func NewQueryClient

func NewQueryClient(url string, headers map[string]string) *QueryClient

func (*QueryClient) Count

func (*QueryClient) Create

func (q *QueryClient) Create(body map[string]interface{}) (*SingleResponse, *KontenbaseError)

func (*QueryClient) DeleteByID

func (q *QueryClient) DeleteByID(id string) (*SingleResponse, *KontenbaseError)

func (*QueryClient) Find

func (*QueryClient) GetByID

func (q *QueryClient) Link(id string, body map[string]interface{}) (*SingleResponse, *KontenbaseError)
func (q *QueryClient) Unlink(id string, body map[string]interface{}) (*SingleResponse, *KontenbaseError)

func (*QueryClient) UpdateByID

func (q *QueryClient) UpdateByID(id string, body map[string]interface{}) (*SingleResponse, *KontenbaseError)

type RealtimeClient

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

func NewRealtimeClient

func NewRealtimeClient(url string, apiKey string, auth *AuthClient) *RealtimeClient

func (*RealtimeClient) Close

func (r *RealtimeClient) Close() error

func (*RealtimeClient) Subscribe

func (r *RealtimeClient) Subscribe(name string, opts options.SubscribeOptions) (string, error)

func (*RealtimeClient) Unsubscribe

func (r *RealtimeClient) Unsubscribe(key string) error

type RegisterParams

type RegisterParams struct {
	Email     string `json:"email" validate:"required"`
	Password  string `json:"password" validate:"required"`
	FirstName string `json:"firstName" validate:"required"`
}

type SingleResponse

type SingleResponse struct {
	Status     int                    `json:"status"`
	StatusText string                 `json:"statusText"`
	Data       map[string]interface{} `json:"data"`
}

type Storage

type Storage struct {
	FileName string `json:"fileName"`
	MimeType string `json:"mimeType"`
	Size     int64  `json:"size"`
	URL      string `json:"url"`
}

type StorageClient

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

func NewStorageClient

func NewStorageClient(url string, auth *AuthClient) *StorageClient

func (*StorageClient) Upload

type StorageSingleResponse

type StorageSingleResponse struct {
	Status     int     `json:"status"`
	StatusText string  `json:"statusText"`
	Data       Storage `json:"data"`
}

Jump to

Keyboard shortcuts

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