imux

package
v0.0.0-...-3bed8bd Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrImuxUnauthorized       = errors.New("imat unauthorized")
	ErrImuxUnknownDevice      = errors.New("device not registered on imux")
	ErrImuxConflict           = errors.New("registration conflict on imux")
	ErrImuxUnexpectedResponse = errors.New("unexpected error from imux")
)

Functions

This section is empty.

Types

type ApnsConfig

type ApnsConfig struct {
	Token []byte                `json:"token"`
	Key   ids.JSONRSAPrivateKey `json:"key"`
	Cert  ids.JSONCertificate   `json:"cert"`
}

FIXME: share with ids.Config

type DeviceConfig

type DeviceConfig struct {
	FCM          FCMConfig   `json:"fcm"`
	Apns         ApnsConfig  `json:"apns"`
	SecondaryReg *ApnsConfig `json:"secondary_reg,omitempty"`
}

FIXME: shared with imux

type FCMConfig

type FCMConfig struct {
	Token string `json:"token"`
}

type IMux

type IMux struct {
	// contains filtered or unexported fields
}

func NewIMux

func NewIMux(log *zerolog.Logger, url, imaToken, pushToken string, primaryIDSConfig, secondaryIDSConfig *ids.Config) *IMux

func (*IMux) Close

func (imux *IMux) Close()

func (*IMux) Deregister

func (imux *IMux) Deregister(ctx context.Context) error

func (*IMux) IsUsingApnsPushToken

func (imux *IMux) IsUsingApnsPushToken(token []byte) bool

func (*IMux) IsUsingFCMPushToken

func (imux *IMux) IsUsingFCMPushToken(token string) bool

func (*IMux) Start

func (imux *IMux) Start(ctx context.Context)

func (*IMux) Stop

func (imux *IMux) Stop(ctx context.Context)

type JSONDurationMs

type JSONDurationMs time.Duration

FIXME: shared with imux

func (*JSONDurationMs) UnmarshalJSON

func (t *JSONDurationMs) UnmarshalJSON(data []byte) error

type KeepaliveResponse

type KeepaliveResponse struct {
	Rate JSONDurationMs `json:"rate_ms"`
}

Jump to

Keyboard shortcuts

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