stripeauth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(unixSocket string) *http.Client

NewHTTPClient returns a configured HTTP client.

Types

type Client

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

Client is the client used to initiate new CLI sessions with Stripe.

func NewClient

func NewClient(key string, cfg *Config) *Client

NewClient returns a new Client.

func (*Client) Authorize

func (c *Client) Authorize(deviceName string) (*StripeCLISession, error)

Authorize sends a request to Stripe to initiate a new CLI session.

type Config

type Config struct {
	Log *log.Logger

	HTTPClient *http.Client

	UnixSocket string

	URL string
}

Config contains the optional configuration parameters of a Client.

type StripeCLISession

type StripeCLISession struct {
	ReconnectDelay int    `json:"reconnect_delay"`
	Secret         string `json:"secret"`
	WebSocketID    string `json:"websocket_id"`
	WebSocketURL   string `json:"websocket_url"`
}

StripeCLISession is the API resource returned by Stripe when initiating a new CLI session.

Jump to

Keyboard shortcuts

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