govapid

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

GOVAPID

GoDoc codecov Build Status Go Report Card

A micro-package to generate VAPID keys required for sending web push notifications, the package uses standard library dependencies only.

Usage

package main

import (
	"fmt"
	"github.com/AbdullahDiaa/govapid"
)

func main() {
	VAPIDkeys, err := govapid.GenerateVAPID()
	if err != nil {
		fmt.Println(err)
	}
	fmt.Printf("Public Key:%s\nPrivate Key:%s", VAPIDkeys.Public, VAPIDkeys.Private)
}

Documentation

You can view detailed documentation here: GoDoc.

Contributing

There are many ways to contribute:

Changelog

View the changelog for the latest updates and changes by version.

License

Apache License 2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Overview

Package govapid is a micro-package to generate VAPID public and private keys required for sending web push notifications, the package uses standard library dependencies only.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VAPIDKeys

type VAPIDKeys struct {
	Public  string
	Private string
}

VAPIDKeys contains the public and private VAPID keys

func GenerateVAPID

func GenerateVAPID() (VAPIDKeys, error)

GenerateVAPID will generate public and private VAPID keys

Example
VAPIDkeys, err := GenerateVAPID()
if err != nil {
	fmt.Println(err)
}
//fmt.Println(VAPIDkeys.Public, VAPIDkeys.Private)
fmt.Println(len(VAPIDkeys.Public), len(VAPIDkeys.Private))
Output:

87 43

Jump to

Keyboard shortcuts

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