web

package
v0.0.0-...-d22cea1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SDK          string = "SDK"
	USER         string = "USER"
	STREAMING    string = "STREAMING"
	SDKCODE      string = "sdkbearer"
	SDKCHILDCODE string = "childbearer"
	REFRESHCODE  string = "refresh"
)
View Source
const SyncGroupMembersIntervalSeconds float64 = 3600

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

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

type BotsInfo

type BotsInfo struct {
	pb.BotsInfo
	BotName string `json:"botName"`
	//BotId        string          `json:"botId"`
	FilterId       string          `json:"filterId"`
	MomentFilterId string          `json:"momentFilterId"`
	WxaappId       string          `json:"wxaappId"`
	Callback       string          `json:"callback"`
	CreateAt       *utils.JSONTime `json:"createAt"`
	UpdateAt       *utils.JSONTime `json:"updateAt"`
	DeleteAt       *utils.JSONTime `json:"deleteAt,omitempty"`
	ChatUserVO
}

type ChatGroupMemberVO

type ChatGroupMemberVO struct {
	ChatGroupMemberId string `json:"chatGroupMemberId"`
	ChatGroupId       string `json:"chatGroupId"`
	GroupName         string `json:"groupName"`
	InvitedBy         string `json:"invitedBy"`
	GroupNickName     string `json:"groupNickName"`
	ChatUserVO
}

type ChatGroupVO

type ChatGroupVO struct {
	ChatGroupId    string         `json:"chatGroupId"`
	GroupName      string         `json:"groupName"`
	Type           string         `json:"type"`
	Alias          string         `json:"alias"`
	NickName       string         `json:"nickname"`
	Owner          string         `json:"owner"`
	OwnerDetail    *ChatUserVO    `json:"ownerDetail`
	Avatar         string         `json:"avatar"`
	MemberCount    int            `json:"memberCount"`
	MaxMemberCount int            `json:"maxMemberCount"`
	LastSendAt     utils.JSONTime `json:"lastSendAt"`
	CreateAt       utils.JSONTime `json:"createAt"`
	UpdateAt       utils.JSONTime `json:"updateAt"`
}

type ChatUserVO

type ChatUserVO struct {
	ChatUserId string         `json:"chatuserId"`
	UserName   string         `json:"username"`
	NickName   string         `json:"nickname"`
	Type       string         `json:"type"`
	Alias      string         `json:"alias"`
	Avatar     string         `json:"avatar"`
	Sex        int            `json:"sex"`
	Country    string         `json:"country"`
	Province   string         `json:"province"`
	City       string         `json:"city"`
	Signature  string         `json:"signature"`
	Remark     string         `json:"remark"`
	Label      string         `json:"label"`
	LastSendAt utils.JSONTime `json:"lastsendat"`
	CuCreateAt utils.JSONTime `json:"cu_createat"`
	CuUpdateAt utils.JSONTime `json:"cu_updateat"`
}

type ContactInfoDispatcher

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

func (*ContactInfoDispatcher) Listen

func (cd *ContactInfoDispatcher) Listen(username string, ch chan domains.ChatUser)

send to channel maybe block, this func must call as go routine

func (*ContactInfoDispatcher) Notify

func (cd *ContactInfoDispatcher) Notify(username string, chatuser domains.ChatUser)

type ContactParser

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

func NewContactParser

func NewContactParser() *ContactParser

type ContactProcessInfo

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

type ContactRawInfo

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

type ErrorHandler

type ErrorHandler struct {
	domains.ErrorHandler
}

func (*ErrorHandler) BackEndError

func (o *ErrorHandler) BackEndError(ctx *WebServer)

func (*ErrorHandler) BotAction

func (ctx *ErrorHandler) BotAction(w *rpc.GRPCWrapper, req *pb.BotActionRequest) *pb.BotActionReply

func (*ErrorHandler) BotLogin

func (ctx *ErrorHandler) BotLogin(w *rpc.GRPCWrapper, req *pb.BotLoginRequest) *pb.BotLoginReply

func (*ErrorHandler) BotLogout

func (ctx *ErrorHandler) BotLogout(w *rpc.GRPCWrapper, req *pb.BotLogoutRequest) *pb.OperationReply

