client

package
v0.0.0-...-4add913 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package client handles the permify client to connect with the server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(host, path string, query map[string]string, respModel interface{}) error

Delete request implementation

func Get

func Get(host, path string, query map[string]string, respModel interface{}) error

Get request implementation

func New

func New(endpoint string) (*permify.Client, error)

New initializes a new permify client

func Post

func Post(host, path string, query map[string]string, requestModel, respModel interface{}) error

Post request implementation

func Put

func Put(host, path string, query map[string]string, requestParams, respModel interface{}) error

Put request implementation

func ReadErrorResponse

func ReadErrorResponse(StatusCode int, body []byte) error

ReadErrorResponse reads the error returned from the server if any

Types

type ErrorResponse

type ErrorResponse struct {
	StatusCode int      `json:"status_code"`
	ErrorCode  int      `json:"code"`
	Message    string   `json:"message"`
	Detail     []string `json:"detail"`
}

ErrorResponse defines the generic error response received from the server

Jump to

Keyboard shortcuts

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