user

package
v0.0.0-...-db0aad3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	BindAlias(ctx context.Context, list *AliasList, token string) error
	QueryAliasByCid(ctx context.Context, cid string, token string) (string, error)
	QueryCidByAlias(ctx context.Context, alias string, token string) ([]string, error)
	UnbindAlias(ctx context.Context, list *AliasList, token string) error
	RevokeAlias(ctx context.Context, alias string, token string) error
	BindUserWithTag(ctx context.Context, cid string, list *CustomTagList, token string) error
	BindTagWithUser(ctx context.Context, tag string, list *CidList, token string) (map[string]bool, error)
	UnbindTagFromUser(ctx context.Context, tag string, list *CidList, token string) (map[string]bool, error)
	QueryUserTag(ctx context.Context, cid string, token string) ([]string, error)
	AddBlackList(ctx context.Context, cidList []string, token string) error
	DelBlackList(ctx context.Context, cidList []string, token string) error
	QueryUserStatus(ctx context.Context, cidList []string, token string) (map[string]map[string]string, error)
	QueryDeviceStatus(ctx context.Context, cidList []string, token string) (map[string]map[string]string, error)
	QueryUserInfo(ctx context.Context, cidList []string, token string) ([]string, map[string]map[string]string, error)
	SetPushBadge(ctx context.Context, cidList []string, op *Operation, token string) error
	QueryUserCount(ctx context.Context, list *ComplexTagList, token string) (int, error)
	ManageCidAndDeviceToken(ctx context.Context, manufacturer string, dtList *CidAndDeviceTokenList, token string) ([]*DTError, error)
	Close()
}

type AgentMgr

type AgentMgr struct {
	// contains filtered or unexported fields
}

func NewUserMgr

func NewUserMgr() (*AgentMgr, error)

func (*AgentMgr) AddBlackList

func (m *AgentMgr) AddBlackList(ctx context.Context, uniqueId core.UniqueId, cidList []string, token string) error

func (*AgentMgr) BindAlias

func (m *AgentMgr) BindAlias(ctx context.Context, uniqueId core.UniqueId, list *AliasList, token string) error

func (*AgentMgr) BindTagWithUser

func (m *AgentMgr) BindTagWithUser(ctx context.Context, uniqueId core.UniqueId, tag string, list *CidList, token string) (map[string]bool, error)

func (*AgentMgr) BindUserWithTag

func (m *AgentMgr) BindUserWithTag(ctx context.Context, uniqueId core.UniqueId, cid string, list *CustomTagList, token string) error

func (*AgentMgr) Close

func (m *AgentMgr) Close()

func (*AgentMgr) DelBlackList

func (m *AgentMgr) DelBlackList(ctx context.Context, uniqueId core.UniqueId, cidList []string, token string) error

func (*AgentMgr) ManageCidAndDeviceToken

func (m *AgentMgr) ManageCidAndDeviceToken(ctx context.Context, uniqueId core.UniqueId, manufacturer string, dtList *CidAndDeviceTokenList, token string) ([]*DTError, error)

func (*AgentMgr) QueryAliasByCid

func (m *AgentMgr) QueryAliasByCid(ctx context.Context, uniqueId core.UniqueId, cid string, token string) (string, error)

func (*AgentMgr) QueryCidByAlias

func (m *AgentMgr) QueryCidByAlias(ctx context.Context, uniqueId core.UniqueId, alias string, token string) ([]string, error)

func (*AgentMgr) QueryDeviceStatus

func (m *AgentMgr) QueryDeviceStatus(ctx context.Context, uniqueId core.UniqueId, cidList []string, token string) (map[string]map[string]string, error)

func (*AgentMgr) QueryUserCount

func (m *AgentMgr) QueryUserCount(ctx context.Context, uniqueId core.UniqueId, list *ComplexTagList, token string) (int, error)

func (*AgentMgr) QueryUserInfo

func (m *AgentMgr) QueryUserInfo(ctx context.Context, uniqueId core.UniqueId, cidList []string, token string) ([]string, map[string]map[string]string, error)

func (*AgentMgr) QueryUserStatus

func (m *AgentMgr) QueryUserStatus(ctx context.Context, uniqueId core.UniqueId, cidList []string, token string) (map[string]map[string]string, error)

