request

package
v0.0.0-...-b6df729 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const UrlAPI = "%s://%s/rest/%s/%s"

Eg: http://192.168.0.1/rest/v1/

Variables

This section is empty.

Functions

func GetJson

func GetJson(host, path string) (string, error)

func GetUnmarshalled

func GetUnmarshalled[T any](host, path string, auth *Auth, result *T) error

func PostUnmarshalled

func PostUnmarshalled[T any](host, path string, auth *Auth, req *T) (*http.Response, error)

Types

type Auth

type Auth struct {
	Host string
	http.Cookie
}

func (*Auth) Login

func (a *Auth) Login() error

func (*Auth) Logout

func (a *Auth) Logout()

type CollectionResult

type CollectionResult struct {
	TotalElementsCount    int `json:"total_elements_count"`
	FilteredElementsCount int `json:"filtered_elements_count"`
}

Jump to

Keyboard shortcuts

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