manifest

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Icon

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

Icon is an app-manifest icon.

type Manifest

type Manifest struct {
	Name            string `json:"name"`
	ShortName       string `json:"short_name"`
	StartURL        string `json:"start_url"`
	Display         string `json:"display"`
	BackgroundColor string `json:"background_color"`
	Description     string `json:"description"`
	ThemeColor      string `json:"theme_color"`

	Icons []Icon `json:"icons"`
}

Manifest is a webapp manifest.

func New

func New() Manifest

New returns a new webapp manifest.

func (Manifest) Render

func (manifest Manifest) Render() []byte

Render returns a manifest as json encoded bytes.

func (*Manifest) SetDescription

func (manifest *Manifest) SetDescription(description string)

SetDescription sets the description of the application.

func (*Manifest) SetIcon

func (manifest *Manifest) SetIcon(path string)

SetIcon sets the icon for the application to be the image at the given path.

func (*Manifest) SetName

func (manifest *Manifest) SetName(name string)

SetName sets the name of this application.

func (*Manifest) SetShortName

func (manifest *Manifest) SetShortName(name string)

SetShortName set the short name of the application.

func (*Manifest) SetThemeColor

func (manifest *Manifest) SetThemeColor(c color.Color)

SetThemeColor sets the theme color of the application.

Jump to

Keyboard shortcuts

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