Documentation ¶
Index ¶
- Constants
- func CheckAvailable(userLocal string, info InviteRes) (res, reason string)
- func CheckMortgage(userLocal string) bool
- func CleanExpireHistoryMsgs(interval int64) error
- func Decode(privateKey string, msg []byte) ([]byte, error)
- func ECCDecrypt(ct []byte, prk ecies.PrivateKey) ([]byte, error)
- func ECCEncrypt(pt []byte, puk ecies.PublicKey) ([]byte, error)
- func Encode(eciesPublicKey string, msg []byte) ([]byte, error)
- func GetHttpClient(options ...interface{}) http.Client
- func GetPayRelationByLocals(from string, to []string) (map[string]bool, error)
- func GetPubEcKeyFromPri(priKey []byte) (string, error)
- func Init(pri string, cfgServername string, ...)
- func JudgeIfPayByLocals(from, to string) bool
- func JudgeShouldAutoJoin(inviterLocal, inviteeLocal string) (bool, error)
- func PostJSONNoSpan(ctx context.Context, httpClient *http.Client, apiURL string, ...) error
- func SendRoomNotice(ctx context.Context, userId, msgType, body, outType, roomId string) error
- func SendServerNotice(ctx context.Context, userId, msgType, body, outType string) error
- func ServerDecode(msg string) ([]string, error)
- type InfoRes
- type InviteRes
- type UserRes
Constants ¶
View Source
const LocalServerUrl = "http://127.0.0.1:28008"
View Source
const MaxMemberCount int32 = 666
View Source
const RoomMsgNoticePath = "/_matrix/client/local/send_group_master_notice"
View Source
const ServerNoticePath = "/_matrix/client/local/send_server_notice"
Variables ¶
This section is empty.
Functions ¶
func CheckAvailable ¶
func CheckMortgage ¶
func CleanExpireHistoryMsgs ¶
func ECCDecrypt ¶
func ECCDecrypt(ct []byte, prk ecies.PrivateKey) ([]byte, error)
func GetHttpClient ¶
func GetPayRelationByLocals ¶
func GetPubEcKeyFromPri ¶
func Init ¶
func Init(pri string, cfgServername string, federation *gomatrixserverlib.FederationClient)
func JudgeIfPayByLocals ¶
func JudgeShouldAutoJoin ¶
func PostJSONNoSpan ¶
func PostJSONNoSpan( ctx context.Context, httpClient *http.Client, apiURL string, request, response interface{}, ) error
PostJSONNoSpan performs a POST request with JSON on an internal HTTP API
func SendRoomNotice ¶
func SendServerNotice ¶
Types ¶
type InfoRes ¶
type InfoRes struct { Localpart string `json:"localpart"` LimitMode string `json:"limit_mode"` ChatFee string `json:"chat_fee"` Servername string `json:"servername"` Blacklist []string `json:"blacklist"` Whitelist []string `json:"whitelist"` MortgageLevel int64 `json:"mortgage_level"` TelNumbers []string `json:"tel_numbers"` }
func QueryUserInfoByLocal ¶
type InviteRes ¶
type InviteRes struct { Localpart string `json:"localpart"` LimitMode string `json:"limit_mode"` ChatFee string `json:"chat_fee"` Servername string `json:"servername"` Blacklist []string `json:"blacklist"` Whitelist []string `json:"whitelist"` Payed bool `json:"payed"` Reason string `json:"reason"` MortgageLevel int64 `json:"mortgage_level"` TelNumbers []string `json:"tel_numbers"` }
type UserRes ¶
type UserRes struct { DisplayName string `json:"display_name"` AvatarURL string `json:"avatar_url"` Localpart string `json:"localpart"` Servername string `json:"servername"` LimitMode string `json:"limit_mode"` // any fee list ChatFee string `json:"chat_fee"` MortgageFee string `json:"mortgage_fee"` MortgageLevel int64 `json:"mortgage_level"` TelNumbers []string `json:"tel_numbers"` Blacklist []string `json:"blacklist"` Whitelist []string `json:"whitelist"` CanWeTalk bool `json:"can_we_talk"` CanPayTalk bool `json:"can_pay_talk"` PayedFee string `json:"payed_fee"` Payed bool `json:"payed"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.