vapidkeys

package module
v0.0.0-...-465221a Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: MIT Imports: 3 Imported by: 1

README

go-vapidkeys

Build Status GoDoc Go Report Card

A small package in Go to generate VAPID public and private keys required for sending web push notifications (HTTP/2 Server Push).

Installation

go get github.com/anaskhan96/go-vapidkeys

Run go test in the package's directory to run tests.

Usage

package main

import (
	"fmt"
	"github.com/anaskhan96/go-vapidkeys"
	"log"
)

func main() {
	privateKey, publicKey, err := vapidkeys.Generate()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("Vapid Private Key:", privateKey)
	fmt.Println("Vapid Public Key:", publicKey)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate() (vapidPrivateKey string, vapidPublicKey string, err error)

Generate generates a new set of vapid keys and returns them along with the error message

Types

This section is empty.

Jump to

Keyboard shortcuts

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