server

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2016 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PUSH_NOTIFY_APPLE   = "apple"
	PUSH_NOTIFY_ANDROID = "android"
)
View Source
const (
	HEADER_FORWARDED = "X-Forwarded-For"
	HEADER_REAL_IP   = "X-Real-IP"
)

Variables

This section is empty.

Functions

func FindConfigFile

func FindConfigFile(fileName string) string

func GetIpAddress

func GetIpAddress(r *http.Request) string

func LoadConfig

func LoadConfig(fileName string)

func Log

func Log(level string, msg string)

func LogCritical

func LogCritical(msg string)

func LogError

func LogError(msg string)

func LogInfo

func LogInfo(msg string)

func Start

func Start()

func Stop

func Stop()

Types

type ConfigPushProxy

type ConfigPushProxy struct {
	ListenAddress           string
	ApplePushServer         string
	ApplePushCertPublic     string
	ApplePushCertPrivate    string
	AndroidApiKey           string
	ThrottlePerSec          int
	ThrottleMemoryStoreSize int
	ThrottleVaryByHeader    string
}

type PushNotification

type PushNotification struct {
	Platform         string `json:"platform"`
	ServerId         string `json:"server_id"`
	DeviceId         string `json:"device_id"`
	Category         string `json:"category"`
	Sound            string `json:"sound"`
	Message          string `json:"message"`
	Badge            int    `json:"badge"`
	ContentAvailable int    `json:"cont_ava"`
	ChannelId        string `json:"channel_id"`
	ChannelName      string `json:"channel_name"`
}

func PushNotificationFromJson

func PushNotificationFromJson(data io.Reader) *PushNotification

func (*PushNotification) ToJson

func (me *PushNotification) ToJson() string

Jump to

Keyboard shortcuts

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