Documentation
¶
Index ¶
- Constants
- Variables
- func CreateTransfer(ctx context.Context, in *TransferInput, ...) error
- func CreateWithdrawal(ctx context.Context, in *WithdrawalInput, ...) error
- func EncryptPIN(ctx context.Context, pin, pinToken, sessionId, privateKey string, ...) (string, error)
- func OAuthGetAccessToken(ctx context.Context, clientId, clientSecret string, authorizationCode string, ...) (string, string, error)
- func PostMessage(ctx context.Context, ...) error
- func Request(ctx context.Context, method, path string, body []byte, accessToken string) ([]byte, error)
- func SignAuthenticationToken(uid, sid, privateKey, method, uri, body string) (string, error)
- func UniqueConversationId(userId, recipientId string) string
- func UpdatePin(ctx context.Context, ...) error
- func UuidFromBytes(input []byte) string
- func UuidFromString(id string) (uuid.UUID, error)
- func UuidNewV4() uuid.UUID
- type Address
- type AddressInput
- type Asset
- type BlazeClient
- func (b *BlazeClient) Loop(ctx context.Context, listener BlazeListener) error
- func (b *BlazeClient) SendAppButton(ctx context.Context, conversationId, recipientId, label, action, color string) error
- func (b *BlazeClient) SendContact(ctx context.Context, conversationId, recipientId, contactId string) error
- func (b *BlazeClient) SendMessage(ctx context.Context, ...) error
- func (b *BlazeClient) SendPlainText(ctx context.Context, msg MessageView, content string) error
- type BlazeListener
- type BlazeMessage
- type Conversation
- type Error
- type MessageView
- type Participant
- type TransferInput
- type TransferView
- type User
- type WithdrawalInput
Constants ¶
View Source
const ( MessageCategoryPlainText = "PLAIN_TEXT" MessageCategoryPlainImage = "PLAIN_IMAGE" MessageCategoryPlainData = "PLAIN_DATA" MessageCategoryPlainSticker = "PLAIN_STICKER" MessageCategorySystemConversation = "SYSTEM_CONVERSATION" MessageCategorySystemAccountSnapshot = "SYSTEM_ACCOUNT_SNAPSHOT" )
Variables ¶
View Source
var Nil = uuid.Nil
Functions ¶
func CreateTransfer ¶
func CreateTransfer(ctx context.Context, in *TransferInput, uid, sid, sessionKey, pin, pinToken string) error
func CreateWithdrawal ¶
func CreateWithdrawal(ctx context.Context, in *WithdrawalInput, uid, sid, sessionKey, pin, pinToken string) error
func EncryptPIN ¶
func OAuthGetAccessToken ¶
func PostMessage ¶
func SignAuthenticationToken ¶
func UniqueConversationId ¶
func UuidFromBytes ¶
func UuidFromString ¶
Types ¶
type Address ¶
type Address struct {
AddressId string `json:"address_id"`
AssetId string `json:"asset_id"`
Label string `json:"label"`
PublicKey string `json:"public_key,omitempty"`
AccountName string `json:"account_name,omitempty"`
AccountTag string `json:"account_tag,omitempty"`
Fee string `json:"fee"`
Reserve string `json:"reserve"`
UpdatedAt string `json:"updated_at"`
}
func CreateAddress ¶
type AddressInput ¶
type Asset ¶
type Asset struct {
AssetId string `json:"asset_id"`
ChainId string `json:"chain_id"`
Symbol string `json:"symbol"`
Name string `json:"name"`
IconURL string `json:"icon_url"`
PriceBTC string `json:"price_btc"`
PriceUSD string `json:"price_usd"`
Balance string `json:"balance"`
PublicKey string `json:"public_key"`
AccountName string `json:"account_name"`
AccountTag string `json:"account_tag"`
}
type BlazeClient ¶
type BlazeClient struct {
// contains filtered or unexported fields
}
func NewBlazeClient ¶
func NewBlazeClient(uid, sid, key string) *BlazeClient
func (*BlazeClient) Loop ¶
func (b *BlazeClient) Loop(ctx context.Context, listener BlazeListener) error
func (*BlazeClient) SendAppButton ¶
func (b *BlazeClient) SendAppButton(ctx context.Context, conversationId, recipientId, label, action, color string) error
func (*BlazeClient) SendContact ¶
func (b *BlazeClient) SendContact(ctx context.Context, conversationId, recipientId, contactId string) error
func (*BlazeClient) SendMessage ¶
func (b *BlazeClient) SendMessage(ctx context.Context, conversationId, recipientId, category, content, representativeId string) error
func (*BlazeClient) SendPlainText ¶
func (b *BlazeClient) SendPlainText(ctx context.Context, msg MessageView, content string) error
type BlazeListener ¶
type BlazeListener interface {
OnMessage(ctx context.Context, msg MessageView, userId string) error
}
type BlazeMessage ¶
type Conversation ¶
type Conversation struct {
ConversationId string `json:"conversation_id"`
CreatorId string `json:"creator_id"`
Category string `json:"category"`
Name string `json:"name"`
IconURL string `json:"icon_url"`
Announcement string `json:"announcement"`
CreatedAt time.Time `json:"created_at"`
Participants []Participant `json:"participants"`
}
func ConversationShow ¶
func CreateConversation ¶
func CreateConversation(ctx context.Context, category, conversationId string, participants []Participant, uid, sid, key string) (*Conversation, error)
type Error ¶
type Error struct {
Status int `json:"status"`
Code int `json:"code"`
Description string `json:"description"`
// contains filtered or unexported fields
}
func AuthorizationError ¶
func BadDataError ¶
func ForbiddenError ¶
type MessageView ¶
type MessageView struct {
ConversationId string `json:"conversation_id"`
UserId string `json:"user_id"`
MessageId string `json:"message_id"`
Category string `json:"category"`
Data string `json:"data"`
Status string `json:"status"`
Source string `json:"source"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Participant ¶
type TransferInput ¶
type TransferView ¶
type TransferView struct {
Type string `json:"type"`
SnapshotId string `json:"snapshot_id"`
CounterUserId string `json:"counter_user_id"`
AssetId string `json:"asset_id"`
Amount string `json:"amount"`
TraceId string `json:"trace_id"`
Memo string `json:"memo"`
CreatedAt time.Time `json:"created_at"`
}
type User ¶
type User struct {
UserId string `json:"user_id"`
SessionId string `json:"session_id"`
PinToken string `json:"pin_token"`
IdentityNumber string `json:"identity_number"`
FullName string `json:"full_name"`
AvatarURL string `json:"avatar_url"`
CreatedAt string `json:"created_at"`
}
func CreateUser ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.