pnapClient

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(configPath string) error

Verify verifies existence of configuration file and credentials

Types

type PNAPClient

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

PNAPClient is a Client that performs HTTP requests.

func NewPNAPClient

func NewPNAPClient(auth dto.Authentication) PNAPClient

NewPNAPClient creates a new PNAPClient with forwarded credentials

func NewPNAPClientWithCustomConfig

func NewPNAPClientWithCustomConfig(path string) (PNAPClient, error)

NewPNAPClientWithCustomConfig creates a new PNAPClient. Verification of configuration will be done prior to creation and error will be returned in case credentials or whole configuration file is missing

func NewPNAPClientWithDefaultConfig

func NewPNAPClientWithDefaultConfig() (PNAPClient, error)

NewPNAPClientWithDefaultConfig creates a new PNAPClient. Verification of configuration will be done prior to creation and error will be returned in case credentials or whole configuration file is missing

func (PNAPClient) Delete

func (pnapClient PNAPClient) Delete(resource string) (*http.Response, error)

Delete performs a Delete request and check for auth errors

func (PNAPClient) Get

func (pnapClient PNAPClient) Get(resource string) (*http.Response, error)

Get performs a Get request and check for auth errors

func (PNAPClient) Post

func (pnapClient PNAPClient) Post(resource string, body io.Reader) (*http.Response, error)

Post performs a Post request and check for auth errors

func (PNAPClient) Put

func (pnapClient PNAPClient) Put(resource string, body io.Reader) (*http.Response, error)

Put performs a Put request and check for auth errors

func (PNAPClient) SetAuthentication

func (pnapClient PNAPClient) SetAuthentication(auth dto.Authentication)

SetAuthentication offers option to override initially set authentication object with new values

Jump to

Keyboard shortcuts

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