GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tinode/pushtype

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
iid
iid
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
typedef.go
typedef.go
 
 

Repository files navigation

pushtype — Common push types and error definitions 🔧

TL;DR

This package contains shared type definitions and constants used by both the Tinode Push Gateway (TNPG) and the FCM push implementation. It centralizes payload shapes (notifications/data), configuration helpers, and canonical error codes returned by push adapters.

Contents

  • Payload — notification payload fields used for Android, iOS (APNS), and web pushes.
  • Config — per-notification-type defaults and helpers (GetStringField, GetIntField).
  • TNPGResponse — standardized per-message response returned by the push gateway adapters (fields: MessageID, Code, ErrorCode, ErrorMessage, Index).
  • Action constants — ActMsg, ActSub, ActRead (message, subscription, read).
  • Platform enums/constants — Android visibility, notification priorities, APNS headers and push types.
  • FCM error constants — canonical string error codes (e.g., ErrorUnregistered, ErrorInvalidArgument, ErrorQuotaExceeded) used by adapters to normalize Google API errors.

Usage

Import the package and reference the shared types:

import "github.com/tinode/pushtype"

var p pushtype.Payload

// or a TNPG response
var resp pushtype.TNPGResponse

Adapters should use the constants here to map provider errors to stable values consumed by the rest of the system.

Notes & Best Practices 💡

  • Keep mapping logic in adapters (e.g., decoding Google API errors) and map to the constants in this package so the rest of the system has a stable error vocabulary.
  • Use Config helpers to centralize defaults and avoid duplicated field lookups across adapters.
  • When adding new error codes, include a short comment describing when it is used and how to recover (if applicable).

If you want, I can add a short example showing how to map a Google API error into a TNPGResponse using the constants in this package. ✅

About

No description, website, or topics provided.

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.