Versions in this module Expand all Collapse all v1 v1.1.10 Sep 3, 2024 v1.1.9 Sep 3, 2024 v1.1.8 Sep 3, 2024 v1.1.7 Aug 30, 2024 v1.1.6 Aug 30, 2024 v1.1.5 Aug 30, 2024 v1.1.4 Aug 30, 2024 v1.1.3 Aug 29, 2024 v1.1.2 Aug 29, 2024 v1.1.1 Aug 29, 2024 Changes in this version + func BoolEnv(b *bool, key string) + func GetEnv(key string, defaultValue string) string + func GetEnvBool(key string, defaultValue bool) bool + func GetEnvFloat64(key string, defaultValue float64) float64 + func GetEnvInt(key string, defaultValue int) int + func GetEnvInt64(key string, defaultValue int64) int64 + func StringEnv(v *string, key string) + type APNSPush struct + Cert string + Dev bool + Password string + Topic string + type AliyunInternationalSMSConfig struct + AccessKeyID string + AccessSecret string + SignName string + type AliyunSMSConfig struct + AccessKeyID string + AccessSecret string + SignName string + TemplateCode string + type AsyncTask struct + func NewAsyncTask(cfg *Config) *AsyncTask + func (a *AsyncTask) LaunchWorker(consumerTag string, concurrency int) error + func (a *AsyncTask) RegisterTask(name string, taskFunc interface{}) error + func (a *AsyncTask) RegisterTasks(namedTaskFuncs map[string]interface{}) error + func (a *AsyncTask) SendTask(task *tasks.Signature) (*result.AsyncResult, error) + func (a *AsyncTask) SendTaskWithContext(ctx context.Context, task *tasks.Signature) (*result.AsyncResult, error) + type CMDGroupAvatarUpdateReq struct + GroupNo string + Members []string + type CMDResp struct + CMD string + Param interface{} + type Channel struct + ChannelID string + ChannelType uint8 + type ChannelBlacklistReq struct + UIDs []string + type ChannelCreateReq struct + Ban int + ChannelID string + ChannelType uint8 + Large int + Subscribers []string + type ChannelDeleteReq struct + ChannelID string + ChannelType uint8 + type ChannelInfoCreateReq struct + Ban int + ChannelID string + ChannelType uint8 + Large int + type ChannelMaxSeqResp struct + MessageSeq uint32 + type ChannelReq struct + ChannelID string + ChannelType uint8 + type ChannelWhitelistReq struct + UIDs []string + type ClearConversationUnreadReq struct + ChannelID string + ChannelType uint8 + MessageSeq uint32 + UID string + Unread int + type Config struct + Account struct{ ... } + Addr string + AdminPwd string + AliyunInternationalSMS AliyunInternationalSMSConfig + AliyunSMS AliyunSMSConfig + AppID string + AppName string + AppRSAPrivateKey string + AppRSAPubKey string + Avatar struct{ ... } + Business struct{ ... } + Cache struct{ ... } + Cluster struct{ ... } + DB struct{ ... } + ElasticsearchURL string + EventPoolSize int64 + External struct{ ... } + FileService FileService + Friend struct{ ... } + GRPCAddr string + Gitee struct{ ... } + Github struct{ ... } + Group struct{ ... } + GroupUpgradeWhenMemberCount int + Logger struct{ ... } + Message struct{ ... } + MessageSaveAcrossDevice bool + Minio MinioConfig + Mode Mode + OSS OSSConfig + OWT struct{ ... } + OnlineStatusOn bool + Organization struct{ ... } + PhoneSearchOff bool + Push struct{ ... } + QRCodeInfoURL string + Qiniu QiniuConfig + Register struct{ ... } + Robot struct{ ... } + RootDir string + SMSCode string + SMSProvider SMSProvider + SSLAddr string + SWRtc RtcConfig + Seaweed SeaweedConfig + ShortNo struct{ ... } + Support struct{ ... } + TablePartitionConfig TablePartitionConfig + Test bool + TimingWheelSize int64 + TimingWheelTick duration + Tracing struct{ ... } + UniSMS UnismsConfig + Version string + VisitorUIDPrefix string + Wechat struct{ ... } + WelcomeMessage string + WuKongIM struct{ ... } + ZincSearch struct{ ... } + func New() *Config + func (c *Config) ComposeCustomerServiceChannelID(vid string, channelID string) string + func (c *Config) ConfigFileUsed() string + func (c *Config) ConfigureWithViper(vp *viper.Viper) + func (c *Config) GetAvatarPath(uid string) string + func (c *Config) GetCommunityAvatarFilePath(communityNo string) string + func (c *Config) GetCommunityCoverFilePath(communityNo string) string + func (c *Config) GetCustomerServiceChannelID(channelID string) (string, bool) + func (c *Config) GetCustomerServiceVisitorUID(channelID string) (string, bool) + func (c *Config) GetGroupAvatarFilePath(groupNo string) string + func (c *Config) GetOrganizationLogoFilePath(orgId string) string + func (c *Config) IsVisitor(uid string) bool + func (c *Config) IsVisitorChannel(uid string) bool + type Context struct + Event wkevent.Event + EventPool pool.Collector + PushPool pool.Collector + RobotEventPool pool.Collector + SetupTask bool + UserIDGen *snowflake.Node + func NewContext(cfg *Config) *Context + func (c *Context) AddEventListener(event string, listener EventListener) + func (c *Context) AddMessagesListener(listener MessagesListener) + func (c *Context) AddOnlineStatusListener(listener OnlineStatusListener) + func (c *Context) AsyncTask() *AsyncTask + func (c *Context) AuthMiddleware(r *wkhttp.WKHttp) wkhttp.HandlerFunc + func (c *Context) Cache() cache.Cache + func (c *Context) DB() *dbr.Session + func (c *Context) EventBegin(data *wkevent.Data, tx *dbr.Tx) (int64, error) + func (c *Context) EventCommit(eventID int64) + func (c *Context) GenSeq(flag string) int64 + func (c *Context) GetAllOnlineStatusListeners() []OnlineStatusListener + func (c *Context) GetConfig() *Config + func (c *Context) GetElasticsearch() *elastic.Client + func (c *Context) GetEventListeners(event string) []EventListener + func (c *Context) GetHttpRoute() *wkhttp.WKHttp + func (c *Context) GetRedisConn() *redis.Conn + func (c *Context) IMAddSubscriber(req *SubscriberAddReq) error + func (c *Context) IMBlacklistAdd(req ChannelBlacklistReq) error + func (c *Context) IMBlacklistRemove(req ChannelBlacklistReq) error + func (c *Context) IMBlacklistSet(req ChannelBlacklistReq) error + func (c *Context) IMClearConversationUnread(req ClearConversationUnreadReq) error + func (c *Context) IMCreateOrUpdateChannel(req *ChannelCreateReq) error + func (c *Context) IMCreateOrUpdateChannelInfo(req *ChannelInfoCreateReq) error + func (c *Context) IMDelChannel(req *ChannelDeleteReq) error + func (c *Context) IMDeleteConversation(req DeleteConversationReq) error + func (c *Context) IMGetChannelMaxSeq(channelID string, channelType uint8) (*ChannelMaxSeqResp, error) + func (c *Context) IMGetConversations(uid string) ([]*ConversationResp, error) + func (c *Context) IMGetWithChannelAndSeqs(channelID string, channelType uint8, loginUID string, seqs []uint32) (*SyncChannelMessageResp, error) + func (c *Context) IMRemoveSubscriber(req *SubscriberRemoveReq) error + func (c *Context) IMRevokeMessage(req *MessageRevokeReq) error + func (c *Context) IMSOnlineStatus(uids []string) ([]*OnlinestatusResp, error) + func (c *Context) IMStreamEnd(req MessageStreamEndReq) error + func (c *Context) IMStreamStart(req MessageStreamStartReq) (string, error) + func (c *Context) IMSyncChannelMessage(req SyncChannelMessageReq) (*SyncChannelMessageResp, error) + func (c *Context) IMSyncMessage(req *MsgSyncReq) ([]*MessageResp, error) + func (c *Context) IMSyncMessageAck(req *SyncackReq) error + func (c *Context) IMSyncUserConversation(uid string, version int64, msgCount int64, lastMsgSeqs string, ...) ([]*SyncUserConversationResp, error) + func (c *Context) IMWhitelistAdd(req ChannelWhitelistReq) error + func (c *Context) IMWhitelistRemove(req ChannelWhitelistReq) error + func (c *Context) IMWhitelistSet(req ChannelWhitelistReq) error + func (c *Context) NewMemoryCache() cache.Cache + func (c *Context) NewMySQL() *dbr.Session + func (c *Context) NewRedisCache() *common.RedisCache + func (c *Context) NotifyMessagesListeners(messages []*MessageResp) + func (c *Context) QuitUserDevice(uid string, deviceFlag int) error + func (c *Context) Schedule(interval time.Duration, f func()) *timingwheel.Timer + func (c *Context) SendCMD(req MsgCMDReq) error + func (c *Context) SendChannelUpdate(channel ChannelReq, updateChannel ChannelReq) error + func (c *Context) SendChannelUpdateToGroup(groupNo string) error + func (c *Context) SendChannelUpdateToUser(uid string, channel ChannelReq) error + func (c *Context) SendChannelUpdateWithFromUID(channel ChannelReq, updateChannel ChannelReq, fromUID string) error + func (c *Context) SendFriendApply(req *MsgFriendApplyReq) error + func (c *Context) SendFriendDelete(req *MsgFriendDeleteReq) error + func (c *Context) SendFriendSure(req *MsgFriendSureReq) error + func (c *Context) SendGroupCreate(req *MsgGroupCreateReq) error + func (c *Context) SendGroupExit(groupNo string, uid string, name string, visibleUids []string) error + func (c *Context) SendGroupMemberAdd(req *MsgGroupMemberAddReq) error + func (c *Context) SendGroupMemberBeRemove(req *MsgGroupMemberRemoveReq) error + func (c *Context) SendGroupMemberInviteReq(req MsgGroupMemberInviteReq) error + func (c *Context) SendGroupMemberRemove(req *MsgGroupMemberRemoveReq) error + func (c *Context) SendGroupMemberScanJoin(req MsgGroupMemberScanJoin) error + func (c *Context) SendGroupMemberUpdate(groupNo string) error + func (c *Context) SendGroupTransferGrouper(req MsgGroupTransferGrouper) error + func (c *Context) SendGroupUpdate(req *MsgGroupUpdateReq) error + func (c *Context) SendGroupUpgrade(groupNo string) error + func (c *Context) SendMessage(req *MsgSendReq) error + func (c *Context) SendMessageBatch(req *MsgSendBatch) error + func (c *Context) SendMessageWithResult(req *MsgSendReq) (*MsgSendResp, error) + func (c *Context) SendRTCCallResult(req P2pRtcMessageReq) error + func (c *Context) SendRevoke(req *MsgRevokeReq) error + func (c *Context) SendTyping(channelID string, channelType uint8, fromUID string) error + func (c *Context) SendUnableAddDestoryAccountInGroup(req *MsgGroupCreateReq) error + func (c *Context) SetHttpRoute(r *wkhttp.WKHttp) + func (c *Context) SetValue(value interface{}, key string) + func (c *Context) Tracer() *Tracer + func (c *Context) UpdateIMToken(req UpdateIMTokenReq) (*UpdateIMTokenResp, error) + func (c *Context) Value(key string) any + type ConversationResp struct + ChannelID string + ChannelType uint8 + LastMessage *MessageResp + Timestamp int64 + Unread int64 + type DeleteConversationReq struct + ChannelID string + ChannelType uint8 + UID string + type DeviceFlag uint8 + const APP + const PC + const Web + func (d DeviceFlag) Uint8() uint8 + type DeviceLevel uint8 + const DeviceLevelMaster + const DeviceLevelSlave + type EmptySpan struct + func (e *EmptySpan) BaggageItem(restrictedKey string) string + func (e *EmptySpan) Context() opentracing.SpanContext + func (e *EmptySpan) Finish() + func (e *EmptySpan) FinishWithOptions(opts opentracing.FinishOptions) + func (e *EmptySpan) Log(data opentracing.LogData) + func (e *EmptySpan) LogEvent(event string) + func (e *EmptySpan) LogEventWithPayload(event string, payload interface{}) + func (e *EmptySpan) LogFields(fields ...log.Field) + func (e *EmptySpan) LogKV(alternatingKeyValues ...interface{}) + func (e *EmptySpan) SetBaggageItem(restrictedKey, value string) opentracing.Span + func (e *EmptySpan) SetOperationName(operationName string) opentracing.Span + func (e *EmptySpan) SetTag(key string, value interface{}) opentracing.Span + func (e *EmptySpan) Tracer() opentracing.Tracer + type EmptySpanContext struct + func (e *EmptySpanContext) ForeachBaggageItem(handler func(k, v string) bool) + type EventCommit func(err error) + type EventListener func(data []byte, commit EventCommit) + type FIREBASEPush struct + JsonPath string + PackageName string + ProjectId string + type FileService string + const FileServiceAliyunOSS + const FileServiceMinio + const FileServiceQiniu + const FileServiceSeaweedFS + func (u FileService) String() string + type HMSPush struct + AppID string + AppSecret string + PackageName string + type MIPush struct + AppID string + AppSecret string + ChannelID string + PackageName string + type MessageDeleteReq struct + ChannelID string + ChannelType uint8 + MessageIDs []uint64 + UID string + type MessageResp struct + ChannelID string + ChannelType uint8 + ClientMsgNo string + Expire uint32 + FromUID string + Header MsgHeader + IsDeleted int + MessageID int64 + MessageSeq uint32 + Payload []byte + Setting uint8 + StreamNo string + Streams []*StreamItemResp + Timestamp int32 + ToUID string + VoiceStatus int + func (m *MessageResp) GetContentType() int + func (m *MessageResp) GetPayloadMap() (map[string]interface{}, error) + type MessageRevokeReq struct + ChannelID string + ChannelType uint8 + MessageIDs []uint64 + type MessageStreamEndReq struct + ChannelID string + ChannelType uint8 + StreamNo string + type MessageStreamStartReq struct + ChannelID string + ChannelType uint8 + ClientMsgNo string + FromUID string + Header MsgHeader + Payload []byte + type MessagesListener func(messages []*MessageResp) + type MinioConfig struct + AccessKeyID string + DownloadURL string + SecretAccessKey string + URL string + UploadURL string + type Mode string + const BenchMode + const DebugMode + const ReleaseMode + type MsgCMDReq struct + CMD string + ChannelID string + ChannelType uint8 + FromUID string + NoPersist bool + Param map[string]interface{} + Subscribers []string + type MsgFriendApplyReq struct + ApplyName string + ApplyUID string + Remark string + ToUID string + Token string + type MsgFriendDeleteReq struct + FromUID string + ToUID string + type MsgFriendSureReq struct + FromName string + FromUID string + ToUID string + type MsgGroupCreateReq struct + Creator string + CreatorName string + GroupNo string + Members []*UserBaseVo + Version int64 + type MsgGroupDisband struct + GroupNo string + Operator string + OperatorName string + type MsgGroupMemberAddReq struct + GroupNo string + Members []*UserBaseVo + Operator string + OperatorName string + type MsgGroupMemberInviteReq struct + GroupNo string + InviteNo string + Inviter string + InviterName string + Num int + Subscribers []string + type MsgGroupMemberRemoveReq struct + GroupNo string + Members []*UserBaseVo + Operator string + OperatorName string + type MsgGroupMemberScanJoin struct + Generator string + GeneratorName string + GroupNo string + Scaner string + ScanerName string + type MsgGroupTransferGrouper struct + GroupNo string + NewGrouper string + NewGrouperName string + OldGrouper string + OldGrouperName string + type MsgGroupUpdateReq struct + Attr string + Data map[string]string + GroupNo string + Operator string + OperatorName string + type MsgHeader struct + NoPersist int + RedDot int + SyncOnce int + func (h MsgHeader) String() string + type MsgOrgOrDeptCreateReq struct + GroupCategory string + GroupNo string + Members []*OrgOrDeptEmployeeVO + Name string + Operator string + OperatorName string + type MsgOrgOrDeptEmployeeAddReq struct + GroupNo string + Members []*UserBaseVo + Name string + type MsgOrgOrDeptEmployeeUpdateReq struct + Members []*OrgOrDeptEmployeeVO + type MsgRevokeReq struct + ChannelID string + ChannelType uint8 + FromUID string + MessageID int64 + Operator string + OperatorName string + type MsgSendBatch struct + FromUID string + Header MsgHeader + Payload []byte + Subscribers []string + type MsgSendReq struct + ChannelID string + ChannelType uint8 + FromUID string + Header MsgHeader + Payload []byte + Setting uint8 + StreamNo string + Subscribers []string + func (m *MsgSendReq) String() string + type MsgSendResp struct + ClientMsgNo string + MessageID int64 + MessageSeq uint32 + type MsgSyncReq struct + Limit int + MessageSeq uint32 + UID string + type OPPOPush struct + AppID string + AppKey string + AppSecret string + MasterSecret string + PackageName string + type OSSConfig struct + AccessKeyID string + AccessKeySecret string + BucketName string + BucketURL string + Endpoint string + type OnlineStatus struct + DeviceFlag uint8 + Online bool + OnlineCount int + SocketID int64 + TotalOnlineCount int + UID string + type OnlineStatusListener func(onlineStatusList []OnlineStatus) + type OnlinestatusResp struct + DeviceFlag uint8 + LastOffline int + Online int + UID string + type OrgEmployeeExitReq struct + GroupNos []string + Operator string + type OrgOrDeptEmployeeVO struct + Action string + EmployeeName string + EmployeeUid string + GroupNo string + Operator string + OperatorName string + type P2pRtcMessageReq struct + CallType common.RTCCallType + FromUID string + ResultType common.RTCResultType + Second int + ToUID string + type PullMode int + const PullModeDown + const PullModeUp + type QiniuConfig struct + AccessKey string + BucketName string + SecretKey string + URL string + type ReactionResp struct + Count int + Emoji string + Seq string + Users []UserResp + type RtcConfig struct + AppCertificate string + AppID string + type SMSProvider string + const SMSProviderAliyun + const SMSProviderUnisms + type SeaweedConfig struct + URL string + type Seq struct + CurSeq int64 + MaxSeq int64 + type Setting struct + NoUpdateConversation bool + Receipt bool + Signal bool + func SettingFromUint8(v uint8) Setting + func (s Setting) ToUint8() uint8 + type StreamItemResp struct + Blob []byte + ClientMsgNo string + StreamSeq uint32 + type SubscriberAddReq struct + ChannelID string + ChannelType uint8 + Reset int + Subscribers []string + type SubscriberRemoveReq struct + ChannelID string + ChannelType uint8 + Subscribers []string + type SyncChannelMessageReq struct + ChannelID string + ChannelType uint8 + DeviceUUID string + EndMessageSeq uint32 + Limit int + LoginUID string + PullMode PullMode + StartMessageSeq uint32 + type SyncChannelMessageResp struct + EndMessageSeq uint32 + Messages []*MessageResp + PullMode PullMode + StartMessageSeq uint32 + type SyncUserConversationResp struct + ChannelID string + ChannelType uint8 + LastClientMsgNo string + LastMsgSeq int64 + OffsetMsgSeq int64 + Recents []*MessageResp + Timestamp int64 + Unread int + Version int64 + type SyncUserConversationRespWrap struct + CMDVersion int64 + CMDs []*CMDResp + Conversations []*SyncUserConversationResp + type SyncackReq struct + LastMessageSeq uint32 + UID string + func (s SyncackReq) Check() error + func (s SyncackReq) String() string + type TablePartitionConfig struct + ChannelOffsetTableCount int + MessageTableCount int + MessageUserEditTableCount int + type Tracer struct + func NewTracer(cfg *Config) (*Tracer, error) + func (t *Tracer) Close() error + func (t *Tracer) ContextWithSpan(ctx context.Context, span opentracing.Span) context.Context + func (t *Tracer) Extract(format interface{}, carrier interface{}) (opentracing.SpanContext, error) + func (t *Tracer) ExtractHTTPHeader(header http.Header) (opentracing.SpanContext, error) + func (t *Tracer) GinMiddle() gin.HandlerFunc + func (t *Tracer) Inject(sm opentracing.SpanContext, format interface{}, carrier interface{}) error + func (t *Tracer) InjectHTTPHeader(sm opentracing.SpanContext, header http.Header) error + func (t *Tracer) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span + func (t *Tracer) StartSpanFromContext(ctx context.Context, operationName string, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context) + type UnismsConfig struct + AccessKeyID string + AccessKeySecret string + Signature string + TemplateId string + type UpdateIMTokenReq struct + DeviceFlag DeviceFlag + DeviceLevel DeviceLevel + Token string + UID string + type UpdateIMTokenResp struct + Status UpdateTokenStatus + type UpdateSearchMessageReq struct + ChannelID string + MessageIDs []string + type UpdateTokenStatus int + const UpdateTokenStatusBan + const UpdateTokenStatusSuccess + type UserBaseVo struct + Name string + UID string + type UserResp struct + Name string + UID string + type VIVOPush struct + AppID string + AppKey string + AppSecret string + PackageName string