Documentation ¶
Overview ¶
clientHelpers.go For utility/helper functions to support from the main package
request.go Provides functions to interact with the Jamf API.
Index ¶
- func PrintRequestHeaders(req *http.Request)
- type Authenticator
- type BasicAuthConfig
- type Client
- func (c *Client) DoRawRequest(api string, params *url.Values) (string, error)
- func (c *Client) DoRequest(method, api string, reqbody interface{}, params *url.Values, out interface{}) error
- func (c *Client) DoRequestDebug(method, api string, reqbody interface{}, params *url.Values, out interface{}) error
- type Config
- type Error
- type OAuthConfig
- type StatusCodeCategory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintRequestHeaders ¶
Print request headers for troubleshooting
Types ¶
type Authenticator ¶
type BasicAuthConfig ¶
func (BasicAuthConfig) Authenticate ¶
func (b BasicAuthConfig) Authenticate(c *Client) error
type Client ¶
type Client struct { HttpClient *http.Client HttpRetryTimeout time.Duration ExtraHeader map[string]string // contains filtered or unexported fields }
func (*Client) DoRawRequest ¶
DoRawRequest sends a GET request to the specified API endpoint and returns the raw string response. This function is specialized for handling raw string responses like extracting certificate public keys.
func (*Client) DoRequest ¶
func (c *Client) DoRequest(method, api string, reqbody interface{}, params *url.Values, out interface{}) error
DoRequest - A method to send a request to the jamf api
func (*Client) DoRequestDebug ¶
func (c *Client) DoRequestDebug(method, api string, reqbody interface{}, params *url.Values, out interface{}) error
DoRequestDebug provides complete debugging information during the request-response cycle. It uses createRequestDebug to create and log the request, then handles the HTTP call and response logging any necessary debugging information.
type OAuthConfig ¶
func (OAuthConfig) Authenticate ¶
func (o OAuthConfig) Authenticate(c *Client) error
type StatusCodeCategory ¶
type StatusCodeCategory int
const ( Success StatusCodeCategory = iota ClientError ServerError Unknown ClassicAPI = "/JSSResource" JamfProAPI = "/api" )