func (*AgentMgr) QueryUserTag

func (m *AgentMgr) QueryUserTag(ctx context.Context, uniqueId core.UniqueId, cid string, token string) ([]string, error)

func (*AgentMgr) RegisterAgent

func (m *AgentMgr) RegisterAgent(uniqueId core.UniqueId, agent Agent) error

func (*AgentMgr) RevokeAlias

func (m *AgentMgr) RevokeAlias(ctx context.Context, uniqueId core.UniqueId, alias string, token string) error

func (*AgentMgr) SetPushBadge

func (m *AgentMgr) SetPushBadge(ctx context.Context, uniqueId core.UniqueId, cidList []string, op *Operation, token string) error

func (*AgentMgr) UnbindAlias

func (m *AgentMgr) UnbindAlias(ctx context.Context, uniqueId core.UniqueId, list *AliasList, token string) error

func (*AgentMgr) UnbindTagFromUser

func (m *AgentMgr) UnbindTagFromUser(ctx context.Context, uniqueId core.UniqueId, tag string, list *CidList, token string) (map[string]bool, error)

type AliasList

type AliasList struct {
	DataList []*DataList `json:"data_list"`
}

type CidAndDeviceTokenList

type CidAndDeviceTokenList struct {
	DTList []*DT `json:"dt_list"`
}

type CidList

type CidList struct {
	CidList []string `json:"cid"`
}

type ComplexTagList

type ComplexTagList struct {
	Tag []*Tag `json:"tag"`
}

type CustomTagList

type CustomTagList struct {
	TagList []string `json:"custom_tag"`
}

type DT

type DT struct {
	Cid         string `json:"cid"`
	DeviceToken string `json:"device_token"`
}

type DTError

type DTError struct {
	Cid         string `json:"cid"`
	DeviceToken string `json:"device_token"`
	ErrorCode   int    `json:"error_code"`
}

type DataList

type DataList struct {
	Cid   string `json:"cid"`
	Alias string `json:"alias"`
}

type GeTuiUser

type GeTuiUser struct {
	// contains filtered or unexported fields
}

func NewGeTuiUser

func NewGeTuiUser(apiUrl, appId string, hc *http.Client) (*GeTuiUser, error)

func (*GeTuiUser) AddBlackList

func (g *GeTuiUser) AddBlackList(ctx context.Context, cidList []string, token string) error

func (*GeTuiUser) BindAlias

func (g *GeTuiUser) BindAlias(ctx context.Context, list *AliasList, token string) error

func (*GeTuiUser) BindTagWithUser

func (g *GeTuiUser) BindTagWithUser(ctx context.Context, tag string, list *CidList, token string) (map[string]bool, error)

func (*GeTuiUser) BindUserWithTag

func (g *GeTuiUser) BindUserWithTag(ctx context.Context, cid string, list *CustomTagList, token string) error

func (*GeTuiUser) Close

func (g *GeTuiUser) Close()

func (*GeTuiUser) DelBlackList

func (g *GeTuiUser) DelBlackList(ctx context.Context, cidList []string, token string) error

func (*GeTuiUser) ManageCidAndDeviceToken

func (g *GeTuiUser) ManageCidAndDeviceToken(ctx context.Context, manufacturer string, dtList *CidAndDeviceTokenList, token string) ([]*DTError, error)

func (*GeTuiUser) QueryAliasByCid

func (g *GeTuiUser) QueryAliasByCid(ctx context.Context, cid string, token string) (string, error)

func (*GeTuiUser) QueryCidByAlias

func (g *GeTuiUser) QueryCidByAlias(ctx context.Context, alias string, token string) ([]string, error)

func (*GeTuiUser) QueryDeviceStatus

func (g *GeTuiUser) QueryDeviceStatus(ctx context.Context, cidList []string, token string) (map[string]map[string]string, error)

func (*GeTuiUser) QueryUserCount

func (g *GeTuiUser) QueryUserCount(ctx context.Context, list *ComplexTagList, token string) (int, error)

func (*GeTuiUser) QueryUserInfo

func (g *GeTuiUser) QueryUserInfo(ctx context.Context, cidList []string, token string) ([]string, map[string]map[string]string, error)

