manifest

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2019 License: MIT Imports: 2 Imported by: 1

README

manifest

Godoc Report Tests Coverage Sponsor

Utilities for dealing with web manifests.

Style

Please take a look at the style guidelines if you'd like to make a pull request.

Sponsors

Cedric Fung Scott Rayapoullé Eduard Urbach
Cedric Fung Scott Rayapoullé Eduard Urbach

Want to see your own name here?

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Icon added in v0.1.1

type Icon struct {
	Source string `json:"src"`
	Sizes  string `json:"sizes"`
	Type   string `json:"type,omitempty"`
}

Icon represents a single icon in the web manifest.

type Manifest

type Manifest struct {
	Name            string         `json:"name"`
	ShortName       string         `json:"short_name"`
	Description     string         `json:"description,omitempty"`
	Icons           []Icon         `json:"icons,omitempty"`
	StartURL        string         `json:"start_url"`
	Display         string         `json:"display"`
	Orientation     string         `json:"orientation,omitempty"`
	Language        string         `json:"lang,omitempty"`
	ThemeColor      string         `json:"theme_color,omitempty"`
	BackgroundColor string         `json:"background_color,omitempty"`
	TextDirection   string         `json:"dir,omitempty"`
	ServiceWorker   *ServiceWorker `json:"serviceworker,omitempty"`
	ScreenShots     []ScreenShot   `json:"screenshots,omitempty"`
}

Manifest represents a web manifest

func FromFile added in v0.1.2

func FromFile(fileName string) (*Manifest, error)

FromFile creates a new manifest.

func New

func New() *Manifest

New creates a new manifest.

type ScreenShot added in v0.1.1

type ScreenShot = Icon

ScreenShot represents a screenshot definition in the web manifest.

type ServiceWorker added in v0.1.1

type ServiceWorker struct {
	Source         string `json:"src"`
	Scope          string `json:"scope"`
	UpdateViaCache string `json:"update_via_cache"`
}

ServiceWorker represents a service worker definition in the web manifest.

Jump to

Keyboard shortcuts

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