webhooks

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidWebhook = errors.New("invalid webhook, metadata is empty")

ErrInvalidWebhook is returned when the webhook is invalid and cannot be processed by the processor due to missing metadata key

Functions

func New

func New() *processor

New creates a new webhooks processor instance

Types

type GithubSponsorTier

type GithubSponsorTier struct {
	CreatedAt             time.Time `json:"created_at"`
	Description           string    `json:"description"`
	MonthlyPriceInCents   int       `json:"monthly_price_in_cents"`
	MonthlyPriceInDollars int       `json:"monthly_price_in_dollars"`
	Name                  string    `json:"name"`
	IsOneTime             bool      `json:"is_one_time"`
	IsCustomAmount        bool      `json:"is_custom_amount"`
}

type GithubSponsorship

type GithubSponsorship struct {
	CreatedAt   time.Time `json:"created_at"`
	Sponsorable struct {
		Login     string `json:"login"`
		ID        int    `json:"id"`
		AvatarURL string `json:"avatar_url"`
		Type      string `json:"type"`
	} `json:"sponsorable"`
	Sponsor struct {
		Login     string `json:"login"`
		ID        int    `json:"id"`
		AvatarURL string `json:"avatar_url"`
		Type      string `json:"type"`
	} `json:"sponsor"`
	PrivacyLevel string            `json:"privacy_level"`
	Tier         GithubSponsorTier `json:"tier"`
}

type GithubSponsorshipWebhook

type GithubSponsorshipWebhook struct {
	// The action that was performed. This can be one of created, cancelled,
	// edited, tier_changed, pending_cancellation, or pending_tier_change.
	// Note: The created action is only triggered after payment is processed.
	Action      string            `json:"action"`
	Sponsorship GithubSponsorship `json:"sponsorship"`
	// The user that triggered the event.
	Sender struct {
		Login string `json:"login"`
		ID    int    `json:"id"`
	} `json:"sender"`
	// The pending_cancellation and pending_tier_change event types will
	// include the date the cancellation or tier change will take effect.
	EffectiveDate time.Time `json:"effective_date"`
	// The tier_changed and pending_tier_change will include the original
	// tier before the change or pending change. For more information,
	// see the pending tier change payload.
	Changes struct {
		Tier struct {
			From GithubSponsorTier `json:"from"`
		} `json:"tier"`
		// The edited event types include the details about the change when
		// someone edits a sponsorship to change the privacy.
		PrivacyLevel string `json:"privacy_level"`
	} `json:"changes"`
}

Source Files

  • campus_user.go
  • github.go
  • location.go
  • serve.go
  • user.go

Jump to

Keyboard shortcuts

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