core

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 1 Imported by: 0

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
)
View Source
const (
	// SucceededPush is log block
	SucceededPush = "succeeded-push"
	// FailedPush is log block
	FailedPush = "failed-push"
)
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

func IsLocalQueue

func IsLocalQueue(q Queue) bool

IsLocalQueue check is Local Queue

Types

type Health added in v1.16.0

type Health interface {
	// Check returns if server is healthy or not
	Check(c context.Context) (bool, error)
}

Health defines a health-check connection.

type Queue

type Queue string

Queue as backend

var (
	// LocalQueue for channel in Go
	LocalQueue Queue = "local"
	// NSQ a realtime distributed messaging platform
	NSQ Queue = "nsq"
	// NATS Connective Technology for Adaptive Edge & Distributed Systems
	NATS Queue = "nats"
	// Redis Pub/Sub
	Redis Queue = "redis"
)

type Storage added in v1.16.0

type Storage interface {
	Init() error
	Add(key string, count int64)
	Set(key string, count int64)
	Get(key string) int64
	Close() error
}

Storage interface

Jump to

Keyboard shortcuts

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