Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Haskell types and instances for decoding GitHub webhook payloads.

License

NotificationsYou must be signed in to change notification settings

cuedo/github-webhooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

github-webhooks Mascot
github-webhooks

GitHub release (latest by date)HackageLicense

Complete Haskell types and instances for decoding GitHub APIwebhook payloads.

Build Status

releasedevelop
Lintsscan-codescan-code
Ubuntutest-ubuntu-latesttest-ubuntu-latest
Mac OStest-macos-latesttest-macos-latest
Windowstest-windows-latesttest-windows-latest

Table of Contents

Features

github-webhooks comes with all the bells and whistles:

  • Best-in-class JSON Decoding viaAeson

    This library uses theaeson package, a fast and widely adopted Haskell library for working with JSON data. It ensures best-in-class JSON decoding, enabling you to parse GitHub webhooks payloads with high performance and accuracy.

  • i18n/Unicode String Support viaText

    github-webhooks has first-class support for Unicode strings in all functions via thetext package. This ensures that the library can handle any i18n text data in the payloads correctly, regardless of the character set.

  • Suitable for Large Data Payloads usingVector

    This library uses thevector package to handle large data payloads efficiently. This means it is suitable for big data workloads and capable of processing large amounts of data without excessive CPU or memory usage.

  • Type-safe Encoding of Optional Data

    Optional data in the payloads are encoded in a type-safe manner (i.e. usingMaybe). This ensures that your application will not encounter runtime errors due to missing or unexpected data and provides valuable signals during development where you should implement fault handling.

  • Type-safe Event Action Encodings with Support for Future API Changes

    This library encodes event actions in a type-safe manner that does not require the payload to be fully decoded. Thus, applications built using this library will generally be forward-compatible with future changes to the GitHub API and continue to work even if GitHub makes changes to the webhooks API.

  • Instances forTypeable,Data,Generic andNFData

    The data types in this library have instances forTypeable,Data,Generic, andNFData. This ensures compatibility with a wide range of Haskell libraries and metaprogramming tools.

  • Strongly Typed Utility ClassesEventHasSender,EventHasRepo et al.

    This library provides strongly typed utility classes such asEventHasSender andEventHasRepo to make it easier to work with the different event types and their associated data. You can define webhook event handlers that work on multiple events.

  • Strict Data Types Suitable for High Performance Streaming Operations

    The data types in this library are strict, making them suitable for high-performance streaming operations. This ensures that your application can process large streams of webhook events efficiently and without space leaks.

  • Full Support for Webhook Event Types

    github-webhooks provides full support forall the GitHub webhook event types. This means you can handle any event sent by GitHub without having to implement custom parsing or processing logic.

Installation

github-webhooks is available via installation onHackage andStackage.

Examples

Minimal interactive example:

Shell:

$ stack ghci bytestring aeson github-webhooksimportqualifiedData.ByteString.LazyasBSLimportData.Aeson           (eitherDecode' )json<-BSL.readFile"fixtures/watch-event.json"eitherDecode' json::EitherStringWatchEvent

Output:

Right (WatchEvent {  evWatchAction = WatchStartedAction,  evWatchRepo = HookRepository {    whRepoId = 35129377,    whRepoNodeId = "MDg6Q2hlY2tSdW4xMjg2MjAyMjg=",    whRepoName = "public-repo",    whRepoFullName = "baxterthehacker/public-repo",    whRepoOwner = Right (HookUser {      whUserLogin = "baxterthehacker",      whUserId = 6752317,      whUserNodeId = "MDg6Q2hlY2tSdW4xMjg2MjAyMjg=",      whUserAvatarUrl = URL "https://avatars.githubusercontent.com/u/6752317?v=3",...

Open in GitHub Codespaces

Getting started quickly

There are some turnkey integration tutorials in this repository:

Changelog

SeeCHANGELOG.md for a summary of changes in each release.

Roadmap

SeeROADMAP.md for the project timeline and feature estimation of future releases.

Authors

SeeAUTHORS for a list of significant authors.

Support

The best way to get free community support is to raise a well-written issue in this repository and one of the maintainers will endeavour to respond to it quickly.

If you are using a plugin i.e.servant-github-webhook, you might be able to get better support if you raise your issue against that project instead.

For enterprise support, you can write us:foss@cuedo.com.au.

License

github-webhooks is free open source software, however you must use it according to the MIT-styleLICENSE.

MIT LicenseCopyright (c) 2017-2023 CUEDO CONTROLS P/L (https://cuedo.com.au)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

Free open source software, sponsored by CUEDO CONTROLS P/L (cuedo.com.au).

CUEDO CONTROLS PTY LTD

Software defined mobility, just-so.

Sponsor this project

    Contributors12

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp