Documentation ¶
Index ¶
- type Client
- func (c *Client) AuthRep(apiCall threescale.Request) (*threescale.AuthorizeResult, error)
- func (c *Client) AuthRepWithOptions(apiCall threescale.Request, options ...Option) (*threescale.AuthorizeResult, error)
- func (c *Client) Authorize(apiCall threescale.Request) (*threescale.AuthorizeResult, error)
- func (c *Client) AuthorizeWithOptions(apiCall threescale.Request, options ...Option) (*threescale.AuthorizeResult, error)
- func (c *Client) GetPeer() string
- func (c *Client) GetVersion() (string, error)
- func (c *Client) Report(apiCall threescale.Request) (*threescale.ReportResult, error)
- func (c *Client) ReportWithOptions(apiCall threescale.Request, options ...Option) (*threescale.ReportResult, error)
- type InstrumentationCB
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client interacts with 3scale Service Management API and implements a threescale client
func NewClient ¶
NewClient returns a pointer to a Client providing some verification and sanity checking of the backendURL input. backendURL should take one of the following formats:
- http://example.com - provided scheme with no port
- https://example.com:443 - provided scheme and defined port
func NewDefaultClient ¶
NewDefaultClient returns a pointer to Client which is configured for 3scale SaaS platform.
func (*Client) AuthRep ¶
func (c *Client) AuthRep(apiCall threescale.Request) (*threescale.AuthorizeResult, error)
AuthRep should be used to authorize and report, in a single transaction for an application with the authentication provided in the transaction params
func (*Client) AuthRepWithOptions ¶
func (c *Client) AuthRepWithOptions(apiCall threescale.Request, options ...Option) (*threescale.AuthorizeResult, error)
AuthRepWithOptions provides the same behaviour as AuthRep with additional functionality provided by Option(s)
func (*Client) Authorize ¶
func (c *Client) Authorize(apiCall threescale.Request) (*threescale.AuthorizeResult, error)
Authorize is a read-only operation to authorize an application with the authentication provided in the transaction params
func (*Client) AuthorizeWithOptions ¶
func (c *Client) AuthorizeWithOptions(apiCall threescale.Request, options ...Option) (*threescale.AuthorizeResult, error)
AuthorizeWithOptions provides the same behaviour as Authorize with additional functionality provided by Option(s)
func (*Client) GetVersion ¶
GetVersion returns the version of the backend for this client (remote call)
func (*Client) Report ¶
func (c *Client) Report(apiCall threescale.Request) (*threescale.ReportResult, error)
func (*Client) ReportWithOptions ¶
func (c *Client) ReportWithOptions(apiCall threescale.Request, options ...Option) (*threescale.ReportResult, error)
ReportWithOptions provides the same behaviour as Report with additional functionality provided by Option(s)
type InstrumentationCB ¶
type InstrumentationCB func(ctx context.Context, hostName string, statusCode int, requestDuration time.Duration)
InstrumentationCB provides a callback hook into the client at response time to provide information about the underlying request to the remote host
type Option ¶
type Option func(*Options)
Option defines a callback function which is used to provide functional options to a request
func WithContext ¶
WithContext wraps the http transaction to 3scale backend with the provided context
func WithInstrumentationCallback ¶
func WithInstrumentationCallback(callback InstrumentationCB) Option
WithInstrumentationCallback allows the caller to provide an optional callback function that will be called in a separate goroutine, with the details of the underlying request to 3scale if present as an option