push

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFcmTokens

func GetFcmTokens() map[string]string

GetFcmTokens returns a copy of the current in-memory FCM tokens

func NewFromCmdlineOptions

func NewFromCmdlineOptions() plugin.Plugin

func SetPersistenceFile added in v0.37.0

func SetPersistenceFile(filePath string)

SetPersistenceFile configures the file path for token persistence If called with a non-empty path, tokens will be loaded from and saved to this file

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse represents a generic error response.

type Notification

type Notification struct {
	Message  string   `json:"message"`
	Tokens   []string `json:"tokens"`
	Platform int      `json:"platform"`
}

type PushOptionFunc

type PushOptionFunc func(*PushOutput)

func WithAccessTokenUrl

func WithAccessTokenUrl(url string) PushOptionFunc

func WithLogger

func WithLogger(logger plugin.Logger) PushOptionFunc

WithLogger specifies the logger object to use for logging messages

func WithServiceAccountFilePath

func WithServiceAccountFilePath(serviceAccountFilePath string) PushOptionFunc

func WithTokenProvider added in v0.44.0

func WithTokenProvider(tp tokenProvider) PushOptionFunc

type PushOutput

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

func New

func New(options ...PushOptionFunc) (*PushOutput, error)

func (*PushOutput) ErrorChan

func (p *PushOutput) ErrorChan() <-chan error

ErrorChan returns the plugin's error channel

func (*PushOutput) GetAccessToken

func (p *PushOutput) GetAccessToken() error

func (*PushOutput) GetProjectId

func (p *PushOutput) GetProjectId() error

GetProjectId gets project ID from file

func (*PushOutput) InputChan

func (p *PushOutput) InputChan() chan<- event.Event

InputChan returns the input event channel

func (*PushOutput) OutputChan

func (p *PushOutput) OutputChan() <-chan event.Event

OutputChan always returns nil

func (*PushOutput) RegisterRoutes

func (p *PushOutput) RegisterRoutes()

func (*PushOutput) Start

func (p *PushOutput) Start() error

func (*PushOutput) Stop

func (p *PushOutput) Stop() error

Stop the embedded output

type PushPayload

type PushPayload struct {
	Notifications []Notification `json:"notifications"`
}

type TokenRequest

type TokenRequest struct {
	FCMToken string `json:"fcmToken" validate:"required"`
}

TokenRequest represents a request containing an FCM token. FCMToken is required; enforced explicitly in storeFCMToken. The validate:"required" tag carries no runtime validation (no validator is wired) — it exists so swag emits the field as required in the OpenAPI docs.

type TokenResponse

type TokenResponse struct {
	FCMToken string `json:"fcmToken"`
}

Token represents an FCM token object.

@Produce	json
@Success	200	{object}	TokenResponse

type TokenStore

type TokenStore struct {
	FCMTokens map[string]string `json:"fcm_tokens"`
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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