sponsors

package module
v0.0.0-...-7b8247b Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 15 Imported by: 0

README

Sponsors API

Sponsors API is a GitHub Sponsors server for displaying sponsor avatars in your project Readme. It looks like this:

Deploying

Deploy to host which supports HTTP, for example using Apex Up or Heroku. The following environment variables are supported:

  • GITHUB_TOKEN the GitHub API token (no scopes are required)
  • PORT the server port (defaults to 3000)
  • URL the url to your endpoint such as "https://sponsors.myhost.com" (optional)

Usage

Visit the /sponsor/markdown path for the markdown to copy/paste. Sponsors are cached for an hour by default, tweak with the -cache-ttl flag.

Documentation

Overview

Package sponsors provides GitHub sponsors management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// URL is the url of the server.
	URL string

	// Client is the github client.
	Client *githubv4.Client

	// CacheTTL is the duration until the cache expires.
	CacheTTL time.Duration
	// contains filtered or unexported fields
}

Server manager.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implementation.

type Sponsor struct {
	// Name of the sponsor.
	Name string

	// Login name of the sponsor.
	Login string

	// AvatarURL of the sponsor.
	AvatarURL string
}

Sponsor model.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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