pushapitypes

package
v0.0.0-...-9835270 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: AGPL-3.0, Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PriorityMap = func() map[string]int {
	m := map[string]int{
		"underride": 1,
		"sender":    2,
		"room":      3,
		"content":   4,
		"override":  5,
	}
	return m
}
View Source
var PushTopicDef = "pushdata-topic"
View Source
var RevPriorityMap = func() map[int]string {
	m := map[int]string{
		1: "underride",
		2: "sender",
		3: "room",
		4: "content",
		5: "override",
	}
	return m
}

Functions

This section is empty.

Types

type Actions

type Actions struct {
	Actions []interface{} `json:"actions,omitempty"`
}

type Counts

type Counts struct {
	UnRead      int64 `json:"unread,omitempty"`
	MissedCalls int64 `json:"missed_calls,omitempty"`
}

type Device

type Device struct {
	DeviceID  string      `json:"device_id,omitempty"`
	UserName  string      `json:"user_name,omitempty"`
	AppId     string      `json:"app_id,omitempty"`
	PushKey   string      `json:"pushkey,omitempty"`
	PushKeyTs int64       `json:"pushkey_ts,omitempty"`
	Data      interface{} `json:"data"`
	Tweak     Tweaks      `json:"tweaks,omitempty"`
}

type EnabledType

type EnabledType struct {
	Enabled bool `json:"enabled"`
}

func (*EnabledType) Decode

func (p *EnabledType) Decode(input []byte) error

func (*EnabledType) Encode

func (p *EnabledType) Encode() ([]byte, error)

type GlobalRule

type GlobalRule struct {
	Device map[string]interface{} `json:"device"`
	Global RuleSet                `json:"global"`
}

func (*GlobalRule) Decode

func (p *GlobalRule) Decode(input []byte) error

func (*GlobalRule) Encode

func (p *GlobalRule) Encode() ([]byte, error)

type Notification

type Notification struct {
	EventId           string      `json:"event_id,omitempty"`
	RoomId            string      `json:"room_id,omitempty"`
	Type              string      `json:"type,omitempty"`
	Sender            string      `json:"sender,omitempty"`
	SenderDisplayName string      `json:"sender_display_name,omitempty"`
	RoomName          string      `json:"room_name,omitempty"`
	RoomAlias         string      `json:"room_alias,omitempty"`
	UserIsTarget      bool        `json:"user_is_target,omitempty"`
	Priority          string      `json:"prio,omitempty"`
	Content           interface{} `json:"content,omitempty"`
	Counts            Counts      `json:"counts,omitempty"`
	Devices           []Device    `json:"devices,omitempty"`
	CreateEvent       interface{} `json:"create_event,omitempty"`
}

type Notify

type Notify struct {
	Notify Notification `json:"notification,omitempty"`
}

type PushAck

type PushAck struct {
	Rejected []string `json:"rejected,omitempty"`
}

type PushActions

type PushActions struct {
	Actions []interface{} `json:"actions,omitempty"`
}

func (*PushActions) Decode

func (p *PushActions) Decode(input []byte) error

func (*PushActions) Encode

func (p *PushActions) Encode() ([]byte, error)

type PushCondition

type PushCondition struct {
	Kind    string `json:"kind,omitempty"`
	Key     string `json:"key,omitempty"`
	Pattern string `json:"pattern,omitempty"`
	Is      string `json:"is,omitempty"`
}

type PushContent

type PushContent struct {
	Content interface{} `json:"content"`
}

type PushContentUsers

type PushContentUsers struct {
	Data PushDataMembers `json:"data,omitempty"`
}

type PushDataMembers

type PushDataMembers struct {
	Members []string `json:"members,omitempty"`
}

type PushPubContent

type PushPubContent struct {
	Pushers     *Pushers     `json:"pushers,omitempty"`
	UserID      string       `json:"userID,omitempty"`
	Action      *TweakAction `json:"action,omitempty"`
	NotifyCount int64        `json:"notify_count"`
}

type PushPubContents

type PushPubContents struct {
	Input             *gomatrixserverlib.ClientEvent `json:"input,omitempty"`
	SenderDisplayName string                         `json:"senderDisplayName,omitempty"`
	RoomName          string                         `json:"roomName,omitempty"`
	RoomAlias         string                         `json:"roomAlias,omitempty"`
	Contents          []*PushPubContent              `json:"contents,omitempty"`
	CreateContent     *interface{}                   `json:"create_content"`
}

type PushRule

type PushRule struct {
	Actions    []interface{}   `json:"actions,omitempty"`
	Default    bool            `json:"default"`
	Enabled    bool            `json:"enabled"`
	RuleId     string          `json:"rule_id,omitempty"`
	Conditions []PushCondition `json:"conditions,omitempty"`
	Pattern    string          `json:"pattern,omitempty"`
}

func (*PushRule) Decode

func (p *PushRule) Decode(input []byte) error

func (*PushRule) Encode

func (p *PushRule) Encode() ([]byte, error)

type PushRuleCacheData

type PushRuleCacheData struct {
	UserName      string
	RuleId        string
	PriorityClass int
	Priority      int
	Conditions    []byte
	Actions       []byte
}

