Documentation ¶
Index ¶
- Variables
- type APNSPusher
- type Info
- type Logic
- func (l *Logic) BindDevice(uid string, uuid string, key string, devType int) error
- func (l *Logic) CanFileStore() bool
- func (l *Logic) Close()
- func (l *Logic) Decrypt(data []byte) ([]byte, error)
- func (l *Logic) GetDeviceKey(uuid string) ([]byte, error)
- func (l *Logic) GetDevices(uid string) ([]*model.Device, error)
- func (l *Logic) GetInfo() ([]byte, string)
- func (l *Logic) GetQRCode() []byte
- func (l *Logic) GetUser(uid string) (*model.User, error)
- func (l *Logic) GetUserKey(uid string) ([]byte, error)
- func (l *Logic) GetWebhook(name string) (*Webhook, error)
- func (l *Logic) InitInfo()
- func (l *Logic) LoadFile(tname string, name string) ([]byte, error)
- func (l *Logic) SaveFile(tname string, data []byte) (string, error)
- func (l *Logic) SendAPNS(uid string, data []byte, devices []*model.Device, priority int, ...) (string, int)
- func (l *Logic) UnbindDevice(uid string, uuid string) error
- func (l *Logic) UpdatePushToken(uid string, uuid string, token string, sandbox bool) error
- func (l *Logic) UpsertUser(uid string, key string, serverless bool) (*model.User, error)
- func (l *Logic) VerifyToken(tk *model.Token) bool
- type Options
- type Webhook
Constants ¶
This section is empty.
Variables ¶
View Source
var ( APIEndpoint = "https://api.chanify.net" MockPusher APNSPusher = nil ErrNoSupportMethod = errors.New("no support method") ErrNotFound = errors.New("not found") ErrInvalidContent = errors.New("invalid content") ErrSystemLimited = errors.New("system limited") )
variable define
Functions ¶
This section is empty.
Types ¶
type APNSPusher ¶
type APNSPusher interface {
Push(n *apns2.Notification) (*apns2.Response, error)
}
APNSPusher is the interface of APNS2
type Info ¶
type Info struct { NodeID string `json:"nodeid"` Name string `json:"name,omitempty"` Version string `json:"version"` PublicKey string `json:"pubkey"` Endpoint string `json:"endpoint,omitempty"` Features []string `json:"features,omitempty"` }
Info for node server
type Logic ¶
type Logic struct { Name string NodeID string Version string Endpoint string Features []string // contains filtered or unexported fields }
Logic instance
func (*Logic) BindDevice ¶
BindDevice to user
func (*Logic) CanFileStore ¶ added in v1.0.5
CanFileStore return file stroage is available
func (*Logic) GetDeviceKey ¶ added in v1.0.0
GetDeviceKey return device key with device uuid
func (*Logic) GetDevices ¶
GetDevices return all devices with user id
func (*Logic) GetUserKey ¶
GetUserKey find user key with user id
func (*Logic) GetWebhook ¶ added in v1.3.4
GetWebhook with name
func (*Logic) InitInfo ¶ added in v1.0.5
func (l *Logic) InitInfo()
InitInfo calc all info data for node
func (*Logic) SendAPNS ¶
func (l *Logic) SendAPNS(uid string, data []byte, devices []*model.Device, priority int, interruptionLevel string, isTimeline bool) (string, int)
SendAPNS send message to APNS
func (*Logic) UnbindDevice ¶
UnbindDevice from user
func (*Logic) UpdatePushToken ¶
UpdatePushToken for APNS
func (*Logic) UpsertUser ¶
UpsertUser insert or update user info
Click to show internal directories.
Click to hide internal directories.