func (*ErrorHandler) BotShutdown

func (ctx *ErrorHandler) BotShutdown(w *rpc.GRPCWrapper, req *pb.BotLogoutRequest) *pb.OperationReply

func (*ErrorHandler) CreateAndRunAction

func (o *ErrorHandler) CreateAndRunAction(web *WebServer, ar *domains.ActionRequest) *pb.BotActionReply

func (*ErrorHandler) CreateFilterChain

func (o *ErrorHandler) CreateFilterChain(
	ctx *WebServer, tx dbx.Queryable, wrapper *rpc.GRPCWrapper, filterId string)

func (*ErrorHandler) GetBots

func (ctx *ErrorHandler) GetBots(w *rpc.GRPCWrapper, req *pb.BotsRequest) *pb.BotsReply

func (*ErrorHandler) GetRateLimit

func (o *ErrorHandler) GetRateLimit(actionType string) (int, int, int)

func (*ErrorHandler) WebError

func (o *ErrorHandler) WebError(w http.ResponseWriter)

type FilterTemplate

type FilterTemplate struct {
	Id          string         `json:"id"`
	Name        string         `json:"name"`
	Type        string         `json:"type"`
	Index       int            `json:"index"`
	DefaultNext int            `json:"defaultNext"`
	CreateAt    utils.JSONTime `json:"createAt"`
	UpdateAt    utils.JSONTime `json:"updateAt"`
}

type FilterTemplateSuite

type FilterTemplateSuite struct {
	Id              string           `json:"id"`
	Name            string           `json:"name"`
	FilterTemplates []FilterTemplate `json:"filterTemplates"`
	CreateAt        utils.JSONTime   `json:"createAt"`
	UpdateAt        utils.JSONTime   `json:"updateAt"`
}

type FilterVO

type FilterVO struct {
	FilterId string         `json:"filterId"`
	Name     string         `json:"name"`
	Type     string         `json:"type"`
	Body     string         `json:"body"`
	Next     string         `json:"next"`
	CreateAt utils.JSONTime `json:"createAt"`
}

type GithubOAuthConfig

type GithubOAuthConfig struct {
	AuthPath      string
	TokenPath     string
	UserPath      string
	UserEmailPath string
	ClientId      string
	ClientSecret  string
	Callback      string
}

type ProcessGroupInfo

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

type ProcessUserInfo

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

type WebConfig

type WebConfig struct {
	Host      string
	Port      string
	GrpcPort  string
	Baseurl   string
	Redis     utils.RedisConfig
	Fluent    utils.FluentConfig
	Messagedb utils.MongoConfig
	Apilogdb  utils.MongoConfig
	Rabbitmq  utils.RabbitMQConfig

	SecretPhrase string
	Database     utils.DatabaseConfig
	Sentry       string
	GithubOAuth  GithubOAuthConfig
	AllowOrigin  []string

	ActionHealthCheck domains.HealthCheckConfig
	BotHealthCheck    domains.HealthCheckConfig
	ActionTimeout     int
}

type WebServer

type WebServer struct {
	Config  WebConfig
	Hubport string
	Hubhost string
	// contains filtered or unexported fields
}

func (*WebServer) Error

func (ctx *WebServer) Error(err error, msg string, v ...interface{})

func (*WebServer) GetBot

func (server *WebServer) GetBot(_ context.Context, req *pb.GetBotRequest) (*pb.GetBotResponse, error)

func (*WebServer) GetBotChatRoom

func (server *WebServer) GetBotChatRoom(ctx context.Context, request *pb.GetBotChatRoomRequest) (*pb.GetBotChatRoomResponse, error)

func (*WebServer) GetBotChatRooms

func (server *WebServer) GetBotChatRooms(ctx context.Context, request *pb.GetBotChatRoomsRequest) (*pb.GetBotChatRoomsResponse, error)

func (*WebServer) GetChatMessage

func (web *WebServer) GetChatMessage(w http.ResponseWriter, r *http.Request)

func (*WebServer) GetChatUser

func (server *WebServer) GetChatUser(_ context.Context, req *pb.GetChatUserRequest) (*pb.GetChatUserResponse, error)

func (*WebServer) GetChatUserSync

