restclient

package
v0.0.0-...-226c4f9 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 15 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 {
	Services map[string]Endpoint
	Token    string
	Debug    bool
}

func NewClient

func NewClient(endpoints []Endpoint, token string, debug bool) *Client

type Endpoint

type Endpoint struct {
	ID  string
	Url string
	// contains filtered or unexported fields
}

func (*Endpoint) Delete

func (e *Endpoint) Delete(pathAction string, params url.Values) (string, int, error)

func (*Endpoint) Get

func (e *Endpoint) Get(pathAction string, params url.Values, showPagination bool) (string, int, error)

func (*Endpoint) GetList

func (e *Endpoint) GetList(pathAction string, params url.Values) ([]interface{}, int, error)

func (*Endpoint) Post

func (e *Endpoint) Post(pathAction string, params url.Values, header http.Header, body string) (string, int, error)

func (*Endpoint) Put

func (e *Endpoint) Put(pathAction string, params url.Values, body string) (string, int, error)

type PagResp

type PagResp struct {
	Pagination Pagination    `json:"pagination"`
	Data       []interface{} `json:"data"`
}

type Pagination

type Pagination struct {
	Page    int `json:"page"`
	PerPage int `json:"per-page"`
	Pages   int `json:"pages"`
}

Jump to

Keyboard shortcuts

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