Skip to content

victorpopkov/go-appcast

Repository files navigation

go-appcast

Travis (.org) Codecov Go Report Card GoDoc

An extendable library which provides functionality for working with different appcasts. It can work in both ways: retrieve data from an already existing appcast (unmarshal) or generate an appcast from the provided data (marshal).

What "appcast" means?

The word "appcast" is usually referred to a remote web page providing information about software updates. This kind of pages is usually created for different software update frameworks like Sparkle or generated by different services that distribute applications (GitHub, SourceForge and etc.).

There are plenty of different methods available, but originally "appcasting" was the practice of using an RSS enclosure to distribute updates and release notes.

What this library does?

As you can find plenty of different ways how vendors distribute their software updates it becomes pretty tedious to extract useful information from their appcasts. Especially, considering the idea that sometimes you would like to transpile one appcast type into another or simply make changes into an already existing one.

Here comes this library handy. It provides the core functionality for working with the supported providers in a reliable and consistent way. In addition, it was designed to be extendable which enables you adding more features or extend the supported providers, sources and even outputs to match your needs.

Features

  • Designed to be extendable
  • Detect release stability from the semantic version
  • Different outputs to save to
  • Different sources to load from
  • Filter releases by stability, title, media type or download URL
  • Guess the supported provider
  • Sort releases by version
  • Transpilation from one provider into another

Providers

Out of the box, 3 providers are supported:

Each provider can be used separately by explicitly importing only those packages you are going to use. This is useful when you don't need any extra stuff in your project and you know which appcast provider you are dealing with.

In other cases importing a single github.com/victorpopkov/go-appcast is the best option. This will give you all the necessary functionality to work with the supported providers as it will automatically detect which is used and then call the appropriate methods.

GitHub Atom Feed

Each project that uses GitHub releases to distribute applications has its own Atom Feed available that can be considered as an appcast.

A good example url is an Atom releases: https://www.adium.im/sparkle/appcast-release.xml. You can find the corresponding GoDoc examples below:

SourceForge RSS Feed

Each project hosted on SourceForge has its own releases RSS feed available that can be considered to be an appcast.

As an example you can take a look at the FileZilla SourceForge releases page here: https://sourceforge.net/projects/filezilla/rss. You can find the corresponding GoDoc examples below:

Sparkle RSS Feed

Appcasts, created by the Sparkle Framework. Originally, Sparkle was created to distribute software updates for macOS applications. However, for Windows, there is a WinSparkle framework which uses the same RSS enclosure technique to distribute updates and release notes.

A good example is how the Adium distributes software updates: https://www.adium.im/sparkle/appcast-release.xml. You can find the corresponding GoDoc examples below:

Sources

Out of the box, 2 sources are supported:

This means that you have by default 2 options from where an appcast can be loaded. You can just choose the appropriate one from the source package or create your own.

You can find a GoDoc standalone package example here: import "github.com/victorpopkov/go-appcast/source". In addition, by digging into the "Providers" you can see how to use them alongside with an appcast in their examples:

source.Remote

This was designed to retrieve an appcast data from the remote location by URL. It should cover most use cases when the appcast is available remotely.

For convenience purposes an Appcast.LoadFromRemoteSource can be used when using the default appcast package. It sets the Appcast to use the source.Remote, loads the source and unmarshals it.

source.Local

This was designed to retrieve an appcast data from the local file by path.

For convenience purposes an Appcast.LoadFromLocalSource can be used when using the default appcast package. It sets the Appcast to use the source.Local, loads the source and unmarshals it.

Outputs

Out of the box, only a single output.Local is available to save an appcast to the local file.

Just like the "Sources", outputs are designed in the same way meaning that you can extend the list of the supported outputs by creating your own.

You can find a GoDoc standalone package example here: import "github.com/victorpopkov/go-appcast/output". In addition, by digging into the "Providers" you can see how to use them alongside with an appcast in their "Marshal" examples:

License

Released under the MIT License.