func (server *WebServer) GetChatUserSync(_ context.Context, req *pb.GetChatUserSyncRequest) (*pb.GetChatUserResponse, error)

func (*WebServer) Info

func (ctx *WebServer) Info(msg string, v ...interface{})

func (*WebServer) NewGRPCWrapper

func (web *WebServer) NewGRPCWrapper() (*rpc.GRPCWrapper, error)

func (*WebServer) NotifyWechatBotCrawlTimeline

func (web *WebServer) NotifyWechatBotCrawlTimeline(w http.ResponseWriter, r *http.Request)

func (*WebServer) NotifyWechatBotsCrawlTimeline

func (web *WebServer) NotifyWechatBotsCrawlTimeline(w http.ResponseWriter, r *http.Request)

func (*WebServer) NotifyWechatBotsCrawlTimelineTail

func (web *WebServer) NotifyWechatBotsCrawlTimelineTail(w http.ResponseWriter, r *http.Request)

func (*WebServer) ProcessContactsServe

func (web *WebServer) ProcessContactsServe()

func (*WebServer) Search

func (web *WebServer) Search(w http.ResponseWriter, r *http.Request)

func (*WebServer) SearchMessage

func (web *WebServer) SearchMessage(w http.ResponseWriter, r *http.Request)

func (*WebServer) Serve

func (server *WebServer) Serve()

func (*WebServer) UpdateAccounts

func (web *WebServer) UpdateAccounts() error

func (*WebServer) UpdateBotChatRoom

func (server *WebServer) UpdateBotChatRoom(ctx context.Context, request *pb.UpdateBotChatRoomRequest) (*pb.UpdateBotChatRoomResponse, error)

func (*WebServer) ValidateToken

func (server *WebServer) ValidateToken(_ context.Context, req *pb.ValidateTokenRequest) (*pb.ValidateTokenResponse, error)

type WechatContactInfo

type WechatContactInfo struct {
	Id              int      `json:"id"`
	MType           int      `json:"mType"`
	MsgType         int      `json:"msgType"`
	Continue        int      `json:"continue"`
	Status          int      `json:"Status"`
	Source          int      `json:"source"`
	Uin             int64    `json:"uin"`
	UserName        string   `json:"userName"`
	Alias           string   `json:"alias"`
	NickName        string   `json:"nickName"`
	PyInitial       string   `json:"pyInitial"`
	QuanPin         string   `json:"quanPin"`
	Stranger        string   `json:"stranger"`
	BigHead         string   `json:"bigHead"`
	SmallHead       string   `json:"smallHead"`
	BitMask         int64    `json:"bitMask"`
	BitValue        int64    `json:"bitValue"`
	ImageFlag       int      `json:"imageFlag"`
	Sex             int      `json:"sex"`
	Intro           string   `json:"intro"`
	Country         string   `json:"country"`
	Provincia       string   `json:"provincia"`
	City            string   `json:"city"`
	Label           string   `json:"label"`
	Remark          string   `json:"remark"`
	RemarkPyInitial string   `json:"remarkPyInitial"`
	RemarkQuanPin   string   `json:"remarkQuanPin"`
	Level           int      `json:"level"`
	Signature       string   `json:"signature"`
	ChatRoomId      int64    `json:"chatroomId"`
	ChatRoomOwner   string   `json:"chatroomOwner"`
	Member          []string `json:"member"`
	MaxMemberCount  int      `json:"maxMemberCount"`
	MemberCount     int      `json:"memberCount"`
}

type WechatGroupInfo

type WechatGroupInfo struct {
	ChatRoomId int                 `json:"chatroomId"`
	Count      int                 `json:"count"`
	Member     []WechatGroupMember `json:"member"`
	Message    string              `json:"message"`
	Status     int                 `json:"status"`
	UserName   string              `json:"userName"`
}

type WechatGroupMember

type WechatGroupMember struct {
	BigHead          string `json:"bigHead"`
	ChatRoomNickName string `json:"chatroomNickName"`
	InvitedBy        string `json:"invitedBy"`
	NickName         string `json:"nickName"`
	SmallHead        string `json:"smallHead"`
	UserName         string `json:"userName"`
}

Jump to

Keyboard shortcuts

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