webhooks

package
v0.0.0-...-1b82985 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyRequest

func VerifyRequest(req *http.Request, secret string) error

Types

type Option

type Option func(s *Service)

func WithPort

func WithPort(v string) Option

func WithShopifyAPISecret

func WithShopifyAPISecret(v string) Option

func WithVerifyRequests

func WithVerifyRequests(v bool) Option

type Service

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

Shopify webhook handler. Syncs updates received via webhooks to the database.

func New

func New(h handler.Handler, opts ...Option) *Service

func (*Service) ProvisionSubscriptions

func (s *Service) ProvisionSubscriptions(shopClient *graphql.Client, callbackBaseURL string) error

func (*Service) Run

func (s *Service) Run() error

func (*Service) SetupRouter

func (s *Service) SetupRouter() *gin.Engine

func (*Service) VerificationRequired

func (s *Service) VerificationRequired(c *gin.Context)

type Subscriptions

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

Subscriptions collects the subscriptions to Shopify webhooks.

func (*Subscriptions) ProvisionSubscriptions

func (s *Subscriptions) ProvisionSubscriptions(topics []Topic) error

func (*Subscriptions) UnsubscribeFromAll

func (s *Subscriptions) UnsubscribeFromAll() error

type Topic

type Topic int
const (
	TopicProductsCreate Topic = iota
	TopicProductsUpdate
	TopicProductsDelete
)

Jump to

Keyboard shortcuts

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