proxy

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// DeviceName is the name of the device sent to Stripe to help identify the device
	DeviceName string

	// Key is the API key used to authenticate with Stripe
	Key string

	// EndpointsMap is a mapping of local webhook endpoint urls to the events they consume
	EndpointsMap map[string][]string

	APIBaseURL string

	// WebSocketURL is the websocket URL used to receive incoming events
	WebSocketURL string

	// Indicates whether to print full JSON objects to stdout
	PrintJSON bool

	// Indicates whether to filter events formatted with the default or latest API version
	UseLatestAPIVersion bool

	Log *log.Logger

	// Force use of unencrypted ws:// protocol instead of wss://
	NoWSS bool
}

Config provides the cfguration of a Proxy

type Proxy

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

A Proxy opens a websocket connection with Stripe, listens for incoming webhook events, forwards them to the local endpoint and sends the response back to Stripe.

func New

func New(cfg *Config) *Proxy

New creates a new Proxy

func (*Proxy) Run

func (p *Proxy) Run() error

Run sets the websocket connection and starts the Goroutines to forward incoming events to the local endpoint.

Jump to

Keyboard shortcuts

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