client

package
v0.0.0-...-02d28e6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(c *Client, endpoint, accept, module string) (string, error)

func Get

func Get[T any](c *Client, endpoint, accept, module string) (*T, error)

func GetWithETag

func GetWithETag[T any](c *Client, endpoint, accept, module string) (*T, string, error)

func Post

func Post[P any, R any](c *Client, payload *P, endpoint string, accept string, module string) (*R, error)

func Put

func Put[P any, R any](c *Client, payload *P, eTag, endpoint, accept, module string) (*R, error)

Types

type AuthType

type AuthType uint8
const (
	None AuthType = iota
	Basic
	AccessToken
)

type Client

type Client struct {
	ServerURL  *url.URL
	HttpClient *http.Client
	Debug      bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, server *url.URL) *Client

func (*Client) SetAccessToken

func (c *Client) SetAccessToken(token string)

func (*Client) SetBasicAuth

func (c *Client) SetBasicAuth(user, password string)

Jump to

Keyboard shortcuts

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