Documentation ¶
Index ¶
- Constants
- func CleanUpExpiredDistributedMessages(ctx context.Context, ids []string) error
- func ExpiredDistributedMessageIds(ctx context.Context) ([]string, error)
- func ListExpiredPackets(ctx context.Context, limit int) ([]string, error)
- func ReadProperty(ctx context.Context, key string) (string, error)
- func ReadPropertyAsOffset(ctx context.Context, key string) (time.Time, error)
- func SendParticipantTransfer(ctx context.Context, packetId, userId string, amount string) error
- func SubscribersCount(ctx context.Context) (int64, error)
- func UniqueConversationId(userId, recipientId string) string
- func WriteProperty(ctx context.Context, key, value string) error
- type Asset
- type Blacklist
- type DistributedMessage
- type Message
- type Packet
- func PayPacket(ctx context.Context, packetId string, assetId, amount string) (*Packet, error)
- func ReadPackageWithRelation(ctx context.Context, packetId string) (*Packet, error)
- func RefundPacket(ctx context.Context, packetId string) (*Packet, error)
- func SendPacketRefundTransfer(ctx context.Context, packetId string) (*Packet, error)
- func ShowPacket(ctx context.Context, packetId string) (*Packet, error)
- type Participant
- type Property
- type User
- func AuthenticateUserByOAuth(ctx context.Context, authorizationCode string) (*User, error)
- func AuthenticateUserByToken(ctx context.Context, authenticationToken string) (*User, error)
- func FindUser(ctx context.Context, userId string) (*User, error)
- func Subscribers(ctx context.Context, offset time.Time, num int64) ([]*User, error)
- func (current *User) ClaimPacket(ctx context.Context, packetId string) (*Packet, error)
- func (user *User) CreateBlacklist(ctx context.Context, userId string) (*Blacklist, error)
- func (current *User) CreatePacket(ctx context.Context, assetId string, amount number.Decimal, totalCount int64, ...) (*Packet, error)
- func (user *User) DeleteUser(ctx context.Context, id string) error
- func (user *User) GetRole() string
- func (current *User) ListAssets(ctx context.Context) ([]*Asset, error)
- func (user *User) Payment(ctx context.Context) error
- func (current *User) Prepare(ctx context.Context) (int, error)
- func (current *User) ShowAsset(ctx context.Context, assetId string) (*Asset, error)
- func (user *User) Subscribe(ctx context.Context) error
- func (user *User) Unsubscribe(ctx context.Context) error
- func (user *User) UpdateProfile(ctx context.Context, fullName string) error
Constants ¶
View Source
const ( DistributeSubscriberLimit = 300 ExpiredDistributedMessageLimit = 100 PendingDistributedMessageLimit = 20 )
View Source
const ( MessageStatePending = "pending" MessageStateSuccess = "success" )
View Source
const ( PacketStateInitial = "INITIAL" PacketStatePaid = "PAID" PacketStateExpired = "EXPIRED" PacketStateRefunded = "REFUNDED" )
View Source
const ( PaymentStatePending = "pending" PaymentStatePaid = "paid" )
View Source
const (
MessageQueueCheckpoint = "service-message-checkpoint"
)
Variables ¶
This section is empty.
Functions ¶
func ReadPropertyAsOffset ¶
func SendParticipantTransfer ¶
func UniqueConversationId ¶
Types ¶
type DistributedMessage ¶
type DistributedMessage struct { MessageId string ConversationId string RecipientId string UserId string Category string Data []byte CreatedAt time.Time UpdatedAt time.Time }
func PendingDistributedMessages ¶
func PendingDistributedMessages(ctx context.Context, limit int64) ([]*DistributedMessage, error)
type Message ¶
type Message struct { MessageId string UserId string Category string Data []byte CreatedAt time.Time UpdatedAt time.Time State string LastDistributeAt time.Time }
func CreateMessage ¶
type Packet ¶
type Packet struct { PacketId string UserId string AssetId string Amount string Greeting string TotalCount int64 RemainingCount int64 RemainingAmount string State string CreatedAt time.Time User *User Asset *Asset Participants []*Participant }
func ReadPackageWithRelation ¶
type Participant ¶
type Participant struct { PacketId string UserId string Amount string CreatedAt time.Time FullName string AvatarURL string }
func ListPendingParticipants ¶
func ListPendingParticipants(ctx context.Context, limit int) ([]*Participant, error)
type User ¶
type User struct { UserId string IdentityNumber int64 FullName string AccessToken string AvatarURL string TraceId string State string SubscribedAt time.Time AuthenticationToken string }
func AuthenticateUserByOAuth ¶
func AuthenticateUserByToken ¶
func Subscribers ¶
func (*User) ClaimPacket ¶
func (*User) CreateBlacklist ¶
func (*User) CreatePacket ¶
Click to show internal directories.
Click to hide internal directories.