Documentation
¶
Index ¶
Constants ¶
View Source
const ( // PlatFormIos constant is 1 for iOS PlatFormIos = iota + 1 // PlatFormAndroid constant is 2 for Android PlatFormAndroid // PlatFormHuawei constant is 3 for Huawei PlatFormHuawei )
Backward-compatible integer constants kept as-is.
View Source
const ( // SucceededPush is log block SucceededPush = "succeeded-push" // FailedPush is log block FailedPush = "failed-push" )
Log block string constants (backward-compatible)
View Source
const ( // TotalCountKey is key name for total count of storage TotalCountKey = "gorush-total-count" // IosSuccessKey is key name or ios success count of storage /* #nosec */ IosSuccessKey = "gorush-ios-success-count" // IosErrorKey is key name or ios success error of storage IosErrorKey = "gorush-ios-error-count" // AndroidSuccessKey is key name for android success count of storage AndroidSuccessKey = "gorush-android-success-count" // AndroidErrorKey is key name for android error count of storage AndroidErrorKey = "gorush-android-error-count" // HuaweiSuccessKey is key name for huawei success count of storage HuaweiSuccessKey = "gorush-huawei-success-count" // HuaweiErrorKey is key name for huawei error count of storage HuaweiErrorKey = "gorush-huawei-error-count" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Health ¶
type Health interface {
// Check returns if server is healthy or not
Check(c context.Context) (bool, error)
}
Health defines a health-check connection.
type LogBlock ¶ added in v1.21.0
type LogBlock string
LogBlock is a typed alias for log block kinds.
const ( LogSucceededPush LogBlock = LogBlock(SucceededPush) LogFailedPush LogBlock = LogBlock(FailedPush) )
type Platform ¶ added in v1.21.0
type Platform uint8
Platform is a typed enum for push target platforms. This complements the existing integer constants.
const ( // Typed equivalents of platform values. PlatformIOS Platform = Platform(PlatFormIos) PlatformAndroid Platform = Platform(PlatFormAndroid) PlatformHuawei Platform = Platform(PlatFormHuawei) )
func ParsePlatform ¶ added in v1.21.0
ParsePlatform parses a string (case-insensitive) into a Platform.
func (Platform) MarshalJSON ¶ added in v1.21.0
MarshalJSON encodes Platform as a JSON string.
func (Platform) MarshalText ¶ added in v1.21.0
MarshalText encodes Platform as its string form.
func (*Platform) UnmarshalJSON ¶ added in v1.21.0
UnmarshalJSON decodes Platform from a JSON string or legacy number.
func (*Platform) UnmarshalText ¶ added in v1.21.0
UnmarshalText decodes Platform from its string form.
Click to show internal directories.
Click to hide internal directories.