pwa

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: EUPL-1.2 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manifest added in v0.0.2

type Manifest struct {
	Name            string `json:"name"`
	ShortName       string `json:"short_name"`
	StartURL        string `json:"start_url"`
	Scope           string `json:"scope"`
	Display         string `json:"display"`
	BackgroundColor string `json:"background_color"`
	ThemeColor      string `json:"theme_color"`
	Description     string `json:"description"`
	Icons           []struct {
		Src   string `json:"src"`
		Sizes string `json:"sizes"`
		Type  string `json:"type"`
	} `json:"icons"`
	Screenshots []struct {
		Src   string `json:"src"`
		Sizes string `json:"sizes"`
		Type  string `json:"type"`
	} `json:"screenshots"`
	Shortcuts []struct {
		Name  string `json:"name"`
		URL   string `json:"url"`
		Icons []struct {
			Src string `json:"src"`
		} `json:"icons"`
	} `json:"shortcuts"`
	RelatedApplications []struct {
		Platform string `json:"platform"`
		URL      string `json:"url"`
		ID       string `json:"id"`
	} `json:"related_applications"`
	ServiceWorker struct {
		Src   string `json:"src"`
		Scope string `json:"scope"`
	} `json:"serviceworker"`
}

Manifest represents a PWA manifest with all common fields.

type MockPWAClient

type MockPWAClient struct {
	ManifestURL string
	DN          *datanode.DataNode
	Err         error
}

MockPWAClient is a mock implementation of the PWAClient interface.

func (*MockPWAClient) DownloadAndPackagePWA

func (m *MockPWAClient) DownloadAndPackagePWA(pwaURL, manifestURL string, bar *progressbar.ProgressBar) (*datanode.DataNode, error)

DownloadAndPackagePWA mocks the downloading and packaging of a PWA.

func (*MockPWAClient) FindManifest

func (m *MockPWAClient) FindManifest(pwaURL string) (string, error)

FindManifest mocks the finding of a PWA manifest.

type PWAClient

type PWAClient interface {
	FindManifest(pwaURL string) (string, error)
	DownloadAndPackagePWA(pwaURL, manifestURL string, bar *progressbar.ProgressBar) (*datanode.DataNode, error)
}

PWAClient is an interface for interacting with PWAs.

func NewMockPWAClient

func NewMockPWAClient(manifestURL string, dn *datanode.DataNode, err error) PWAClient

NewMockPWAClient creates a new MockPWAClient.

func NewPWAClient

func NewPWAClient() PWAClient

NewPWAClient creates a new PWAClient.

Jump to

Keyboard shortcuts

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