model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const ExampleAppNotificationJSON = `` /* 323-byte string literal not displayed */
View Source
const ExampleAppNotificationYAML = `` /* 251-byte string literal not displayed */
View Source
const NotEnoughInfoInNotificationErrorMessage = "not enough information in net notification: missing appName, title, and/or timestamp"

Variables

View Source
var ExampleAppIDResponse = AppIDResponse{AppID: ExampleAppNotification.AppID}
View Source
var ExampleAppNotification = AppNotification{
	HashableNetNotification: ExampleHashableNetNotification,
	ID:                      "frGOwBO6bNL/kbixYn3eJ6xS8WAewHK7qzt8q1cLVLs=",
	ApiKey:                  "ApiKey",
}
View Source
var ExampleClientNotification = ClientNotification{
	HashableNetNotification: ExampleHashableNetNotification,
	ID:                      ExampleAppNotification.ID,
	Read:                    false,
}
View Source
var ExampleHashableNetNotification = HashableNetNotification{
	Timestamp:  "2022-06-14T22:22:22.000Z",
	AppName:    "AppName",
	AppID:      "AppID",
	AppImgURI:  "AppImgURI",
	Title:      "Title",
	Subtitle:   "Subtitle",
	Body:       "Body",
	ExtURI:     "ExtURI",
	ReadURI:    "ReadURI",
	ArchiveURI: "ArchiveURI",
}

Functions

This section is empty.

Types

type AppIDResponse

type AppIDResponse struct {
	AppID string `json:"appId"`
}

func AppIDResponseFromJSON

func AppIDResponseFromJSON(jsonBytes []byte) (AppIDResponse, error)

func AppIDResponseFromReader

func AppIDResponseFromReader(r io.Reader) (AppIDResponse, error)

func AppIDResponseOf

func AppIDResponseOf(appID string) AppIDResponse

func (AppIDResponse) ToJSON

func (a AppIDResponse) ToJSON() ([]byte, error)

type AppNotification

type AppNotification struct {
	HashableNetNotification `yaml:",inline"`
	ID                      string `json:"id,omitempty" yaml:"id,omitempty"`
	ApiKey                  string `json:"apiKey,omitempty" yaml:"apiKey,omitempty"`
}

func AddIDTo

func AppNotificationFromJSON

func AppNotificationFromJSON(r io.Reader) (AppNotification, error)

func AppNotificationFromYAML

func AppNotificationFromYAML(r io.Reader) (AppNotification, error)

func (AppNotification) ToJSON

func (n AppNotification) ToJSON() ([]byte, error)

func (AppNotification) ToYAML

func (n AppNotification) ToYAML() ([]byte, error)

type ClientNotification

type ClientNotification struct {
	HashableNetNotification `yaml:",inline"`
	ID                      string `json:"id" yaml:"id"`
	Read                    bool   `json:"read,omitempty" yaml:"read,omitempty"`
}

func ClientNotificationFromDomain

func ClientNotificationFromDomain(n domain.Notification) ClientNotification

func ClientNotificationFromJSON

func ClientNotificationFromJSON(jsonBytes []byte) (ClientNotification, error)

func (ClientNotification) ToJSON

func (c ClientNotification) ToJSON() ([]byte, error)

type Decoder

type Decoder interface {
	Decode(v any) error
}

type HashableNetNotification

type HashableNetNotification struct {
	Timestamp  string `json:"timestamp" yaml:"timestamp"`
	AppName    string `json:"appName" yaml:"appName"`
	AppID      string `json:"appId,omitempty" yaml:"appId,omitempty"`
	AppImgURI  string `json:"appImgUri,omitempty" yaml:"appImgUri,omitempty"`
	Title      string `json:"title" yaml:"title"`
	Subtitle   string `json:"subtitle,omitempty" yaml:"subtitle,omitempty"`
	Body       string `json:"body,omitempty" yaml:"body,omitempty"`
	ExtURI     string `json:"extUri,omitempty" yaml:"extUri,omitempty"`
	ReadURI    string `json:"readUri,omitempty" yaml:"readUri,omitempty"`
	ArchiveURI string `json:"archiveUri,omitempty" yaml:"archiveUri,omitempty"`
}

Jump to

Keyboard shortcuts

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