Documentation
¶
Index ¶
- type Customer
- type CustomerMD
- type CustomerMDI
- type CustomerObserver
- type MD
- type MDI
- type MDIBase
- type MainRoutineRunner
- type Model
- type ModelEx
- type Observer
- type Servicer
- type ServicerMD
- type ServicerMDI
- type ServicerObserver
- type TalkInfoR
- type TalkInfoW
- type TalkMessageR
- type TalkMessageType
- type TalkMessageW
- type TalkStatus
- type UserTokenExplain
- type UserTokenExtractor
- type UserTokenHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer interface { GetUniqueID() uint64 GetTalkID() string GetUserID() uint64 SendMessage(msg *customertalkpb.TalkResponse) error Remove(msg string) CreateTalkFlag() bool }
type CustomerMD ¶
type CustomerMD interface { Setup(mr MainRoutineRunner) InstallCustomer(ctx context.Context, customer Customer) UninstallCustomer(ctx context.Context, customer Customer) CustomerMessageIncoming(ctx context.Context, customer Customer, seqID uint64, message *TalkMessageW) CustomerClose(ctx context.Context, customer Customer) }
type CustomerMDI ¶
type CustomerMDI interface { MDIBase SetCustomerObserver(ob CustomerObserver) SendTalkCloseMessage(talkID string) SendTalkCreateMessage(talkID string) }
type CustomerObserver ¶
type CustomerObserver interface { OnMessageIncoming(senderUniqueID uint64, talkID string, message *TalkMessageW) OnTalkClose(talkID string) }
type MD ¶
type MD interface { Load(ctx context.Context) (err error) CustomerMD ServicerMD }
type MDI ¶
type MDI interface { CustomerMDI ServicerMDI }
type MainRoutineRunner ¶
type MainRoutineRunner interface {
Post(func())
}
type Model ¶
type Model interface { CreateTalk(ctx context.Context, talkInfo *TalkInfoW) (talkID string, err error) OpenTalk(ctx context.Context, talkID string) (err error) CloseTalk(ctx context.Context, talkID string) error AddTalkMessage(ctx context.Context, talkID string, message *TalkMessageW) (err error) GetTalkMessages(ctx context.Context, talkID string, offset, count int64) (messages []*TalkMessageR, err error) QueryTalks(ctx context.Context, creatorID, serviceID uint64, talkID string, statuses []TalkStatus) (talks []*TalkInfoR, err error) GetPendingTalkInfos(ctx context.Context) ([]*TalkInfoR, error) UpdateTalkServiceID(ctx context.Context, talkID string, serviceID uint64) (err error) }
type ModelEx ¶
type ModelEx interface { Model TalkExists(ctx context.Context, talkID string) (bool, error) GetTalkInfo(ctx context.Context, talkID string) (*TalkInfoR, error) GetServicerTalkInfos(ctx context.Context, servicerID uint64) ([]*TalkInfoR, error) GetTalkServicerID(ctx context.Context, talkID string) (servicerID uint64, err error) }
type Observer ¶
type Observer interface { CustomerObserver ServicerObserver }
type Servicer ¶
type Servicer interface { GetUserID() uint64 GetUniqueID() uint64 SendMessage(msg *customertalkpb.ServiceResponse) error Remove(msg string) }
type ServicerMD ¶
type ServicerMD interface { Setup(mr MainRoutineRunner) InstallServicer(ctx context.Context, servicer Servicer) UninstallServicer(ctx context.Context, servicer Servicer) ServicerAttachTalk(ctx context.Context, talkID string, servicer Servicer) ServicerDetachTalk(ctx context.Context, talkID string, servicer Servicer) ServicerQueryAttachedTalks(ctx context.Context, servicer Servicer) ServicerQueryPendingTalks(ctx context.Context, servicer Servicer) ServicerReloadTalk(ctx context.Context, servicer Servicer, talkID string) ServiceMessage(ctx context.Context, servicer Servicer, talkID string, seqID uint64, message *TalkMessageW) }
type ServicerMDI ¶
type ServicerObserver ¶
type TalkMessageR ¶
type TalkMessageR struct { MessageID string `bson:"_id"` TalkMessageW `bson:"inline"` }
type TalkMessageType ¶
type TalkMessageType int
const ( TalkMessageTypeUnknown TalkMessageType = iota TalkMessageTypeText TalkMessageTypeImage )
type TalkMessageW ¶
type TalkStatus ¶
type TalkStatus int
const ( TalkStatusNone TalkStatus = iota TalkStatusOpened TalkStatusClosed )
type UserTokenExplain ¶
type UserTokenExtractor ¶
type UserTokenHelper ¶
type UserTokenHelper interface { UserTokenExtractor UserTokenExplain ExtractUserFromGRPCContext(ctx context.Context, renewToken bool) (newToken string, userID uint64, userName string, err error) }
Click to show internal directories.
Click to hide internal directories.