api

package
v0.5.31 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTPError httpError

Functions

This section is empty.

Types

type Client

type Client struct {
	*resty.Client
	Config
}

func NewClient

func NewClient(config *Config) *Client

func (*Client) Delete

func (c *Client) Delete(path string, options ...Option) (*jnode.Node, error)

func (*Client) Get

func (c *Client) Get(path string, options ...Option) (*jnode.Node, error)

func (*Client) GetAuthToken

func (c *Client) GetAuthToken() string

func (*Client) GetClient

func (c *Client) GetClient() *resty.Client

func (*Client) GetHostURL

func (c *Client) GetHostURL() string

func (*Client) GetOrganization

func (c *Client) GetOrganization() string

func (*Client) GetWithParams

func (c *Client) GetWithParams(path string, params map[string]string, options ...Option) (*jnode.Node, error)

func (*Client) Patch

func (c *Client) Patch(path string, body *jnode.Node, options ...Option) (*jnode.Node, error)

func (*Client) Post

func (c *Client) Post(path string, body *jnode.Node, options ...Option) (*jnode.Node, error)

func (*Client) XCPPost

func (c *Client) XCPPost(orgID string, module string, files []string, values map[string]string, options ...Option) (*jnode.Node, error)

type Config

type Config struct {
	Organization     string
	APIToken         string
	APIServer        string
	APIPrefix        string
	Debug            bool
	TLSNoVerify      bool
	Timeout          time.Duration
	RetryCount       int
	RetryWaitSeconds float64
	Headers          []string
}

type Option

type Option interface {
	Apply(*resty.Request)
}

func CloseableOptionFunc added in v0.5.9

func CloseableOptionFunc(f func(req *resty.Request), close func() error) Option

func OptionFunc added in v0.5.9

func OptionFunc(f func(*resty.Request)) Option

Jump to

Keyboard shortcuts

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