type PushRuleCacheDataArray

type PushRuleCacheDataArray []PushRuleCacheData

func (PushRuleCacheDataArray) Len

func (list PushRuleCacheDataArray) Len() int

func (PushRuleCacheDataArray) Less

func (list PushRuleCacheDataArray) Less(i, j int) bool

func (PushRuleCacheDataArray) Swap

func (list PushRuleCacheDataArray) Swap(i, j int)

type PushRuleData

type PushRuleData struct {
	UserName      string
	RuleId        string
	PriorityClass int
	Priority      int
	Conditions    []byte
	Actions       []byte
}

type PushRuleWithConditions

type PushRuleWithConditions struct {
	Actions    []interface{}   `json:"actions,omitempty"`
	Default    bool            `json:"default"`
	Enabled    bool            `json:"enabled"`
	RuleId     string          `json:"rule_id,omitempty"`
	Conditions []PushCondition `json:"conditions"`
	Pattern    string          `json:"pattern,omitempty"`
}

func (*PushRuleWithConditions) Decode

func (p *PushRuleWithConditions) Decode(input []byte) error

func (*PushRuleWithConditions) Encode

func (p *PushRuleWithConditions) Encode() ([]byte, error)

type PushRulesData

type PushRulesData struct {
	PushRules []PushRuleData
}

type Pusher

type Pusher struct {
	UserName          string      `json:"user_name,omitempty"`
	DeviceID          string      `json:"device_id,omitempty"`
	PushKey           string      `json:"pushkey,omitempty"`
	PushKeyTs         int64       `json:"pushkey_ts,omitempty"`
	Kind              string      `json:"kind,omitempty"`
	AppId             string      `json:"app_id,omitempty"`
	AppDisplayName    string      `json:"app_display_name,omitempty"`
	DeviceDisplayName string      `json:"device_display_name,omitempty"`
	ProfileTag        string      `json:"profile_tag,omitempty"`
	Lang              string      `json:"lang,omitempty"`
	Append            bool        `json:"append,omitempty"`
	Data              interface{} `json:"data,omitempty"`
}

type PusherCacheData

type PusherCacheData struct {
	UserName          string
	ProfileTag        string
	Kind              string
	AppId             string
	AppDisplayName    string
	DeviceDisplayName string
	PushKey           string
	PushKeyTs         int64
	Lang              string
	Data              string
	DeviceID          string
}

type PusherData

type PusherData interface{}

type PusherRes

type PusherRes struct {
	UserName  string `json:"user_name,omitempty"`
	AppId     string `json:"app_id,omitempty"`
	Kind      string `json:"kind,omitempty"`
	PushKey   string `json:"pushkey,omitempty"`
	PushKeyTs int64  `json:"ts,omitempty"`
	DeviceID  string `json:"device_id,omitempty"`
}

type PusherUsers

type PusherUsers struct {
	Users []string `json:"users,omitempty"`
}

type Pushers

type Pushers struct {
	Pushers []Pusher `json:"pushers"`
}

func (*Pushers) Decode

func (p *Pushers) Decode(input []byte) error

func (*Pushers) Encode

func (p *Pushers) Encode() ([]byte, error)

type PushersRes

type PushersRes struct {
	PushersRes []PusherRes `json:"pushers"`
}

func (*PushersRes) Decode

func (p *PushersRes) Decode(input []byte) error

func (*PushersRes) Encode

func (p *PushersRes) Encode() ([]byte, error)

type ReceiptContent

type ReceiptContent struct {
	Map map[string]ReceiptUser
}

type ReceiptTs

type ReceiptTs struct {
	Ts int64 `json:"ts"`
}

type ReceiptUser

type ReceiptUser struct {
	Users map[string]ReceiptTs `json:"m.read"`
}

type RoomReceipt

type RoomReceipt struct {
	RoomID   string
	EvID     string
	EvOffSet int64
	Content  *sync.Map //key:user, value: ts
}

type RuleSet

type RuleSet struct {
	Content   []interface{} `json:"content"`
	Override  []interface{} `json:"override"`
	Room      []interface{} `json:"room"`
	Sender    []interface{} `json:"sender"`
	UnderRide []interface{} `json:"underride"`
}

func (*RuleSet) Decode

func (p *RuleSet) Decode(input []byte) error

func (*RuleSet) Encode

func (p *RuleSet) Encode() ([]byte, error)

type Rules

type Rules struct {
	Content   []PushRule `json:"content"`
	Override  []PushRule `json:"override"`
	Room      []PushRule `json:"room"`
	Sender    []PushRule `json:"sender"`
	UnderRide []PushRule `json:"underride"`
}

type Tweak

type Tweak struct {
	SetTweak string      `json:"set_tweak,omitempty"`
	Value    interface{} `json:"value,omitempty"`
}

type TweakAction

type TweakAction struct {
	Notify    string
	Sound     string
	HighLight bool
}

type Tweaks

type Tweaks struct {
	Sound     string `json:"sound,omitempty"`
	HighLight bool   `json:"highlight,omitempty"`
}

Jump to

Keyboard shortcuts

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