func (*GeTuiUser) QueryUserStatus

func (g *GeTuiUser) QueryUserStatus(ctx context.Context, cidList []string, token string) (map[string]map[string]string, error)

func (*GeTuiUser) QueryUserTag

func (g *GeTuiUser) QueryUserTag(ctx context.Context, cid string, token string) ([]string, error)

func (*GeTuiUser) RevokeAlias

func (g *GeTuiUser) RevokeAlias(ctx context.Context, alias string, token string) error

func (*GeTuiUser) SetPushBadge

func (g *GeTuiUser) SetPushBadge(ctx context.Context, cidList []string, op *Operation, token string) error

func (*GeTuiUser) UnbindAlias

func (g *GeTuiUser) UnbindAlias(ctx context.Context, list *AliasList, token string) error

func (*GeTuiUser) UnbindTagFromUser

func (g *GeTuiUser) UnbindTagFromUser(ctx context.Context, tag string, list *CidList, token string) (map[string]bool, error)

type Operation

type Operation struct {
	Badge string `json:"badge"`
}

type Server

type Server struct {
	*proto.UnimplementedUserServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(conf *core.PushConfig) (*Server, error)

func (*Server) AddBlackList

func (s *Server) AddBlackList(ctx context.Context, in *proto.AddBlackListReq) (*proto.AddBlackListResp, error)

func (*Server) BindAlias

func (s *Server) BindAlias(ctx context.Context, in *proto.BindAliasReq) (*proto.BindAliasResp, error)

func (*Server) BindTagWithUser

func (s *Server) BindTagWithUser(ctx context.Context, in *proto.BindTagWithUserReq) (*proto.BindTagWithUserResp, error)

func (*Server) BindUserWithTag

func (s *Server) BindUserWithTag(ctx context.Context, in *proto.BindUserWithTagReq) (*proto.BindUserWithTagResp, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) DelBlackList

func (s *Server) DelBlackList(ctx context.Context, in *proto.DelBlackListReq) (*proto.DelBlackListResp, error)

func (*Server) QueryAliasByCid

func (s *Server) QueryAliasByCid(ctx context.Context, in *proto.QueryAliasReq) (*proto.QueryAliasResp, error)

func (*Server) QueryCidByAlias

func (s *Server) QueryCidByAlias(ctx context.Context, in *proto.QueryCidReq) (*proto.QueryCidResp, error)

func (*Server) QueryDeviceStatus

func (s *Server) QueryDeviceStatus(ctx context.Context, in *proto.QueryDeviceStatusReq) (*proto.QueryDeviceStatusResp, error)

func (*Server) QueryUserCount

func (s *Server) QueryUserCount(ctx context.Context, in *proto.QueryUserCountReq) (*proto.QueryUserCountResp, error)

func (*Server) QueryUserInfo

func (s *Server) QueryUserInfo(ctx context.Context, in *proto.QueryUserInfoReq) (*proto.QueryUserInfoResp, error)

func (*Server) QueryUserStatus

func (s *Server) QueryUserStatus(ctx context.Context, in *proto.QueryUserStatusReq) (*proto.QueryUserStatusResp, error)

func (*Server) QueryUserTag

func (s *Server) QueryUserTag(ctx context.Context, in *proto.QueryUserTagReq) (*proto.QueryUserTagResp, error)

func (*Server) RevokeAlias

func (s *Server) RevokeAlias(ctx context.Context, in *proto.RevokeAliasReq) (*proto.RevokeAliasResp, error)

func (*Server) SetPushBadge

func (s *Server) SetPushBadge(ctx context.Context, in *proto.SetPushBadgeReq) (*proto.SetPushBadgeResp, error)

func (*Server) UnbindAlias

func (s *Server) UnbindAlias(ctx context.Context, in *proto.UnbindAliasReq) (*proto.UnbindAliasResp, error)

func (*Server) UnbindTagFromUser

func (s *Server) UnbindTagFromUser(ctx context.Context, in *proto.UnbindTagFromUserReq) (*proto.UnbindTagFromUserResp, error)

type Tag

type Tag struct {
	Key     string   `json:"key"`
	Values  []string `json:"values"`
	OptType string   `json:"opt_type"`
}

Jump to

Keyboard shortcuts

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