Documentation
¶
Index ¶
- func GetFcmTokens() map[string]string
- func SetPersistenceFile(filePath string)
- type ErrorResponse
- type Notification
- type PushOptionFunc
- type PushOutput
- func (p *PushOutput) GetAccessToken(ctx context.Context) error
- func (p *PushOutput) GetProjectId() error
- func (p *PushOutput) RegisterRoutes()
- func (p *PushOutput) Role() plugin.PluginType
- func (p *PushOutput) Start() error
- func (p *PushOutput) StartContext(ctx context.Context) error
- func (p *PushOutput) Stop() error
- type PushPayload
- type TokenRequest
- type TokenResponse
- type TokenStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFcmTokens ¶
GetFcmTokens returns a copy of the current in-memory FCM tokens
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 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 ¶
func New ¶
func New(options ...PushOptionFunc) (*PushOutput, error)
func (*PushOutput) GetAccessToken ¶
func (p *PushOutput) GetAccessToken(ctx context.Context) error
func (*PushOutput) GetProjectId ¶
func (p *PushOutput) GetProjectId() error
GetProjectId gets project ID from file
func (*PushOutput) RegisterRoutes ¶
func (p *PushOutput) RegisterRoutes()
func (*PushOutput) Role ¶ added in v0.46.0
func (p *PushOutput) Role() plugin.PluginType
Role identifies this plugin as a pipeline output.
func (*PushOutput) StartContext ¶ added in v0.46.0
func (p *PushOutput) StartContext(ctx context.Context) error
StartContext starts the plugin with ctx governing setup and run operations. Call Stop to wait for workers and release resources, including after cancellation.
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"`
}
TokenResponse represents an FCM token object.
@Produce json
@Success 200 {object} TokenResponse