<commit_before>Go APNS Package
===============

This Go package implements the Apple Push Notification System (APNS) binary 
interface. 

Introduction
------------

This package aims to implement a light abstraction of the APNS binary interface 
for the Go programming language. The following are the design goals of this 
package:

1. Provide a minimal implementation necessary to communicate with APNS.
2. Use common interfaces in Go to allow for flexibility via composition.

Usage
-----

The various components responsible for the network and data format implement 
common interfaces such as `io.Writer`, `io.Reader` and `net.Conn`. Sending a 
push notification involves creating an `apns.Connection` to Apple's server and 
then writing to it an `apns.Notification`. 

    conn, err := apns.Connect(&cert, apns.DISTRIBUTION, false)
    notification := apns.NewSimpleNotification(token, payload)
    apns.Send(conn, notification)
    conn.Close()

Comparison with other implementations
-------------------------------------

There are already several APNS projects written in Go. The goal of this package 
is to implement the APNS interface in a style that is idiomatic to the Go 
programming language.

License
-------

Distribution and use of this project is governed by the [3-clause] Revised BSD 
license that can be found in the LICENSE file.

Further Reading
---------------

[Local and Push Notification Programming Guide. Mac Developer Library, Apple.](http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html)
[Apple Push Notification Service. Wikipedia](http://en.wikipedia.org/wiki/Apple_Push_Notification_Service)
[Optimizing Connections to the Apple Push Notification Service. Apple.](https://developer.apple.com/news/index.php?id=03212012a)<commit_msg>Fix newlines in markdown README file.<commit_after>Go APNS Package
===============

This Go package implements the Apple Push Notification System (APNS) binary 
interface. 

Introduction
------------

This package aims to implement a light abstraction of the APNS binary interface 
for the Go programming language. The following are the design goals of this 
package:

1. Provide a minimal implementation necessary to communicate with APNS.
2. Use common interfaces in Go to allow for flexibility via composition.

Usage
-----

The various components responsible for the network and data format implement 
common interfaces such as `io.Writer`, `io.Reader` and `net.Conn`. Sending a 
push notification involves creating an `apns.Connection` to Apple's server and 
then writing to it an `apns.Notification`. 

    conn, err := apns.Connect(&cert, apns.DISTRIBUTION, false)
    notification := apns.NewSimpleNotification(token, payload)
    apns.Send(conn, notification)
    conn.Close()

Comparison with other implementations
-------------------------------------

There are already several APNS projects written in Go. In contrast to most 
implementations, this package aims to expose a minimal functionality necessary 
for APNS communication. For this reason the basic abstraction adds very little 
on top of the APNS interface and is implemented in a way that allows one to use
selective parts of the package. For example, because a Notification writes to
an io.Writer one may elect to implement their own networking layer but continue 
to use the Notification implementations provided. 

The following is a list of notable Go implementations of APNS:

- [nicolaspaton/goapn](https://github.com/nicolaspaton/goapn)
- [mugenken/apnsender](https://github.com/mugenken/apnsender)
- [virushuo/Go-Apns](https://github.com/virushuo/Go-Apns)

Some non-Go APNS projects:

- [notnoop/java-apns](https://github.com/notnoop/java-apns)
- [jpoz/APNS](https://github.com/jpoz/APNS)
- [simonwhitaker/PyAPNs](https://github.com/simonwhitaker/PyAPNs)

License
-------

Distribution and use of this project is governed by the [3-clause] Revised BSD 
license that can be found in the LICENSE file.

Further Reading
---------------

- [Local and Push Notification Programming Guide. Mac Developer Library, Apple.](http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html)
- [Apple Push Notification Service. Wikipedia](http://en.wikipedia.org/wiki/Apple_Push_Notification_Service)
- [Optimizing Connections to the Apple Push Notification Service. Apple.](https://developer.apple.com/news/index.php?id=03212012a)
- [Nagle's algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm)
- [RFC 896 - Congestion Control in IP/TCP Internetworks. IETF.](http://tools.ietf.org/html/rfc896)
{'fraction_non_alphanumeric': 0.10972251641601356, 'fraction_numerical': 0.00593094683329803, 'mean_word_length': 4.088362068965517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '581491', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1220, 'n_words': 483}