Browse Source

Renamed api.go and created go module

main
Sam 5 years ago
parent
commit
a9a720aa9b
  1. 106
      api.go
  2. 98
      api/chatIn.go
  3. 3
      go.mod

106
api.go

@ -1,106 +0,0 @@ @@ -1,106 +0,0 @@
package api
import ()
type Chat struct {
Type string `json:"type"`
Source string `json:"source"`
Msg Msg `json:"msg"`
Pagination Pagination `json:"pagination"`
}
type Channel struct {
Name string `json:"name"`
Public bool `json:"public"`
MembersType string `json:"members_type"`
TopicType string `json:"topic_type"`
TopicName string `json:"topic_name"`
}
type Sender struct {
UID string `json:"uid"`
Username string `json:"username"`
DeviceID string `json:"device_id"`
DeviceName string `json:"device_name"`
}
type Addedtoteam struct {
Team string `json:"team"`
Adder string `json:"adder"`
Addee string `json:"addee"`
Owners []string `json:"owners"`
Admins []string `json:"admins"`
Writers []string `json:"writers"`
Readers []string `json:"readers"`
}
type Bulkaddtoconv struct {
Usernames []string `json:"usernames"`
}
type System struct {
SystemType int `json:"systemType"`
Addedtoteam Addedtoteam `json:"addedtoteam"`
Bulkaddtoconv Bulkaddtoconv `json:"bulkaddtoconv"`
}
type Result struct {
ResultTyp int `json:"resultTyp"`
Sent string `json:"sent"`
}
type Payments struct {
Username string `json:"username"`
PaymentText string `json:"paymentText"`
Result Result `json:"result"`
}
type UserMentions struct {
Text string `json:"text"`
UID string `json:"uid"`
}
type TeamMentions struct {
Name string `json:"name"`
Channel string `json:"channel"`
}
type Reaction struct {
M int `json:"m"`
B string `json:"b"`
}
type Delete struct {
MessageIDs []int `json:"messageIDs"`
}
type Edit struct {
MessageID int `json:"messageID"`
Body string `json:"body"`
Payments []Payments `json:"payments"`
UserMentions []UserMentions `json:"userMentions"`
TeamMentions []TeamMentions `json:"teamMentions"`
}
type Text struct {
Body string `json:"body"`
Payments []Payments `json:"payments"`
UserMentions []UserMentions `json:"userMentions"`
TeamMentions []TeamMentions `json:"teamMentions"`
}
type Content struct {
Type string `json:"type"`
Delete Delete `json:"delete"`
Edit Edit `json:"edit"`
Reaction Reaction `json:"reaction"`
System System `json:"system"`
Text Text `json:"text"`
}
type Msg struct {
ID int `json:"id"`
Channel Channel `json:"channel"`
Sender Sender `json:"sender"`
SentAt int `json:"sent_at"`
SentAtMs int64 `json:"sent_at_ms"`
Content Content `json:"content"`
Prev interface{} `json:"prev"`
Unread bool `json:"unread"`
AtMentionUsernames []string `json:"at_mention_usernames"`
IsEphemeral bool `json:"is_ephemeral"`
Etime int64 `json:"etime"`
HasPairwiseMacs bool `json:"has_pairwise_macs"`
ChannelMention string `json:"channel_mention"`
}
type Pagination struct {
Next string `json:"next"`
Previous string `json:"previous"`
Num int `json:"num"`
Last bool `json:"last"`
}

98
api/chatIn.go

@ -0,0 +1,98 @@ @@ -0,0 +1,98 @@
package api
import ()
type chatIn struct {
Type string `json:"type"`
Source string `json:"source"`
Msg chatInMsg `json:"msg"`
}
type chatInChannel struct {
Name string `json:"name"`
Public bool `json:"public"`
MembersType string `json:"members_type"`
TopicType string `json:"topic_type"`
TopicName string `json:"topic_name"`
}
type chatInSender struct {
UID string `json:"uid"`
Username string `json:"username"`
DeviceID string `json:"device_id"`
DeviceName string `json:"device_name"`
}
type chatInAddedtoteam struct {
Team string `json:"team"`
Adder string `json:"adder"`
Addee string `json:"addee"`
Owners []string `json:"owners"`
Admins []string `json:"admins"`
Writers []string `json:"writers"`
Readers []string `json:"readers"`
}
type chatInBulkaddtoconv struct {
Usernames []string `json:"usernames"`
}
type chatInSystem struct {
SystemType int `json:"systemType"`
Addedtoteam chatInAddedtoteam `json:"addedtoteam"`
Bulkaddtoconv chatInBulkaddtoconv `json:"bulkaddtoconv"`
}
type chatInResult struct {
ResultTyp int `json:"resultTyp"`
Sent string `json:"sent"`
}
type chatInPayments struct {
Username string `json:"username"`
PaymentText string `json:"paymentText"`
Result chatInResult `json:"result"`
}
type chatInUserMentions struct {
Text string `json:"text"`
UID string `json:"uid"`
}
type chatInTeamMentions struct {
Name string `json:"name"`
Channel string `json:"channel"`
}
type chatInReaction struct {
M int `json:"m"`
B string `json:"b"`
}
type chatInDelete struct {
MessageIDs []int `json:"messageIDs"`
}
type chatInEdit struct {
MessageID int `json:"messageID"`
Body string `json:"body"`
Payments []chatInPayments `json:"payments"`
UserMentions []chatInUserMentions `json:"userMentions"`
TeamMentions []chatInTeamMentions `json:"teamMentions"`
}
type chatInText struct {
Body string `json:"body"`
Payments []chatInPayments `json:"payments"`
UserMentions []chatInUserMentions `json:"userMentions"`
TeamMentions []chatInTeamMentions `json:"teamMentions"`
}
type chatInContent struct {
Type string `json:"type"`
Delete chatInDelete `json:"delete"`
Edit chatInEdit `json:"edit"`
Reaction chatInReaction `json:"reaction"`
System chatInSystem `json:"system"`
Text chatInText `json:"text"`
}
type chatInMsg struct {
ID int `json:"id"`
Channel chatInChannel `json:"channel"`
Sender chatInSender `json:"sender"`
SentAt int `json:"sent_at"`
SentAtMs int64 `json:"sent_at_ms"`
Content chatInContent `json:"content"`
Unread bool `json:"unread"`
AtMentionUsernames []string `json:"at_mention_usernames"`
IsEphemeral bool `json:"is_ephemeral"`
Etime int64 `json:"etime"`
HasPairwiseMacs bool `json:"has_pairwise_macs"`
ChannelMention string `json:"channel_mention"`
}

3
go.mod

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
module keybase
go 1.12
Loading…
Cancel
Save