tautulli

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Base URL for API requests. Defaults to the public GitHub API, but can be
	// set to a domain endpoint to use with GitHub Enterprise. BaseURL should
	// always be specified with a trailing slash.
	BaseURL *url.URL
	// API Key for Tautulli
	APIKey string
	// User agent used when communicating with the GitHub API.
	UserAgent string

	Notifications *NotificationsService
	// contains filtered or unexported fields
}

A Client manages communication with the Tautulli API.

func NewClient

func NewClient(httpClient *http.Client, baseURL *url.URL, apiKey string) *Client

NewClient returns a new Tautulli API client. If a nil httpClient is provided, a new http.Client will be used.

func (*Client) Client

func (c *Client) Client() *http.Client

Client returns the http.Client used by this Tautulli client.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error)

Do sends an API request and returns the API response.

func (*Client) NewCommand

func (c *Client) NewCommand(command string, params interface{}) (*http.Request, error)

NewCommand creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

type CommonParameters

type CommonParameters struct {
	APIKey   string `url:"apikey"`   //
	Command  string `url:"cmd"`      //
	OutType  string `url:"out_type"` //
	Callback string `url:"callback"` //
	Debug    int    `url:"debug"`    //
}

CommonParameters are the parameters that are common to all requests.

type NotificationsService

type NotificationsService service

NotificationsService handles communication with the notification related methods of the Tautulli API.

func (*NotificationsService) Notify

Notify sends a notification using the Tautulli API.

type NotifyParameters

type NotifyParameters struct {
	NotifierID int    `url:"notifier_id"`           // The ID number of the notification agent
	Subject    string `url:"subject"`               // The subject of the message
	Body       string `url:"body"`                  // The body of the message
	Headers    string `url:"headers,omitempty"`     // Optional. The JSON headers for webhook notifications
	ScriptArgs string `url:"script_args,omitempty"` // Optional. The arguments for script notifications
}

NotifyParameters are parameters for sending a notification using the Tautulli API.

Jump to

Keyboard shortcuts

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