Skip to content

Comments

chore(core): typed Platform enum + JSON/Text codecs#853

Merged
appleboy merged 4 commits intoappleboy:masterfrom
miladev95:feat/core-typed-platform-enum-logblock
Dec 13, 2025
Merged

chore(core): typed Platform enum + JSON/Text codecs#853
appleboy merged 4 commits intoappleboy:masterfrom
miladev95:feat/core-typed-platform-enum-logblock

Conversation

@miladev95
Copy link
Contributor

Introduce a typed Platform enum with helpers and codecs while preserving legacy constants for compatibility. Add a typed LogBlock with validation.

Changes

  • Add Platform (PlatformIOS, PlatformAndroid, PlatformHuawei) with String(), IsValid(), ParsePlatform(string).
  • Add MarshalText/UnmarshalText and MarshalJSON/UnmarshalJSON for Platform (supports legacy numeric 1/2/3).
  • Add LogBlock with LogSucceededPush, LogFailedPush and IsValid().
  • Keep legacy constants PlatFormIos, PlatFormAndroid, PlatFormHuawei, SucceededPush, FailedPush.
  • Add focused tests in core/core_test.go.

Backward compatibility

  • Existing code using legacy constants continues to work. New typed APIs are opt‑in.

@appleboy
Copy link
Owner

appleboy commented Dec 7, 2025

I will take a look.

@appleboy appleboy changed the title typed Platform enum + JSON/Text codecs and LogBlock (backward compatible) chore(core): typed Platform enum + JSON/Text codecs Dec 13, 2025
@appleboy appleboy merged commit e68b77f into appleboy:master Dec 13, 2025
11 checks passed
@miladev95 miladev95 deleted the feat/core-typed-platform-enum-logblock branch December 13, 2025 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants