Update kekeybase/go-keybase-chat-bot vendor

This commit is contained in:
Wim 2020-02-08 16:50:16 +01:00
parent 1420f68050
commit ff8cf067b8
158 changed files with 39510 additions and 554 deletions

2
go.mod
View File

@ -19,7 +19,7 @@ require (
github.com/hashicorp/golang-lru v0.5.3
github.com/hpcloud/tail v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0
github.com/keybase/go-keybase-chat-bot v0.0.0-20190816161829-561f10822eb2
github.com/keybase/go-keybase-chat-bot v0.0.0-20200207200343-9aca502dc88a
github.com/labstack/echo/v4 v4.1.13
github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20190210153444-cc9d05784d5d

4
go.sum
View File

@ -100,8 +100,8 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 h1:PJPDf8OUfOK1bb/NeTKd4f1QXZItOX389VN3B6qC8ro=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/keybase/go-keybase-chat-bot v0.0.0-20190816161829-561f10822eb2 h1:zacJswvfPqUSGdcBXJzKvLN/dB1UjDGDvDesMBBzoA4=
github.com/keybase/go-keybase-chat-bot v0.0.0-20190816161829-561f10822eb2/go.mod h1:vNc28YFzigVJod0j5EbuTtRIe7swx8vodh2yA4jZ2s8=
github.com/keybase/go-keybase-chat-bot v0.0.0-20200207200343-9aca502dc88a h1:vwIVtvtOEn0edqYFeSTklvSmZG9WrnG5EywouKzZs1s=
github.com/keybase/go-keybase-chat-bot v0.0.0-20200207200343-9aca502dc88a/go.mod h1:vNc28YFzigVJod0j5EbuTtRIe7swx8vodh2yA4jZ2s8=
github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999 h1:2d+FLQbz4xRTi36DO1qYNUwfORax9XcQ0jhbO81Vago=
github.com/keybase/go-ps v0.0.0-20161005175911-668c8856d999/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=

View File

@ -0,0 +1,651 @@
package kbchat
import (
"encoding/json"
"errors"
"fmt"
"github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1"
"github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1"
)
type Thread struct {
Result chat1.Thread `json:"result"`
Error *Error `json:"error,omitempty"`
}
type Inbox struct {
Result Result `json:"result"`
Error *Error `json:"error,omitempty"`
}
type sendMessageBody struct {
Body string
}
type sendMessageOptions struct {
Channel chat1.ChatChannel `json:"channel,omitempty"`
ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"`
Message sendMessageBody `json:",omitempty"`
Filename string `json:"filename,omitempty"`
Title string `json:"title,omitempty"`
MsgID chat1.MessageID `json:"message_id,omitempty"`
ConfirmLumenSend bool `json:"confirm_lumen_send"`
ReplyTo *chat1.MessageID `json:"reply_to,omitempty"`
}
type sendMessageParams struct {
Options sendMessageOptions
}
type sendMessageArg struct {
Method string
Params sendMessageParams
}
func newSendArg(options sendMessageOptions) sendMessageArg {
return sendMessageArg{
Method: "send",
Params: sendMessageParams{
Options: options,
},
}
}
// GetConversations reads all conversations from the current user's inbox.
func (a *API) GetConversations(unreadOnly bool) ([]chat1.ConvSummary, error) {
apiInput := fmt.Sprintf(`{"method":"list", "params": { "options": { "unread_only": %v}}}`, unreadOnly)
output, err := a.doFetch(apiInput)
if err != nil {
return nil, err
}
var inbox Inbox
if err := json.Unmarshal(output, &inbox); err != nil {
return nil, err
} else if inbox.Error != nil {
return nil, errors.New(inbox.Error.Message)
}
return inbox.Result.Convs, nil
}
func (a *API) GetConversation(convID chat1.ConvIDStr) (res chat1.ConvSummary, err error) {
apiInput := fmt.Sprintf(`{"method":"list", "params": { "options": { "conversation_id": "%s"}}}`, convID)
output, err := a.doFetch(apiInput)
if err != nil {
return res, err
}
var inbox Inbox
if err := json.Unmarshal(output, &inbox); err != nil {
return res, err
} else if inbox.Error != nil {
return res, errors.New(inbox.Error.Message)
} else if len(inbox.Result.Convs) == 0 {
return res, errors.New("conversation not found")
}
return inbox.Result.Convs[0], nil
}
// GetTextMessages fetches all text messages from a given channel. Optionally can filter
// ont unread status.
func (a *API) GetTextMessages(channel chat1.ChatChannel, unreadOnly bool) ([]chat1.MsgSummary, error) {
channelBytes, err := json.Marshal(channel)
if err != nil {
return nil, err
}
apiInput := fmt.Sprintf(`{"method": "read", "params": {"options": {"channel": %s}}}`, string(channelBytes))
output, err := a.doFetch(apiInput)
if err != nil {
return nil, err
}
var thread Thread
if err := json.Unmarshal(output, &thread); err != nil {
return nil, fmt.Errorf("unable to decode thread: %v", err)
} else if thread.Error != nil {
return nil, errors.New(thread.Error.Message)
}
var res []chat1.MsgSummary
for _, msg := range thread.Result.Messages {
if msg.Msg.Content.TypeName == "text" {
res = append(res, *msg.Msg)
}
}
return res, nil
}
func (a *API) SendMessage(channel chat1.ChatChannel, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
Channel: channel,
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
})
return a.doSend(arg)
}
func (a *API) Broadcast(body string, args ...interface{}) (SendResponse, error) {
return a.SendMessage(chat1.ChatChannel{
Name: a.GetUsername(),
Public: true,
}, fmt.Sprintf(body, args...))
}
func (a *API) SendMessageByConvID(convID chat1.ConvIDStr, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
ConversationID: convID,
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
})
return a.doSend(arg)
}
// SendMessageByTlfName sends a message on the given TLF name
func (a *API) SendMessageByTlfName(tlfName string, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
Channel: chat1.ChatChannel{
Name: tlfName,
},
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
})
return a.doSend(arg)
}
func (a *API) SendMessageByTeamName(teamName string, inChannel *string, body string, args ...interface{}) (SendResponse, error) {
channel := "general"
if inChannel != nil {
channel = *inChannel
}
arg := newSendArg(sendMessageOptions{
Channel: chat1.ChatChannel{
MembersType: "team",
Name: teamName,
TopicName: channel,
},
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
})
return a.doSend(arg)
}
func (a *API) SendReply(channel chat1.ChatChannel, replyTo *chat1.MessageID, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
Channel: channel,
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
ReplyTo: replyTo,
})
return a.doSend(arg)
}
func (a *API) SendReplyByConvID(convID chat1.ConvIDStr, replyTo *chat1.MessageID, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
ConversationID: convID,
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
ReplyTo: replyTo,
})
return a.doSend(arg)
}
func (a *API) SendReplyByTlfName(tlfName string, replyTo *chat1.MessageID, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
Channel: chat1.ChatChannel{
Name: tlfName,
},
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
ReplyTo: replyTo,
})
return a.doSend(arg)
}
func (a *API) SendAttachmentByTeam(teamName string, inChannel *string, filename string, title string) (SendResponse, error) {
channel := "general"
if inChannel != nil {
channel = *inChannel
}
arg := sendMessageArg{
Method: "attach",
Params: sendMessageParams{
Options: sendMessageOptions{
Channel: chat1.ChatChannel{
MembersType: "team",
Name: teamName,
TopicName: channel,
},
Filename: filename,
Title: title,
},
},
}
return a.doSend(arg)
}
func (a *API) SendAttachmentByConvID(convID chat1.ConvIDStr, filename string, title string) (SendResponse, error) {
arg := sendMessageArg{
Method: "attach",
Params: sendMessageParams{
Options: sendMessageOptions{
ConversationID: convID,
Filename: filename,
Title: title,
},
},
}
return a.doSend(arg)
}
////////////////////////////////////////////////////////
// React to chat ///////////////////////////////////////
////////////////////////////////////////////////////////
type reactionOptions struct {
ConversationID chat1.ConvIDStr `json:"conversation_id"`
Message sendMessageBody
MsgID chat1.MessageID `json:"message_id"`
Channel chat1.ChatChannel `json:"channel"`
}
type reactionParams struct {
Options reactionOptions
}
type reactionArg struct {
Method string
Params reactionParams
}
func newReactionArg(options reactionOptions) reactionArg {
return reactionArg{
Method: "reaction",
Params: reactionParams{Options: options},
}
}
func (a *API) ReactByChannel(channel chat1.ChatChannel, msgID chat1.MessageID, reaction string) (SendResponse, error) {
arg := newReactionArg(reactionOptions{
Message: sendMessageBody{Body: reaction},
MsgID: msgID,
Channel: channel,
})
return a.doSend(arg)
}
func (a *API) ReactByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID, reaction string) (SendResponse, error) {
arg := newReactionArg(reactionOptions{
Message: sendMessageBody{Body: reaction},
MsgID: msgID,
ConversationID: convID,
})
return a.doSend(arg)
}
func (a *API) EditByConvID(convID chat1.ConvIDStr, msgID chat1.MessageID, text string) (SendResponse, error) {
arg := reactionArg{
Method: "edit",
Params: reactionParams{Options: reactionOptions{
Message: sendMessageBody{Body: text},
MsgID: msgID,
ConversationID: convID,
}},
}
return a.doSend(arg)
}
////////////////////////////////////////////////////////
// Manage channels /////////////////////////////////////
////////////////////////////////////////////////////////
type ChannelsList struct {
Result Result `json:"result"`
Error *Error `json:"error,omitempty"`
}
type JoinChannel struct {
Error *Error `json:"error,omitempty"`
Result chat1.EmptyRes `json:"result"`
}
type LeaveChannel struct {
Error *Error `json:"error,omitempty"`
Result chat1.EmptyRes `json:"result"`
}
func (a *API) ListChannels(teamName string) ([]string, error) {
apiInput := fmt.Sprintf(`{"method": "listconvsonname", "params": {"options": {"topic_type": "CHAT", "members_type": "team", "name": "%s"}}}`, teamName)
output, err := a.doFetch(apiInput)
if err != nil {
return nil, err
}
var channelsList ChannelsList
if err := json.Unmarshal(output, &channelsList); err != nil {
return nil, err
} else if channelsList.Error != nil {
return nil, errors.New(channelsList.Error.Message)
}
var channels []string
for _, conv := range channelsList.Result.Convs {
channels = append(channels, conv.Channel.TopicName)
}
return channels, nil
}
func (a *API) JoinChannel(teamName string, channelName string) (chat1.EmptyRes, error) {
empty := chat1.EmptyRes{}
apiInput := fmt.Sprintf(`{"method": "join", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName)
output, err := a.doFetch(apiInput)
if err != nil {
return empty, err
}
joinChannel := JoinChannel{}
err = json.Unmarshal(output, &joinChannel)
if err != nil {
return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err)
} else if joinChannel.Error != nil {
return empty, errors.New(joinChannel.Error.Message)
}
return joinChannel.Result, nil
}
func (a *API) LeaveChannel(teamName string, channelName string) (chat1.EmptyRes, error) {
empty := chat1.EmptyRes{}
apiInput := fmt.Sprintf(`{"method": "leave", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName)
output, err := a.doFetch(apiInput)
if err != nil {
return empty, err
}
leaveChannel := LeaveChannel{}
err = json.Unmarshal(output, &leaveChannel)
if err != nil {
return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err)
} else if leaveChannel.Error != nil {
return empty, errors.New(leaveChannel.Error.Message)
}
return leaveChannel.Result, nil
}
////////////////////////////////////////////////////////
// Send lumens in chat /////////////////////////////////
////////////////////////////////////////////////////////
func (a *API) InChatSend(channel chat1.ChatChannel, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
Channel: channel,
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
ConfirmLumenSend: true,
})
return a.doSend(arg)
}
func (a *API) InChatSendByConvID(convID chat1.ConvIDStr, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
ConversationID: convID,
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
ConfirmLumenSend: true,
})
return a.doSend(arg)
}
func (a *API) InChatSendByTlfName(tlfName string, body string, args ...interface{}) (SendResponse, error) {
arg := newSendArg(sendMessageOptions{
Channel: chat1.ChatChannel{
Name: tlfName,
},
Message: sendMessageBody{
Body: fmt.Sprintf(body, args...),
},
ConfirmLumenSend: true,
})
return a.doSend(arg)
}
////////////////////////////////////////////////////////
// Misc commands ///////////////////////////////////////
////////////////////////////////////////////////////////
type Advertisement struct {
Alias string `json:"alias,omitempty"`
Advertisements []chat1.AdvertiseCommandAPIParam
}
type ListCommandsResponse struct {
Result struct {
Commands []chat1.UserBotCommandOutput `json:"commands"`
} `json:"result"`
Error *Error `json:"error,omitempty"`
}
type advertiseCmdsParams struct {
Options Advertisement
}
type advertiseCmdsMsgArg struct {
Method string
Params advertiseCmdsParams
}
func newAdvertiseCmdsMsgArg(ad Advertisement) advertiseCmdsMsgArg {
return advertiseCmdsMsgArg{
Method: "advertisecommands",
Params: advertiseCmdsParams{
Options: ad,
},
}
}
func (a *API) AdvertiseCommands(ad Advertisement) (SendResponse, error) {
return a.doSend(newAdvertiseCmdsMsgArg(ad))
}
func (a *API) ClearCommands() error {
arg := struct {
Method string
}{
Method: "clearcommands",
}
_, err := a.doSend(arg)
return err
}
type listCmdsOptions struct {
Channel chat1.ChatChannel `json:"channel,omitempty"`
ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"`
}
type listCmdsParams struct {
Options listCmdsOptions
}
type listCmdsArg struct {
Method string
Params listCmdsParams
}
func newListCmdsArg(options listCmdsOptions) listCmdsArg {
return listCmdsArg{
Method: "listcommands",
Params: listCmdsParams{
Options: options,
},
}
}
func (a *API) ListCommands(channel chat1.ChatChannel) ([]chat1.UserBotCommandOutput, error) {
arg := newListCmdsArg(listCmdsOptions{
Channel: channel,
})
return a.listCommands(arg)
}
func (a *API) ListCommandsByConvID(convID chat1.ConvIDStr) ([]chat1.UserBotCommandOutput, error) {
arg := newListCmdsArg(listCmdsOptions{
ConversationID: convID,
})
return a.listCommands(arg)
}
func (a *API) listCommands(arg listCmdsArg) ([]chat1.UserBotCommandOutput, error) {
bArg, err := json.Marshal(arg)
if err != nil {
return nil, err
}
output, err := a.doFetch(string(bArg))
if err != nil {
return nil, err
}
var res ListCommandsResponse
if err := json.Unmarshal(output, &res); err != nil {
return nil, err
} else if res.Error != nil {
return nil, errors.New(res.Error.Message)
}
return res.Result.Commands, nil
}
type listMembersOptions struct {
Channel chat1.ChatChannel `json:"channel,omitempty"`
ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"`
}
type listMembersParams struct {
Options listMembersOptions
}
type listMembersArg struct {
Method string
Params listMembersParams
}
func newListMembersArg(options listMembersOptions) listMembersArg {
return listMembersArg{
Method: "listmembers",
Params: listMembersParams{
Options: options,
},
}
}
func (a *API) ListMembers(channel chat1.ChatChannel) (keybase1.TeamMembersDetails, error) {
arg := newListMembersArg(listMembersOptions{
Channel: channel,
})
return a.listMembers(arg)
}
func (a *API) ListMembersByConvID(conversationID chat1.ConvIDStr) (keybase1.TeamMembersDetails, error) {
arg := newListMembersArg(listMembersOptions{
ConversationID: conversationID,
})
return a.listMembers(arg)
}
func (a *API) listMembers(arg listMembersArg) (res keybase1.TeamMembersDetails, err error) {
bArg, err := json.Marshal(arg)
if err != nil {
return res, err
}
output, err := a.doFetch(string(bArg))
if err != nil {
return res, err
}
members := ListTeamMembers{}
err = json.Unmarshal(output, &members)
if err != nil {
return res, UnmarshalError{err}
}
if members.Error.Message != "" {
return res, members.Error
}
return members.Result.Members, nil
}
type GetMessagesResult struct {
Result struct {
Messages []chat1.Message `json:"messages"`
} `json:"result"`
Error *Error `json:"error,omitempty"`
}
type getMessagesOptions struct {
Channel chat1.ChatChannel `json:"channel,omitempty"`
ConversationID chat1.ConvIDStr `json:"conversation_id,omitempty"`
MessageIDs []chat1.MessageID `json:"message_ids,omitempty"`
}
type getMessagesParams struct {
Options getMessagesOptions
}
type getMessagesArg struct {
Method string
Params getMessagesParams
}
func newGetMessagesArg(options getMessagesOptions) getMessagesArg {
return getMessagesArg{
Method: "get",
Params: getMessagesParams{
Options: options,
},
}
}
func (a *API) GetMessages(channel chat1.ChatChannel, msgIDs []chat1.MessageID) ([]chat1.Message, error) {
arg := newGetMessagesArg(getMessagesOptions{
Channel: channel,
MessageIDs: msgIDs,
})
return a.getMessages(arg)
}
func (a *API) GetMessagesByConvID(conversationID chat1.ConvIDStr, msgIDs []chat1.MessageID) ([]chat1.Message, error) {
arg := newGetMessagesArg(getMessagesOptions{
ConversationID: conversationID,
MessageIDs: msgIDs,
})
return a.getMessages(arg)
}
func (a *API) getMessages(arg getMessagesArg) ([]chat1.Message, error) {
bArg, err := json.Marshal(arg)
if err != nil {
return nil, err
}
output, err := a.doFetch(string(bArg))
if err != nil {
return nil, err
}
var res GetMessagesResult
err = json.Unmarshal(output, &res)
if err != nil {
return nil, UnmarshalError{err}
}
if res.Error != nil {
return nil, res.Error
}
return res.Result.Messages, nil
}

View File

@ -0,0 +1,36 @@
package kbchat
import "fmt"
type ErrorCode int
const (
RevisionErrorCode ErrorCode = 2760
DeleteNonExistentErrorCode ErrorCode = 2762
)
// Error is for unmarshaling CLI json responses
type Error struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
}
func (e Error) Error() string {
return fmt.Sprintf("received error response from keybase api: %s", e.Message)
}
type APIError struct {
err error
}
func (e APIError) Error() string {
return fmt.Sprintf("failed to call keybase api: %v", e.err)
}
type UnmarshalError struct {
err error
}
func (e UnmarshalError) Error() string {
return fmt.Sprintf("failed to parse output from keybase api: %v", e.err)
}

View File

@ -6,21 +6,26 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"os/exec"
"strings"
"sync"
"time"
"github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1"
"github.com/keybase/go-keybase-chat-bot/kbchat/types/stellar1"
)
// API is the main object used for communicating with the Keybase JSON API
type API struct {
sync.Mutex
apiInput io.Writer
apiOutput *bufio.Reader
apiCmd *exec.Cmd
username string
runOpts RunOptions
apiInput io.Writer
apiOutput *bufio.Reader
apiCmd *exec.Cmd
username string
runOpts RunOptions
subscriptions []*NewSubscription
}
func getUsername(runOpts RunOptions) (username string, err error) {
@ -40,9 +45,10 @@ func getUsername(runOpts RunOptions) (username string, err error) {
doneCh <- errors.New("unable to find Keybase username")
return
}
toks := strings.Fields(scanner.Text())
text := scanner.Text()
toks := strings.Fields(text)
if len(toks) != 2 {
doneCh <- errors.New("invalid Keybase username output")
doneCh <- fmt.Errorf("invalid Keybase username output: %q", text)
return
}
username = toks[1]
@ -71,6 +77,10 @@ type RunOptions struct {
HomeDir string
Oneshot *OneshotOptions
StartService bool
// Have the bot send/receive typing notifications
EnableTyping bool
// Disable bot lite mode
DisableBotLiteMode bool
}
func (r RunOptions) Location() string {
@ -100,6 +110,10 @@ func Start(runOpts RunOptions) (*API, error) {
return api, nil
}
func (a *API) Command(args ...string) *exec.Cmd {
return a.runOpts.Command(args...)
}
func (a *API) auth() (string, error) {
username, err := getUsername(a.runOpts)
if err == nil {
@ -132,17 +146,28 @@ func (a *API) startPipes() (err error) {
a.Lock()
defer a.Unlock()
if a.apiCmd != nil {
a.apiCmd.Process.Kill()
if err := a.apiCmd.Process.Kill(); err != nil {
return err
}
}
a.apiCmd = nil
if a.runOpts.StartService {
a.runOpts.Command("service").Start()
args := []string{fmt.Sprintf("-enable-bot-lite-mode=%v", a.runOpts.DisableBotLiteMode), "service"}
if err := a.runOpts.Command(args...).Start(); err != nil {
return err
}
}
if a.username, err = a.auth(); err != nil {
return err
}
cmd := a.runOpts.Command("chat", "notification-settings", fmt.Sprintf("-disable-typing=%v", !a.runOpts.EnableTyping))
if err = cmd.Run(); err != nil {
return err
}
a.apiCmd = a.runOpts.Command("chat", "api")
if a.apiInput, err = a.apiCmd.StdinPipe(); err != nil {
return err
@ -168,73 +193,11 @@ func (a *API) getAPIPipesLocked() (io.Writer, *bufio.Reader, error) {
return a.apiInput, a.apiOutput, nil
}
// GetConversations reads all conversations from the current user's inbox.
func (a *API) GetConversations(unreadOnly bool) ([]Conversation, error) {
apiInput := fmt.Sprintf(`{"method":"list", "params": { "options": { "unread_only": %v}}}`, unreadOnly)
output, err := a.doFetch(apiInput)
if err != nil {
return nil, err
}
var inbox Inbox
if err := json.Unmarshal(output, &inbox); err != nil {
return nil, err
}
return inbox.Result.Convs, nil
func (a *API) GetUsername() string {
return a.username
}
// GetTextMessages fetches all text messages from a given channel. Optionally can filter
// ont unread status.
func (a *API) GetTextMessages(channel Channel, unreadOnly bool) ([]Message, error) {
channelBytes, err := json.Marshal(channel)
if err != nil {
return nil, err
}
apiInput := fmt.Sprintf(`{"method": "read", "params": {"options": {"channel": %s}}}`, string(channelBytes))
output, err := a.doFetch(apiInput)
if err != nil {
return nil, err
}
var thread Thread
if err := json.Unmarshal(output, &thread); err != nil {
return nil, fmt.Errorf("unable to decode thread: %s", err.Error())
}
var res []Message
for _, msg := range thread.Result.Messages {
if msg.Msg.Content.Type == "text" {
res = append(res, msg.Msg)
}
}
return res, nil
}
type sendMessageBody struct {
Body string
}
type sendMessageOptions struct {
Channel Channel `json:"channel,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
Message sendMessageBody `json:",omitempty"`
Filename string `json:"filename,omitempty"`
Title string `json:"title,omitempty"`
MsgID int `json:"message_id,omitempty"`
}
type sendMessageParams struct {
Options sendMessageOptions
}
type sendMessageArg struct {
Method string
Params sendMessageParams
}
func (a *API) doSend(arg interface{}) (response SendResponse, err error) {
func (a *API) doSend(arg interface{}) (resp SendResponse, err error) {
a.Lock()
defer a.Unlock()
@ -253,10 +216,12 @@ func (a *API) doSend(arg interface{}) (response SendResponse, err error) {
if err != nil {
return SendResponse{}, err
}
if err := json.Unmarshal(responseRaw, &response); err != nil {
return SendResponse{}, fmt.Errorf("failed to decode API response: %s", err)
if err := json.Unmarshal(responseRaw, &resp); err != nil {
return resp, fmt.Errorf("failed to decode API response: %s", err)
} else if resp.Error != nil {
return resp, errors.New(resp.Error.Message)
}
return response, nil
return resp, nil
}
func (a *API) doFetch(apiInput string) ([]byte, error) {
@ -278,234 +243,121 @@ func (a *API) doFetch(apiInput string) ([]byte, error) {
return byteOutput, nil
}
func (a *API) SendMessage(channel Channel, body string) (SendResponse, error) {
arg := sendMessageArg{
Method: "send",
Params: sendMessageParams{
Options: sendMessageOptions{
Channel: channel,
Message: sendMessageBody{
Body: body,
},
},
},
}
return a.doSend(arg)
}
func (a *API) SendMessageByConvID(convID string, body string) (SendResponse, error) {
arg := sendMessageArg{
Method: "send",
Params: sendMessageParams{
Options: sendMessageOptions{
ConversationID: convID,
Message: sendMessageBody{
Body: body,
},
},
},
}
return a.doSend(arg)
}
// SendMessageByTlfName sends a message on the given TLF name
func (a *API) SendMessageByTlfName(tlfName string, body string) (SendResponse, error) {
arg := sendMessageArg{
Method: "send",
Params: sendMessageParams{
Options: sendMessageOptions{
Channel: Channel{
Name: tlfName,
},
Message: sendMessageBody{
Body: body,
},
},
},
}
return a.doSend(arg)
}
func (a *API) SendMessageByTeamName(teamName string, body string, inChannel *string) (SendResponse, error) {
channel := "general"
if inChannel != nil {
channel = *inChannel
}
arg := sendMessageArg{
Method: "send",
Params: sendMessageParams{
Options: sendMessageOptions{
Channel: Channel{
MembersType: "team",
Name: teamName,
TopicName: channel,
},
Message: sendMessageBody{
Body: body,
},
},
},
}
return a.doSend(arg)
}
func (a *API) SendAttachmentByTeam(teamName string, filename string, title string, inChannel *string) (SendResponse, error) {
channel := "general"
if inChannel != nil {
channel = *inChannel
}
arg := sendMessageArg{
Method: "attach",
Params: sendMessageParams{
Options: sendMessageOptions{
Channel: Channel{
MembersType: "team",
Name: teamName,
TopicName: channel,
},
Filename: filename,
Title: title,
},
},
}
return a.doSend(arg)
}
type reactionOptions struct {
ConversationID string `json:"conversation_id"`
Message sendMessageBody
MsgID int `json:"message_id"`
Channel Channel `json:"channel"`
}
type reactionParams struct {
Options reactionOptions
}
type reactionArg struct {
Method string
Params reactionParams
}
func newReactionArg(options reactionOptions) reactionArg {
return reactionArg{
Method: "reaction",
Params: reactionParams{Options: options},
}
}
func (a *API) ReactByChannel(channel Channel, msgID int, reaction string) (SendResponse, error) {
arg := newReactionArg(reactionOptions{
Message: sendMessageBody{Body: reaction},
MsgID: msgID,
Channel: channel,
})
return a.doSend(arg)
}
func (a *API) ReactByConvID(convID string, msgID int, reaction string) (SendResponse, error) {
arg := newReactionArg(reactionOptions{
Message: sendMessageBody{Body: reaction},
MsgID: msgID,
ConversationID: convID,
})
return a.doSend(arg)
}
type advertiseParams struct {
Options Advertisement
}
type advertiseMsgArg struct {
Method string
Params advertiseParams
}
func newAdvertiseMsgArg(ad Advertisement) advertiseMsgArg {
return advertiseMsgArg{
Method: "advertisecommands",
Params: advertiseParams{
Options: ad,
},
}
}
func (a *API) AdvertiseCommands(ad Advertisement) (SendResponse, error) {
return a.doSend(newAdvertiseMsgArg(ad))
}
func (a *API) Username() string {
return a.username
}
// SubscriptionMessage contains a message and conversation object
type SubscriptionMessage struct {
Message Message
Conversation Conversation
Message chat1.MsgSummary
Conversation chat1.ConvSummary
}
type SubscriptionConversation struct {
Conversation chat1.ConvSummary
}
type SubscriptionWalletEvent struct {
Payment Payment
Payment stellar1.PaymentDetailsLocal
}
// NewSubscription has methods to control the background message fetcher loop
type NewSubscription struct {
sync.Mutex
newMsgsCh <-chan SubscriptionMessage
newConvsCh <-chan SubscriptionConversation
newWalletCh <-chan SubscriptionWalletEvent
errorCh <-chan error
running bool
shutdownCh chan struct{}
}
// Read blocks until a new message arrives
func (m NewSubscription) Read() (SubscriptionMessage, error) {
func (m *NewSubscription) Read() (SubscriptionMessage, error) {
select {
case msg := <-m.newMsgsCh:
return msg, nil
case err := <-m.errorCh:
return SubscriptionMessage{}, err
case <-m.shutdownCh:
return SubscriptionMessage{}, errors.New("Subscription shutdown")
}
}
func (m *NewSubscription) ReadNewConvs() (SubscriptionConversation, error) {
select {
case conv := <-m.newConvsCh:
return conv, nil
case err := <-m.errorCh:
return SubscriptionConversation{}, err
case <-m.shutdownCh:
return SubscriptionConversation{}, errors.New("Subscription shutdown")
}
}
// Read blocks until a new message arrives
func (m NewSubscription) ReadWallet() (SubscriptionWalletEvent, error) {
func (m *NewSubscription) ReadWallet() (SubscriptionWalletEvent, error) {
select {
case msg := <-m.newWalletCh:
return msg, nil
case err := <-m.errorCh:
return SubscriptionWalletEvent{}, err
case <-m.shutdownCh:
return SubscriptionWalletEvent{}, errors.New("Subscription shutdown")
}
}
// Shutdown terminates the background process
func (m NewSubscription) Shutdown() {
m.shutdownCh <- struct{}{}
func (m *NewSubscription) Shutdown() {
m.Lock()
defer m.Unlock()
if m.running {
close(m.shutdownCh)
m.running = false
}
}
type ListenOptions struct {
Wallet bool
Convs bool
}
type PaymentHolder struct {
Payment stellar1.PaymentDetailsLocal `json:"notification"`
}
type TypeHolder struct {
Type string `json:"type"`
}
// ListenForNewTextMessages proxies to Listen without wallet events
func (a *API) ListenForNewTextMessages() (NewSubscription, error) {
func (a *API) ListenForNewTextMessages() (*NewSubscription, error) {
opts := ListenOptions{Wallet: false}
return a.Listen(opts)
}
func (a *API) registerSubscription(sub *NewSubscription) {
a.Lock()
defer a.Unlock()
a.subscriptions = append(a.subscriptions, sub)
}
// Listen fires of a background loop and puts chat messages and wallet
// events into channels
func (a *API) Listen(opts ListenOptions) (NewSubscription, error) {
newMsgCh := make(chan SubscriptionMessage, 100)
func (a *API) Listen(opts ListenOptions) (*NewSubscription, error) {
newMsgsCh := make(chan SubscriptionMessage, 100)
newConvsCh := make(chan SubscriptionConversation, 100)
newWalletCh := make(chan SubscriptionWalletEvent, 100)
errorCh := make(chan error, 100)
shutdownCh := make(chan struct{})
done := make(chan struct{})
sub := NewSubscription{
newMsgsCh: newMsgCh,
sub := &NewSubscription{
newMsgsCh: newMsgsCh,
newConvsCh: newConvsCh,
newWalletCh: newWalletCh,
shutdownCh: shutdownCh,
errorCh: errorCh,
running: true,
}
a.registerSubscription(sub)
pause := 2 * time.Second
readScanner := func(boutput *bufio.Scanner) {
for {
@ -518,28 +370,44 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) {
}
switch typeHolder.Type {
case "chat":
var holder MessageHolder
if err := json.Unmarshal([]byte(t), &holder); err != nil {
var notification chat1.MsgNotification
if err := json.Unmarshal([]byte(t), &notification); err != nil {
errorCh <- err
break
}
subscriptionMessage := SubscriptionMessage{
Message: holder.Msg,
Conversation: Conversation{
ID: holder.Msg.ConversationID,
Channel: holder.Msg.Channel,
},
if notification.Error != nil {
log.Printf("error message received: %s", *notification.Error)
} else if notification.Msg != nil {
subscriptionMessage := SubscriptionMessage{
Message: *notification.Msg,
Conversation: chat1.ConvSummary{
Id: notification.Msg.ConvID,
Channel: notification.Msg.Channel,
},
}
newMsgsCh <- subscriptionMessage
}
case "chat_conv":
var notification chat1.ConvNotification
if err := json.Unmarshal([]byte(t), &notification); err != nil {
errorCh <- err
break
}
if notification.Error != nil {
log.Printf("error message received: %s", *notification.Error)
} else if notification.Conv != nil {
subscriptionConv := SubscriptionConversation{
Conversation: *notification.Conv,
}
newConvsCh <- subscriptionConv
}
newMsgCh <- subscriptionMessage
case "wallet":
var holder PaymentHolder
if err := json.Unmarshal([]byte(t), &holder); err != nil {
errorCh <- err
break
}
subscriptionPayment := SubscriptionWalletEvent{
Payment: holder.Payment,
}
subscriptionPayment := SubscriptionWalletEvent(holder)
newWalletCh <- subscriptionPayment
default:
continue
@ -552,6 +420,13 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) {
maxAttempts := 1800
go func() {
for {
select {
case <-shutdownCh:
log.Printf("Listen: received shutdown")
return
default:
}
if attempts >= maxAttempts {
panic("Listen: failed to auth, giving up")
}
@ -565,6 +440,9 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) {
if opts.Wallet {
cmdElements = append(cmdElements, "--wallet")
}
if opts.Convs {
cmdElements = append(cmdElements, "--convs")
}
p := a.runOpts.Command(cmdElements...)
output, err := p.StdoutPipe()
if err != nil {
@ -572,6 +450,12 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) {
time.Sleep(pause)
continue
}
stderr, err := p.StderrPipe()
if err != nil {
log.Printf("Listen: failed to listen to stderr: %s", err)
time.Sleep(pause)
continue
}
boutput := bufio.NewScanner(output)
if err := p.Start(); err != nil {
log.Printf("Listen: failed to make listen scanner: %s", err)
@ -581,78 +465,19 @@ func (a *API) Listen(opts ListenOptions) (NewSubscription, error) {
attempts = 0
go readScanner(boutput)
<-done
p.Wait()
if err := p.Wait(); err != nil {
stderrBytes, rerr := ioutil.ReadAll(stderr)
if rerr != nil {
stderrBytes = []byte("failed to get stderr")
}
log.Printf("Listen: failed to Wait for command: %s (```%s```)", err, stderrBytes)
}
time.Sleep(pause)
}
}()
return sub, nil
}
func (a *API) GetUsername() string {
return a.username
}
func (a *API) ListChannels(teamName string) ([]string, error) {
apiInput := fmt.Sprintf(`{"method": "listconvsonname", "params": {"options": {"topic_type": "CHAT", "members_type": "team", "name": "%s"}}}`, teamName)
output, err := a.doFetch(apiInput)
if err != nil {
return nil, err
}
var channelsList ChannelsList
if err := json.Unmarshal(output, &channelsList); err != nil {
return nil, err
}
var channels []string
for _, conv := range channelsList.Result.Convs {
channels = append(channels, conv.Channel.TopicName)
}
return channels, nil
}
func (a *API) JoinChannel(teamName string, channelName string) (JoinChannelResult, error) {
empty := JoinChannelResult{}
apiInput := fmt.Sprintf(`{"method": "join", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName)
output, err := a.doFetch(apiInput)
if err != nil {
return empty, err
}
joinChannel := JoinChannel{}
err = json.Unmarshal(output, &joinChannel)
if err != nil {
return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err)
}
if joinChannel.Error.Message != "" {
return empty, fmt.Errorf("received error from keybase team api: %s", joinChannel.Error.Message)
}
return joinChannel.Result, nil
}
func (a *API) LeaveChannel(teamName string, channelName string) (LeaveChannelResult, error) {
empty := LeaveChannelResult{}
apiInput := fmt.Sprintf(`{"method": "leave", "params": {"options": {"channel": {"name": "%s", "members_type": "team", "topic_name": "%s"}}}}`, teamName, channelName)
output, err := a.doFetch(apiInput)
if err != nil {
return empty, err
}
leaveChannel := LeaveChannel{}
err = json.Unmarshal(output, &leaveChannel)
if err != nil {
return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err)
}
if leaveChannel.Error.Message != "" {
return empty, fmt.Errorf("received error from keybase team api: %s", leaveChannel.Error.Message)
}
return leaveChannel.Result, nil
}
func (a *API) LogSend(feedback string) error {
feedback = "go-keybase-chat-bot log send\n" +
"username: " + a.GetUsername() + "\n" +
@ -675,6 +500,12 @@ func (a *API) LogSend(feedback string) error {
}
func (a *API) Shutdown() error {
a.Lock()
defer a.Unlock()
for _, sub := range a.subscriptions {
sub.Shutdown()
}
if a.runOpts.Oneshot != nil {
err := a.runOpts.Command("logout", "--force").Run()
if err != nil {

View File

@ -0,0 +1,228 @@
package kbchat
import (
"encoding/json"
"strings"
"github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1"
)
type kvstoreMethod string
type kvstoreOptions struct {
Team *string `json:"team"`
Namespace *string `json:"namespace,omitempty"`
EntryKey *string `json:"entryKey,omitempty"`
EntryValue *string `json:"entryValue,omitempty"`
Revision *int `json:"revision,omitempty"`
}
type kvstoreParams struct {
Options kvstoreOptions `json:"options"`
}
type kvstoreAPIReq struct {
Method kvstoreMethod `json:"method"`
Params kvstoreParams `json:"params"`
}
type GetEntryRes struct {
Result keybase1.KVGetResult `json:"result"`
Error Error `json:"error,omitempty"`
}
type PutEntryRes struct {
Result keybase1.KVPutResult `json:"result"`
Error Error `json:"error,omitempty"`
}
type DeleteEntryRes struct {
Result keybase1.KVDeleteEntryResult `json:"result"`
Error Error `json:"error,omitempty"`
}
type ListNamespacesRes struct {
Result keybase1.KVListNamespaceResult `json:"result"`
Error Error `json:"error,omitempty"`
}
type ListEntryKeysRes struct {
Result keybase1.KVListEntryResult `json:"result"`
Error Error `json:"error,omitempty"`
}
type KVStoreAPI interface {
PutEntry(teamName *string, namespace string, entryKey string, entryValue string) (keybase1.KVPutResult, error)
PutEntryWithRevision(teamName *string, namespace string, entryKey string, entryValue string, revision int) (keybase1.KVPutResult, error)
DeleteEntry(teamName *string, namespace string, entryKey string) (keybase1.KVDeleteEntryResult, error)
DeleteEntryWithRevision(teamName *string, namespace string, entryKey string, revision int) (keybase1.KVDeleteEntryResult, error)
GetEntry(teamName *string, namespace string, entryKey string) (keybase1.KVGetResult, error)
ListNamespaces(teamName *string) (keybase1.KVListNamespaceResult, error)
ListEntryKeys(teamName *string, namespace string) (keybase1.KVListEntryResult, error)
}
func (a *API) PutEntry(teamName *string, namespace string, entryKey string, entryValue string) (result keybase1.KVPutResult, err error) {
return a.PutEntryWithRevision(teamName, namespace, entryKey, entryValue, 0)
}
func (a *API) PutEntryWithRevision(teamName *string, namespace string, entryKey string, entryValue string, revision int) (result keybase1.KVPutResult, err error) {
opts := kvstoreOptions{
Team: teamName,
Namespace: &namespace,
EntryKey: &entryKey,
EntryValue: &entryValue,
}
if revision != 0 {
opts.Revision = &revision
}
args := kvstoreAPIReq{Method: "put", Params: kvstoreParams{Options: opts}}
apiInput, err := json.Marshal(args)
if err != nil {
return result, err
}
cmd := a.runOpts.Command("kvstore", "api")
cmd.Stdin = strings.NewReader(string(apiInput))
bytes, err := cmd.Output()
if err != nil {
return result, APIError{err}
}
entry := PutEntryRes{}
err = json.Unmarshal(bytes, &entry)
if err != nil {
return result, UnmarshalError{err}
}
if entry.Error.Message != "" {
return result, entry.Error
}
return entry.Result, nil
}
func (a *API) DeleteEntry(teamName *string, namespace string, entryKey string) (result keybase1.KVDeleteEntryResult, err error) {
return a.DeleteEntryWithRevision(teamName, namespace, entryKey, 0)
}
func (a *API) DeleteEntryWithRevision(teamName *string, namespace string, entryKey string, revision int) (result keybase1.KVDeleteEntryResult, err error) {
opts := kvstoreOptions{
Team: teamName,
Namespace: &namespace,
EntryKey: &entryKey,
}
if revision != 0 {
opts.Revision = &revision
}
args := kvstoreAPIReq{Method: "del", Params: kvstoreParams{Options: opts}}
apiInput, err := json.Marshal(args)
if err != nil {
return result, err
}
cmd := a.runOpts.Command("kvstore", "api")
cmd.Stdin = strings.NewReader(string(apiInput))
bytes, err := cmd.Output()
if err != nil {
return result, APIError{err}
}
entry := DeleteEntryRes{}
err = json.Unmarshal(bytes, &entry)
if err != nil {
return result, UnmarshalError{err}
}
if entry.Error.Message != "" {
return result, entry.Error
}
return entry.Result, nil
}
func (a *API) GetEntry(teamName *string, namespace string, entryKey string) (result keybase1.KVGetResult, err error) {
opts := kvstoreOptions{
Team: teamName,
Namespace: &namespace,
EntryKey: &entryKey,
}
args := kvstoreAPIReq{Method: "get", Params: kvstoreParams{Options: opts}}
apiInput, err := json.Marshal(args)
if err != nil {
return result, err
}
cmd := a.runOpts.Command("kvstore", "api")
cmd.Stdin = strings.NewReader(string(apiInput))
bytes, err := cmd.Output()
if err != nil {
return result, APIError{err}
}
entry := GetEntryRes{}
err = json.Unmarshal(bytes, &entry)
if err != nil {
return result, UnmarshalError{err}
}
if entry.Error.Message != "" {
return result, entry.Error
}
return entry.Result, nil
}
func (a *API) ListNamespaces(teamName *string) (result keybase1.KVListNamespaceResult, err error) {
opts := kvstoreOptions{
Team: teamName,
}
args := kvstoreAPIReq{Method: "list", Params: kvstoreParams{Options: opts}}
apiInput, err := json.Marshal(args)
if err != nil {
return result, err
}
cmd := a.runOpts.Command("kvstore", "api")
cmd.Stdin = strings.NewReader(string(apiInput))
bytes, err := cmd.Output()
if err != nil {
return result, APIError{err}
}
var namespaces ListNamespacesRes
err = json.Unmarshal(bytes, &namespaces)
if err != nil {
return result, UnmarshalError{err}
}
if namespaces.Error.Message != "" {
return result, namespaces.Error
}
return namespaces.Result, nil
}
func (a *API) ListEntryKeys(teamName *string, namespace string) (result keybase1.KVListEntryResult, err error) {
opts := kvstoreOptions{
Team: teamName,
Namespace: &namespace,
}
args := kvstoreAPIReq{Method: "list", Params: kvstoreParams{Options: opts}}
apiInput, err := json.Marshal(args)
if err != nil {
return result, err
}
cmd := a.runOpts.Command("kvstore", "api")
cmd.Stdin = strings.NewReader(string(apiInput))
bytes, err := cmd.Output()
if err != nil {
return result, APIError{err}
}
entryKeys := ListEntryKeysRes{}
err = json.Unmarshal(bytes, &entryKeys)
if err != nil {
return result, UnmarshalError{err}
}
if entryKeys.Error.Message != "" {
return result, entryKeys.Error
}
return entryKeys.Result, nil
}

View File

@ -4,22 +4,13 @@ import (
"encoding/json"
"fmt"
"strings"
"github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1"
)
type ListTeamMembers struct {
Result ListTeamMembersResult `json:"result"`
Error Error `json:"error"`
}
type ListTeamMembersResult struct {
Members ListTeamMembersResultMembers `json:"members"`
}
type ListTeamMembersResultMembers struct {
Owners []ListMembersOutputMembersCategory `json:"owners"`
Admins []ListMembersOutputMembersCategory `json:"admins"`
Writers []ListMembersOutputMembersCategory `json:"writers"`
Readers []ListMembersOutputMembersCategory `json:"readers"`
Result keybase1.TeamDetails `json:"result"`
Error Error `json:"error"`
}
type ListMembersOutputMembersCategory struct {
@ -28,62 +19,46 @@ type ListMembersOutputMembersCategory struct {
}
type ListUserMemberships struct {
Result ListUserMembershipsResult `json:"result"`
Error Error `json:"error"`
Result keybase1.AnnotatedTeamList `json:"result"`
Error Error `json:"error"`
}
type ListUserMembershipsResult struct {
Teams []ListUserMembershipsResultTeam `json:"teams"`
}
type ListUserMembershipsResultTeam struct {
TeamName string `json:"fq_name"`
IsImplicitTeam bool `json:"is_implicit_team"`
IsOpenTeam bool `json:"is_open_team"`
Role int `json:"role"`
MemberCount int `json:"member_count"`
}
func (a *API) ListMembersOfTeam(teamName string) (ListTeamMembersResultMembers, error) {
empty := ListTeamMembersResultMembers{}
func (a *API) ListMembersOfTeam(teamName string) (res keybase1.TeamMembersDetails, err error) {
apiInput := fmt.Sprintf(`{"method": "list-team-memberships", "params": {"options": {"team": "%s"}}}`, teamName)
cmd := a.runOpts.Command("team", "api")
cmd.Stdin = strings.NewReader(apiInput)
bytes, err := cmd.CombinedOutput()
if err != nil {
return empty, fmt.Errorf("failed to call keybase team api: %v", err)
return res, APIError{err}
}
members := ListTeamMembers{}
err = json.Unmarshal(bytes, &members)
if err != nil {
return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err)
return res, UnmarshalError{err}
}
if members.Error.Message != "" {
return empty, fmt.Errorf("received error from keybase team api: %s", members.Error.Message)
return res, members.Error
}
return members.Result.Members, nil
}
func (a *API) ListUserMemberships(username string) ([]ListUserMembershipsResultTeam, error) {
empty := []ListUserMembershipsResultTeam{}
func (a *API) ListUserMemberships(username string) ([]keybase1.AnnotatedMemberInfo, error) {
apiInput := fmt.Sprintf(`{"method": "list-user-memberships", "params": {"options": {"username": "%s"}}}`, username)
cmd := a.runOpts.Command("team", "api")
cmd.Stdin = strings.NewReader(apiInput)
bytes, err := cmd.CombinedOutput()
if err != nil {
return empty, fmt.Errorf("failed to call keybase team api: %v", err)
return nil, APIError{err}
}
members := ListUserMemberships{}
err = json.Unmarshal(bytes, &members)
if err != nil {
return empty, fmt.Errorf("failed to parse output from keybase team api: %v", err)
return nil, UnmarshalError{err}
}
if members.Error.Message != "" {
return empty, fmt.Errorf("received error from keybase team api: %s", members.Error.Message)
return nil, members.Error
}
return members.Result.Teams, nil
}

View File

@ -1,16 +1,17 @@
# Rename this file to `test_config.yaml`
config:
bots:
alice:
username: "alice"
paperkey: "foo bar car..."
bob:
username: "bob"
paperkey: "one two three four..."
teams:
acme:
# A real team that you add your alice1 and bob1 into
name: "acme"
# The channel to use
topicname: "mysupercoolchannel"
keybase: "/path/to/keybase"
bots:
# Alice should have an active Stellar account with a little bit of XLM in it
alice:
username: "alice"
paperkey: "foo bar car..."
bob:
username: "bob"
paperkey: "one two three four..."
teams:
acme:
# A real team that you add your alice and bob into
name: "acme"
# The channel to use
topicname: "mysupercoolchannel"

View File

@ -41,9 +41,7 @@ func copyFile(t *testing.T, source, dest string) {
// Creates the working directory and copies over the keybase binary in PATH.
// We do this to avoid any version mismatch issues.
func prepWorkingDir(t *testing.T, workingDir string) string {
kbLocation := whichKeybase(t)
func prepWorkingDir(t *testing.T, workingDir string, kbLocation string) string {
err := os.Mkdir(workingDir, 0777)
require.NoError(t, err)
kbDestination := path.Join(workingDir, "keybase")

View File

@ -1,159 +1,14 @@
package kbchat
type Sender struct {
Uid string `json:"uid"`
Username string `json:"username"`
DeviceID string `json:"device_id"`
DeviceName string `json:"device_name"`
}
type Channel struct {
Name string `json:"name"`
Public bool `json:"public"`
TopicType string `json:"topic_type"`
TopicName string `json:"topic_name"`
MembersType string `json:"members_type"`
}
type Conversation struct {
ID string `json:"id"`
Unread bool `json:"unread"`
Channel Channel `json:"channel"`
}
type PaymentHolder struct {
Payment Payment `json:"notification"`
}
type Payment struct {
TxID string `json:"txID"`
StatusDescription string `json:"statusDescription"`
FromAccountID string `json:"fromAccountID"`
FromUsername string `json:"fromUsername"`
ToAccountID string `json:"toAccountID"`
ToUsername string `json:"toUsername"`
AmountDescription string `json:"amountDescription"`
WorthAtSendTime string `json:"worthAtSendTime"`
ExternalTxURL string `json:"externalTxURL"`
}
import (
"github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1"
)
type Result struct {
Convs []Conversation `json:"conversations"`
}
type Inbox struct {
Result Result `json:"result"`
}
type ChannelsList struct {
Result Result `json:"result"`
}
type MsgPaymentDetails struct {
ResultType int `json:"resultTyp"` // 0 good. 1 error
PaymentID string `json:"sent"`
}
type MsgPayment struct {
Username string `json:"username"`
PaymentText string `json:"paymentText"`
Details MsgPaymentDetails `json:"result"`
}
type Text struct {
Body string `json:"body"`
Payments []MsgPayment `json:"payments"`
ReplyTo int `json:"replyTo"`
}
type Content struct {
Type string `json:"type"`
Text Text `json:"text"`
}
type Message struct {
Content Content `json:"content"`
Sender Sender `json:"sender"`
Channel Channel `json:"channel"`
ConversationID string `json:"conversation_id"`
MsgID int `json:"id"`
}
type SendResult struct {
MsgID int `json:"id"`
Convs []chat1.ConvSummary `json:"conversations"`
}
type SendResponse struct {
Result SendResult `json:"result"`
}
type TypeHolder struct {
Type string `json:"type"`
}
type MessageHolder struct {
Msg Message `json:"msg"`
Source string `json:"source"`
}
type ThreadResult struct {
Messages []MessageHolder `json:"messages"`
}
type Thread struct {
Result ThreadResult `json:"result"`
}
type CommandExtendedDescription struct {
Title string `json:"title"`
DesktopBody string `json:"desktop_body"`
MobileBody string `json:"mobile_body"`
}
type Command struct {
Name string `json:"name"`
Description string `json:"description"`
Usage string `json:"usage"`
ExtendedDescription *CommandExtendedDescription `json:"extended_description,omitempty"`
}
type CommandsAdvertisement struct {
Typ string `json:"type"`
Commands []Command
TeamName string `json:"team_name,omitempty"`
}
type Advertisement struct {
Alias string `json:"alias,omitempty"`
Advertisements []CommandsAdvertisement
}
type Error struct {
Code int `json:"code"`
Message string `json:"message"`
}
type JoinChannel struct {
Error Error `json:"error"`
Result JoinChannelResult `json:"result"`
}
type JoinChannelResult struct {
RateLimit []RateLimit `json:"ratelimits"`
}
type LeaveChannel struct {
Error Error `json:"error"`
Result LeaveChannelResult `json:"result"`
}
type LeaveChannelResult struct {
RateLimit []RateLimit `json:"ratelimits"`
}
type RateLimit struct {
Tank string `json:"tank"`
Capacity int `json:"capacity"`
Reset int `json:"reset"`
Gas int `json:"gas"`
Result chat1.SendRes `json:"result"`
Error *Error `json:"error,omitempty"`
}

View File

@ -0,0 +1,933 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/chat1/api.avdl
package chat1
import (
gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1"
keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1"
)
type ConvIDStr string
func (o ConvIDStr) DeepCopy() ConvIDStr {
return o
}
type TLFIDStr string
func (o TLFIDStr) DeepCopy() TLFIDStr {
return o
}
type FlipGameIDStr string
func (o FlipGameIDStr) DeepCopy() FlipGameIDStr {
return o
}
type RateLimitRes struct {
Tank string `codec:"tank" json:"tank"`
Capacity int `codec:"capacity" json:"capacity"`
Reset int `codec:"reset" json:"reset"`
Gas int `codec:"gas" json:"gas"`
}
func (o RateLimitRes) DeepCopy() RateLimitRes {
return RateLimitRes{
Tank: o.Tank,
Capacity: o.Capacity,
Reset: o.Reset,
Gas: o.Gas,
}
}
// A Keybase chat channel. This can be a channel in a team, or just an informal channel between two users.
// name: the name of the team or comma-separated list of participants
type ChatChannel struct {
Name string `codec:"name" json:"name"`
Public bool `codec:"public,omitempty" json:"public,omitempty"`
MembersType string `codec:"membersType,omitempty" json:"members_type,omitempty"`
TopicType string `codec:"topicType,omitempty" json:"topic_type,omitempty"`
TopicName string `codec:"topicName,omitempty" json:"topic_name,omitempty"`
}
func (o ChatChannel) DeepCopy() ChatChannel {
return ChatChannel{
Name: o.Name,
Public: o.Public,
MembersType: o.MembersType,
TopicType: o.TopicType,
TopicName: o.TopicName,
}
}
// A chat message. The content goes in the `body` property!
type ChatMessage struct {
Body string `codec:"body" json:"body"`
}
func (o ChatMessage) DeepCopy() ChatMessage {
return ChatMessage{
Body: o.Body,
}
}
type MsgSender struct {
Uid keybase1.UID `codec:"uid" json:"uid"`
Username string `codec:"username,omitempty" json:"username,omitempty"`
DeviceID keybase1.DeviceID `codec:"deviceID" json:"device_id"`
DeviceName string `codec:"deviceName,omitempty" json:"device_name,omitempty"`
}
func (o MsgSender) DeepCopy() MsgSender {
return MsgSender{
Uid: o.Uid.DeepCopy(),
Username: o.Username,
DeviceID: o.DeviceID.DeepCopy(),
DeviceName: o.DeviceName,
}
}
type MsgBotInfo struct {
BotUID keybase1.UID `codec:"botUID" json:"bot_uid"`
BotUsername string `codec:"botUsername,omitempty" json:"bot_username,omitempty"`
}
func (o MsgBotInfo) DeepCopy() MsgBotInfo {
return MsgBotInfo{
BotUID: o.BotUID.DeepCopy(),
BotUsername: o.BotUsername,
}
}
type MsgFlipContent struct {
Text string `codec:"text" json:"text"`
GameID FlipGameIDStr `codec:"gameID" json:"game_id"`
FlipConvID ConvIDStr `codec:"flipConvID" json:"flip_conv_id"`
UserMentions []KnownUserMention `codec:"userMentions" json:"user_mentions"`
TeamMentions []KnownTeamMention `codec:"teamMentions" json:"team_mentions"`
}
func (o MsgFlipContent) DeepCopy() MsgFlipContent {
return MsgFlipContent{
Text: o.Text,
GameID: o.GameID.DeepCopy(),
FlipConvID: o.FlipConvID.DeepCopy(),
UserMentions: (func(x []KnownUserMention) []KnownUserMention {
if x == nil {
return nil
}
ret := make([]KnownUserMention, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.UserMentions),
TeamMentions: (func(x []KnownTeamMention) []KnownTeamMention {
if x == nil {
return nil
}
ret := make([]KnownTeamMention, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.TeamMentions),
}
}
type MsgContent struct {
TypeName string `codec:"typeName" json:"type"`
Text *MessageText `codec:"text,omitempty" json:"text,omitempty"`
Attachment *MessageAttachment `codec:"attachment,omitempty" json:"attachment,omitempty"`
Edit *MessageEdit `codec:"edit,omitempty" json:"edit,omitempty"`
Reaction *MessageReaction `codec:"reaction,omitempty" json:"reaction,omitempty"`
Delete *MessageDelete `codec:"delete,omitempty" json:"delete,omitempty"`
Metadata *MessageConversationMetadata `codec:"metadata,omitempty" json:"metadata,omitempty"`
Headline *MessageHeadline `codec:"headline,omitempty" json:"headline,omitempty"`
AttachmentUploaded *MessageAttachmentUploaded `codec:"attachmentUploaded,omitempty" json:"attachment_uploaded,omitempty"`
System *MessageSystem `codec:"system,omitempty" json:"system,omitempty"`
SendPayment *MessageSendPayment `codec:"sendPayment,omitempty" json:"send_payment,omitempty"`
RequestPayment *MessageRequestPayment `codec:"requestPayment,omitempty" json:"request_payment,omitempty"`
Unfurl *MessageUnfurl `codec:"unfurl,omitempty" json:"unfurl,omitempty"`
Flip *MsgFlipContent `codec:"flip,omitempty" json:"flip,omitempty"`
}
func (o MsgContent) DeepCopy() MsgContent {
return MsgContent{
TypeName: o.TypeName,
Text: (func(x *MessageText) *MessageText {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Text),
Attachment: (func(x *MessageAttachment) *MessageAttachment {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Attachment),
Edit: (func(x *MessageEdit) *MessageEdit {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Edit),
Reaction: (func(x *MessageReaction) *MessageReaction {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Reaction),
Delete: (func(x *MessageDelete) *MessageDelete {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Delete),
Metadata: (func(x *MessageConversationMetadata) *MessageConversationMetadata {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Metadata),
Headline: (func(x *MessageHeadline) *MessageHeadline {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Headline),
AttachmentUploaded: (func(x *MessageAttachmentUploaded) *MessageAttachmentUploaded {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.AttachmentUploaded),
System: (func(x *MessageSystem) *MessageSystem {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.System),
SendPayment: (func(x *MessageSendPayment) *MessageSendPayment {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.SendPayment),
RequestPayment: (func(x *MessageRequestPayment) *MessageRequestPayment {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.RequestPayment),
Unfurl: (func(x *MessageUnfurl) *MessageUnfurl {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Unfurl),
Flip: (func(x *MsgFlipContent) *MsgFlipContent {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Flip),
}
}
type MsgSummary struct {
Id MessageID `codec:"id" json:"id"`
ConvID ConvIDStr `codec:"convID" json:"conversation_id"`
Channel ChatChannel `codec:"channel" json:"channel"`
Sender MsgSender `codec:"sender" json:"sender"`
SentAt int64 `codec:"sentAt" json:"sent_at"`
SentAtMs int64 `codec:"sentAtMs" json:"sent_at_ms"`
Content MsgContent `codec:"content" json:"content"`
Prev []MessagePreviousPointer `codec:"prev" json:"prev"`
Unread bool `codec:"unread" json:"unread"`
RevokedDevice bool `codec:"revokedDevice,omitempty" json:"revoked_device,omitempty"`
Offline bool `codec:"offline,omitempty" json:"offline,omitempty"`
KbfsEncrypted bool `codec:"kbfsEncrypted,omitempty" json:"kbfs_encrypted,omitempty"`
IsEphemeral bool `codec:"isEphemeral,omitempty" json:"is_ephemeral,omitempty"`
IsEphemeralExpired bool `codec:"isEphemeralExpired,omitempty" json:"is_ephemeral_expired,omitempty"`
ETime gregor1.Time `codec:"eTime,omitempty" json:"e_time,omitempty"`
Reactions *ReactionMap `codec:"reactions,omitempty" json:"reactions,omitempty"`
HasPairwiseMacs bool `codec:"hasPairwiseMacs,omitempty" json:"has_pairwise_macs,omitempty"`
AtMentionUsernames []string `codec:"atMentionUsernames,omitempty" json:"at_mention_usernames,omitempty"`
ChannelMention string `codec:"channelMention,omitempty" json:"channel_mention,omitempty"`
ChannelNameMentions []UIChannelNameMention `codec:"channelNameMentions,omitempty" json:"channel_name_mentions,omitempty"`
BotInfo *MsgBotInfo `codec:"botInfo,omitempty" json:"bot_info,omitempty"`
}
func (o MsgSummary) DeepCopy() MsgSummary {
return MsgSummary{
Id: o.Id.DeepCopy(),
ConvID: o.ConvID.DeepCopy(),
Channel: o.Channel.DeepCopy(),
Sender: o.Sender.DeepCopy(),
SentAt: o.SentAt,
SentAtMs: o.SentAtMs,
Content: o.Content.DeepCopy(),
Prev: (func(x []MessagePreviousPointer) []MessagePreviousPointer {
if x == nil {
return nil
}
ret := make([]MessagePreviousPointer, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Prev),
Unread: o.Unread,
RevokedDevice: o.RevokedDevice,
Offline: o.Offline,
KbfsEncrypted: o.KbfsEncrypted,
IsEphemeral: o.IsEphemeral,
IsEphemeralExpired: o.IsEphemeralExpired,
ETime: o.ETime.DeepCopy(),
Reactions: (func(x *ReactionMap) *ReactionMap {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Reactions),
HasPairwiseMacs: o.HasPairwiseMacs,
AtMentionUsernames: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.AtMentionUsernames),
ChannelMention: o.ChannelMention,
ChannelNameMentions: (func(x []UIChannelNameMention) []UIChannelNameMention {
if x == nil {
return nil
}
ret := make([]UIChannelNameMention, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ChannelNameMentions),
BotInfo: (func(x *MsgBotInfo) *MsgBotInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.BotInfo),
}
}
type Message struct {
Msg *MsgSummary `codec:"msg,omitempty" json:"msg,omitempty"`
Error *string `codec:"error,omitempty" json:"error,omitempty"`
}
func (o Message) DeepCopy() Message {
return Message{
Msg: (func(x *MsgSummary) *MsgSummary {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Msg),
Error: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Error),
}
}
type Thread struct {
Messages []Message `codec:"messages" json:"messages"`
Pagination *Pagination `codec:"pagination,omitempty" json:"pagination,omitempty"`
Offline bool `codec:"offline,omitempty" json:"offline,omitempty"`
IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"`
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o Thread) DeepCopy() Thread {
return Thread{
Messages: (func(x []Message) []Message {
if x == nil {
return nil
}
ret := make([]Message, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Messages),
Pagination: (func(x *Pagination) *Pagination {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Pagination),
Offline: o.Offline,
IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure {
if x == nil {
return nil
}
ret := make([]keybase1.TLFIdentifyFailure, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.IdentifyFailures),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
// A chat conversation. This is essentially a chat channel plus some additional metadata.
type ConvSummary struct {
Id ConvIDStr `codec:"id" json:"id"`
Channel ChatChannel `codec:"channel" json:"channel"`
IsDefaultConv bool `codec:"isDefaultConv" json:"is_default_conv"`
Unread bool `codec:"unread" json:"unread"`
ActiveAt int64 `codec:"activeAt" json:"active_at"`
ActiveAtMs int64 `codec:"activeAtMs" json:"active_at_ms"`
MemberStatus string `codec:"memberStatus" json:"member_status"`
ResetUsers []string `codec:"resetUsers,omitempty" json:"reset_users,omitempty"`
FinalizeInfo *ConversationFinalizeInfo `codec:"finalizeInfo,omitempty" json:"finalize_info,omitempty"`
Supersedes []string `codec:"supersedes,omitempty" json:"supersedes,omitempty"`
SupersededBy []string `codec:"supersededBy,omitempty" json:"superseded_by,omitempty"`
Error string `codec:"error,omitempty" json:"error,omitempty"`
CreatorInfo *ConversationCreatorInfoLocal `codec:"creatorInfo,omitempty" json:"creator_info,omitempty"`
}
func (o ConvSummary) DeepCopy() ConvSummary {
return ConvSummary{
Id: o.Id.DeepCopy(),
Channel: o.Channel.DeepCopy(),
IsDefaultConv: o.IsDefaultConv,
Unread: o.Unread,
ActiveAt: o.ActiveAt,
ActiveAtMs: o.ActiveAtMs,
MemberStatus: o.MemberStatus,
ResetUsers: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.ResetUsers),
FinalizeInfo: (func(x *ConversationFinalizeInfo) *ConversationFinalizeInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.FinalizeInfo),
Supersedes: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.Supersedes),
SupersededBy: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.SupersededBy),
Error: o.Error,
CreatorInfo: (func(x *ConversationCreatorInfoLocal) *ConversationCreatorInfoLocal {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.CreatorInfo),
}
}
type ChatList struct {
Conversations []ConvSummary `codec:"conversations" json:"conversations"`
Offline bool `codec:"offline" json:"offline"`
IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"`
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o ChatList) DeepCopy() ChatList {
return ChatList{
Conversations: (func(x []ConvSummary) []ConvSummary {
if x == nil {
return nil
}
ret := make([]ConvSummary, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Conversations),
Offline: o.Offline,
IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure {
if x == nil {
return nil
}
ret := make([]keybase1.TLFIdentifyFailure, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.IdentifyFailures),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type SendRes struct {
Message string `codec:"message" json:"message"`
MessageID *MessageID `codec:"messageID,omitempty" json:"id,omitempty"`
OutboxID *OutboxID `codec:"outboxID,omitempty" json:"outbox_id,omitempty"`
IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"`
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o SendRes) DeepCopy() SendRes {
return SendRes{
Message: o.Message,
MessageID: (func(x *MessageID) *MessageID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.MessageID),
OutboxID: (func(x *OutboxID) *OutboxID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.OutboxID),
IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure {
if x == nil {
return nil
}
ret := make([]keybase1.TLFIdentifyFailure, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.IdentifyFailures),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type SearchInboxResOutput struct {
Results *ChatSearchInboxResults `codec:"results,omitempty" json:"results,omitempty"`
IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"`
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o SearchInboxResOutput) DeepCopy() SearchInboxResOutput {
return SearchInboxResOutput{
Results: (func(x *ChatSearchInboxResults) *ChatSearchInboxResults {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Results),
IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure {
if x == nil {
return nil
}
ret := make([]keybase1.TLFIdentifyFailure, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.IdentifyFailures),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type RegexpRes struct {
Hits []ChatSearchHit `codec:"hits" json:"hits"`
IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"`
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o RegexpRes) DeepCopy() RegexpRes {
return RegexpRes{
Hits: (func(x []ChatSearchHit) []ChatSearchHit {
if x == nil {
return nil
}
ret := make([]ChatSearchHit, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Hits),
IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure {
if x == nil {
return nil
}
ret := make([]keybase1.TLFIdentifyFailure, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.IdentifyFailures),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type NewConvRes struct {
Id ConvIDStr `codec:"id" json:"id"`
IdentifyFailures []keybase1.TLFIdentifyFailure `codec:"identifyFailures,omitempty" json:"identify_failures,omitempty"`
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o NewConvRes) DeepCopy() NewConvRes {
return NewConvRes{
Id: o.Id.DeepCopy(),
IdentifyFailures: (func(x []keybase1.TLFIdentifyFailure) []keybase1.TLFIdentifyFailure {
if x == nil {
return nil
}
ret := make([]keybase1.TLFIdentifyFailure, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.IdentifyFailures),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type ListCommandsRes struct {
Commands []UserBotCommandOutput `codec:"commands" json:"commands"`
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o ListCommandsRes) DeepCopy() ListCommandsRes {
return ListCommandsRes{
Commands: (func(x []UserBotCommandOutput) []UserBotCommandOutput {
if x == nil {
return nil
}
ret := make([]UserBotCommandOutput, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Commands),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type EmptyRes struct {
RateLimits []RateLimitRes `codec:"rateLimits,omitempty" json:"ratelimits,omitempty"`
}
func (o EmptyRes) DeepCopy() EmptyRes {
return EmptyRes{
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type MsgNotification struct {
Type string `codec:"type" json:"type"`
Source string `codec:"source" json:"source"`
Msg *MsgSummary `codec:"msg,omitempty" json:"msg,omitempty"`
Error *string `codec:"error,omitempty" json:"error,omitempty"`
Pagination *UIPagination `codec:"pagination,omitempty" json:"pagination,omitempty"`
}
func (o MsgNotification) DeepCopy() MsgNotification {
return MsgNotification{
Type: o.Type,
Source: o.Source,
Msg: (func(x *MsgSummary) *MsgSummary {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Msg),
Error: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Error),
Pagination: (func(x *UIPagination) *UIPagination {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Pagination),
}
}
type ConvNotification struct {
Type string `codec:"type" json:"type"`
Conv *ConvSummary `codec:"conv,omitempty" json:"conv,omitempty"`
Error *string `codec:"error,omitempty" json:"error,omitempty"`
}
func (o ConvNotification) DeepCopy() ConvNotification {
return ConvNotification{
Type: o.Type,
Conv: (func(x *ConvSummary) *ConvSummary {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Conv),
Error: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Error),
}
}
type AdvertiseCommandAPIParam struct {
Typ string `codec:"typ" json:"type"`
Commands []UserBotCommandInput `codec:"commands" json:"commands"`
TeamName string `codec:"teamName,omitempty" json:"team_name,omitempty"`
}
func (o AdvertiseCommandAPIParam) DeepCopy() AdvertiseCommandAPIParam {
return AdvertiseCommandAPIParam{
Typ: o.Typ,
Commands: (func(x []UserBotCommandInput) []UserBotCommandInput {
if x == nil {
return nil
}
ret := make([]UserBotCommandInput, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Commands),
TeamName: o.TeamName,
}
}
type ResetConvMemberAPI struct {
ConversationID ConvIDStr `codec:"conversationID" json:"conversationID"`
Username string `codec:"username" json:"username"`
}
func (o ResetConvMemberAPI) DeepCopy() ResetConvMemberAPI {
return ResetConvMemberAPI{
ConversationID: o.ConversationID.DeepCopy(),
Username: o.Username,
}
}
type GetResetConvMembersRes struct {
Members []ResetConvMemberAPI `codec:"members" json:"members"`
RateLimits []RateLimitRes `codec:"rateLimits" json:"rateLimits"`
}
func (o GetResetConvMembersRes) DeepCopy() GetResetConvMembersRes {
return GetResetConvMembersRes{
Members: (func(x []ResetConvMemberAPI) []ResetConvMemberAPI {
if x == nil {
return nil
}
ret := make([]ResetConvMemberAPI, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Members),
RateLimits: (func(x []RateLimitRes) []RateLimitRes {
if x == nil {
return nil
}
ret := make([]RateLimitRes, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RateLimits),
}
}
type DeviceInfo struct {
DeviceID keybase1.DeviceID `codec:"deviceID" json:"id"`
DeviceDescription string `codec:"deviceDescription" json:"description"`
DeviceType string `codec:"deviceType" json:"type"`
DeviceCtime int64 `codec:"deviceCtime" json:"ctime"`
}
func (o DeviceInfo) DeepCopy() DeviceInfo {
return DeviceInfo{
DeviceID: o.DeviceID.DeepCopy(),
DeviceDescription: o.DeviceDescription,
DeviceType: o.DeviceType,
DeviceCtime: o.DeviceCtime,
}
}
type GetDeviceInfoRes struct {
Devices []DeviceInfo `codec:"devices" json:"devices"`
}
func (o GetDeviceInfoRes) DeepCopy() GetDeviceInfoRes {
return GetDeviceInfoRes{
Devices: (func(x []DeviceInfo) []DeviceInfo {
if x == nil {
return nil
}
ret := make([]DeviceInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Devices),
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/chat1/blocking.avdl
package chat1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,199 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/chat1/commands.avdl
package chat1
import (
"errors"
"fmt"
)
type ConversationCommand struct {
Description string `codec:"description" json:"description"`
Name string `codec:"name" json:"name"`
Usage string `codec:"usage" json:"usage"`
HasHelpText bool `codec:"hasHelpText" json:"hasHelpText"`
Username *string `codec:"username,omitempty" json:"username,omitempty"`
}
func (o ConversationCommand) DeepCopy() ConversationCommand {
return ConversationCommand{
Description: o.Description,
Name: o.Name,
Usage: o.Usage,
HasHelpText: o.HasHelpText,
Username: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Username),
}
}
type ConversationCommandGroupsTyp int
const (
ConversationCommandGroupsTyp_BUILTIN ConversationCommandGroupsTyp = 0
ConversationCommandGroupsTyp_CUSTOM ConversationCommandGroupsTyp = 1
ConversationCommandGroupsTyp_NONE ConversationCommandGroupsTyp = 2
)
func (o ConversationCommandGroupsTyp) DeepCopy() ConversationCommandGroupsTyp { return o }
var ConversationCommandGroupsTypMap = map[string]ConversationCommandGroupsTyp{
"BUILTIN": 0,
"CUSTOM": 1,
"NONE": 2,
}
var ConversationCommandGroupsTypRevMap = map[ConversationCommandGroupsTyp]string{
0: "BUILTIN",
1: "CUSTOM",
2: "NONE",
}
func (e ConversationCommandGroupsTyp) String() string {
if v, ok := ConversationCommandGroupsTypRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ConversationBuiltinCommandTyp int
const (
ConversationBuiltinCommandTyp_NONE ConversationBuiltinCommandTyp = 0
ConversationBuiltinCommandTyp_ADHOC ConversationBuiltinCommandTyp = 1
ConversationBuiltinCommandTyp_SMALLTEAM ConversationBuiltinCommandTyp = 2
ConversationBuiltinCommandTyp_BIGTEAM ConversationBuiltinCommandTyp = 3
ConversationBuiltinCommandTyp_BIGTEAMGENERAL ConversationBuiltinCommandTyp = 4
)
func (o ConversationBuiltinCommandTyp) DeepCopy() ConversationBuiltinCommandTyp { return o }
var ConversationBuiltinCommandTypMap = map[string]ConversationBuiltinCommandTyp{
"NONE": 0,
"ADHOC": 1,
"SMALLTEAM": 2,
"BIGTEAM": 3,
"BIGTEAMGENERAL": 4,
}
var ConversationBuiltinCommandTypRevMap = map[ConversationBuiltinCommandTyp]string{
0: "NONE",
1: "ADHOC",
2: "SMALLTEAM",
3: "BIGTEAM",
4: "BIGTEAMGENERAL",
}
func (e ConversationBuiltinCommandTyp) String() string {
if v, ok := ConversationBuiltinCommandTypRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ConversationCommandGroupsCustom struct {
Commands []ConversationCommand `codec:"commands" json:"commands"`
}
func (o ConversationCommandGroupsCustom) DeepCopy() ConversationCommandGroupsCustom {
return ConversationCommandGroupsCustom{
Commands: (func(x []ConversationCommand) []ConversationCommand {
if x == nil {
return nil
}
ret := make([]ConversationCommand, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Commands),
}
}
type ConversationCommandGroups struct {
Typ__ ConversationCommandGroupsTyp `codec:"typ" json:"typ"`
Builtin__ *ConversationBuiltinCommandTyp `codec:"builtin,omitempty" json:"builtin,omitempty"`
Custom__ *ConversationCommandGroupsCustom `codec:"custom,omitempty" json:"custom,omitempty"`
}
func (o *ConversationCommandGroups) Typ() (ret ConversationCommandGroupsTyp, err error) {
switch o.Typ__ {
case ConversationCommandGroupsTyp_BUILTIN:
if o.Builtin__ == nil {
err = errors.New("unexpected nil value for Builtin__")
return ret, err
}
case ConversationCommandGroupsTyp_CUSTOM:
if o.Custom__ == nil {
err = errors.New("unexpected nil value for Custom__")
return ret, err
}
}
return o.Typ__, nil
}
func (o ConversationCommandGroups) Builtin() (res ConversationBuiltinCommandTyp) {
if o.Typ__ != ConversationCommandGroupsTyp_BUILTIN {
panic("wrong case accessed")
}
if o.Builtin__ == nil {
return
}
return *o.Builtin__
}
func (o ConversationCommandGroups) Custom() (res ConversationCommandGroupsCustom) {
if o.Typ__ != ConversationCommandGroupsTyp_CUSTOM {
panic("wrong case accessed")
}
if o.Custom__ == nil {
return
}
return *o.Custom__
}
func NewConversationCommandGroupsWithBuiltin(v ConversationBuiltinCommandTyp) ConversationCommandGroups {
return ConversationCommandGroups{
Typ__: ConversationCommandGroupsTyp_BUILTIN,
Builtin__: &v,
}
}
func NewConversationCommandGroupsWithCustom(v ConversationCommandGroupsCustom) ConversationCommandGroups {
return ConversationCommandGroups{
Typ__: ConversationCommandGroupsTyp_CUSTOM,
Custom__: &v,
}
}
func NewConversationCommandGroupsWithNone() ConversationCommandGroups {
return ConversationCommandGroups{
Typ__: ConversationCommandGroupsTyp_NONE,
}
}
func (o ConversationCommandGroups) DeepCopy() ConversationCommandGroups {
return ConversationCommandGroups{
Typ__: o.Typ__.DeepCopy(),
Builtin__: (func(x *ConversationBuiltinCommandTyp) *ConversationBuiltinCommandTyp {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Builtin__),
Custom__: (func(x *ConversationCommandGroupsCustom) *ConversationCommandGroupsCustom {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Custom__),
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,548 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/chat1/gregor.avdl
package chat1
import (
gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1"
keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1"
)
type GenericPayload struct {
Action string `codec:"Action" json:"Action"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
ConvID ConversationID `codec:"convID" json:"convID"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
}
func (o GenericPayload) DeepCopy() GenericPayload {
return GenericPayload{
Action: o.Action,
InboxVers: o.InboxVers.DeepCopy(),
ConvID: o.ConvID.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
}
}
type NewConversationPayload struct {
Action string `codec:"Action" json:"Action"`
ConvID ConversationID `codec:"convID" json:"convID"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
}
func (o NewConversationPayload) DeepCopy() NewConversationPayload {
return NewConversationPayload{
Action: o.Action,
ConvID: o.ConvID.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
}
}
type NewMessagePayload struct {
Action string `codec:"Action" json:"Action"`
ConvID ConversationID `codec:"convID" json:"convID"`
Message MessageBoxed `codec:"message" json:"message"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
UntrustedTeamRole keybase1.TeamRole `codec:"untrustedTeamRole" json:"untrustedTeamRole"`
MaxMsgs []MessageSummary `codec:"maxMsgs" json:"maxMsgs"`
}
func (o NewMessagePayload) DeepCopy() NewMessagePayload {
return NewMessagePayload{
Action: o.Action,
ConvID: o.ConvID.DeepCopy(),
Message: o.Message.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
UntrustedTeamRole: o.UntrustedTeamRole.DeepCopy(),
MaxMsgs: (func(x []MessageSummary) []MessageSummary {
if x == nil {
return nil
}
ret := make([]MessageSummary, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.MaxMsgs),
}
}
type ReadMessagePayload struct {
Action string `codec:"Action" json:"Action"`
ConvID ConversationID `codec:"convID" json:"convID"`
MsgID MessageID `codec:"msgID" json:"msgID"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
}
func (o ReadMessagePayload) DeepCopy() ReadMessagePayload {
return ReadMessagePayload{
Action: o.Action,
ConvID: o.ConvID.DeepCopy(),
MsgID: o.MsgID.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
}
}
type SetStatusPayload struct {
Action string `codec:"Action" json:"Action"`
ConvID ConversationID `codec:"convID" json:"convID"`
Status ConversationStatus `codec:"status" json:"status"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
}
func (o SetStatusPayload) DeepCopy() SetStatusPayload {
return SetStatusPayload{
Action: o.Action,
ConvID: o.ConvID.DeepCopy(),
Status: o.Status.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
}
}
type TeamTypePayload struct {
Action string `codec:"Action" json:"Action"`
ConvID ConversationID `codec:"convID" json:"convID"`
TeamType TeamType `codec:"teamType" json:"teamType"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
}
func (o TeamTypePayload) DeepCopy() TeamTypePayload {
return TeamTypePayload{
Action: o.Action,
ConvID: o.ConvID.DeepCopy(),
TeamType: o.TeamType.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
}
}
type SetAppNotificationSettingsPayload struct {
Action string `codec:"Action" json:"Action"`
ConvID ConversationID `codec:"convID" json:"convID"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
Settings ConversationNotificationInfo `codec:"settings" json:"settings"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
}
func (o SetAppNotificationSettingsPayload) DeepCopy() SetAppNotificationSettingsPayload {
return SetAppNotificationSettingsPayload{
Action: o.Action,
ConvID: o.ConvID.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
Settings: o.Settings.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
}
}
type ExpungePayload struct {
Action string `codec:"Action" json:"Action"`
ConvID ConversationID `codec:"convID" json:"convID"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
Expunge Expunge `codec:"expunge" json:"expunge"`
MaxMsgs []MessageSummary `codec:"maxMsgs" json:"maxMsgs"`
TopicType TopicType `codec:"topicType" json:"topicType"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
}
func (o ExpungePayload) DeepCopy() ExpungePayload {
return ExpungePayload{
Action: o.Action,
ConvID: o.ConvID.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
Expunge: o.Expunge.DeepCopy(),
MaxMsgs: (func(x []MessageSummary) []MessageSummary {
if x == nil {
return nil
}
ret := make([]MessageSummary, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.MaxMsgs),
TopicType: o.TopicType.DeepCopy(),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
}
}
type UnreadUpdate struct {
ConvID ConversationID `codec:"convID" json:"convID"`
UnreadMessages int `codec:"unreadMessages" json:"unreadMessages"`
UnreadNotifyingMessages map[keybase1.DeviceType]int `codec:"unreadNotifyingMessages" json:"unreadNotifyingMessages"`
CompatUnreadMessages int `codec:"UnreadMessages" json:"UnreadMessages"`
Diff bool `codec:"diff" json:"diff"`
}
func (o UnreadUpdate) DeepCopy() UnreadUpdate {
return UnreadUpdate{
ConvID: o.ConvID.DeepCopy(),
UnreadMessages: o.UnreadMessages,
UnreadNotifyingMessages: (func(x map[keybase1.DeviceType]int) map[keybase1.DeviceType]int {
if x == nil {
return nil
}
ret := make(map[keybase1.DeviceType]int, len(x))
for k, v := range x {
kCopy := k.DeepCopy()
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.UnreadNotifyingMessages),
CompatUnreadMessages: o.CompatUnreadMessages,
Diff: o.Diff,
}
}
type TLFFinalizeUpdate struct {
FinalizeInfo ConversationFinalizeInfo `codec:"finalizeInfo" json:"finalizeInfo"`
ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
}
func (o TLFFinalizeUpdate) DeepCopy() TLFFinalizeUpdate {
return TLFFinalizeUpdate{
FinalizeInfo: o.FinalizeInfo.DeepCopy(),
ConvIDs: (func(x []ConversationID) []ConversationID {
if x == nil {
return nil
}
ret := make([]ConversationID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ConvIDs),
InboxVers: o.InboxVers.DeepCopy(),
}
}
type TLFResolveUpdate struct {
ConvID ConversationID `codec:"convID" json:"convID"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
}
func (o TLFResolveUpdate) DeepCopy() TLFResolveUpdate {
return TLFResolveUpdate{
ConvID: o.ConvID.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
}
}
type RemoteUserTypingUpdate struct {
Uid gregor1.UID `codec:"uid" json:"uid"`
DeviceID gregor1.DeviceID `codec:"deviceID" json:"deviceID"`
ConvID ConversationID `codec:"convID" json:"convID"`
Typing bool `codec:"typing" json:"typing"`
TeamType TeamType `codec:"t" json:"teamType"`
}
func (o RemoteUserTypingUpdate) DeepCopy() RemoteUserTypingUpdate {
return RemoteUserTypingUpdate{
Uid: o.Uid.DeepCopy(),
DeviceID: o.DeviceID.DeepCopy(),
ConvID: o.ConvID.DeepCopy(),
Typing: o.Typing,
TeamType: o.TeamType.DeepCopy(),
}
}
type TeamMemberRoleUpdate struct {
TlfID TLFID `codec:"tlfID" json:"tlfID"`
Role keybase1.TeamRole `codec:"role" json:"role"`
}
func (o TeamMemberRoleUpdate) DeepCopy() TeamMemberRoleUpdate {
return TeamMemberRoleUpdate{
TlfID: o.TlfID.DeepCopy(),
Role: o.Role.DeepCopy(),
}
}
type UpdateConversationMembership struct {
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TeamMemberRoleUpdate *TeamMemberRoleUpdate `codec:"teamMemberRoleUpdate,omitempty" json:"teamMemberRoleUpdate,omitempty"`
Joined []ConversationMember `codec:"joined" json:"joined"`
Removed []ConversationMember `codec:"removed" json:"removed"`
Reset []ConversationMember `codec:"reset" json:"reset"`
Previewed []ConversationID `codec:"previewed" json:"previewed"`
UnreadUpdate *UnreadUpdate `codec:"unreadUpdate,omitempty" json:"unreadUpdate,omitempty"`
UnreadUpdates []UnreadUpdate `codec:"unreadUpdates" json:"unreadUpdates"`
}
func (o UpdateConversationMembership) DeepCopy() UpdateConversationMembership {
return UpdateConversationMembership{
InboxVers: o.InboxVers.DeepCopy(),
TeamMemberRoleUpdate: (func(x *TeamMemberRoleUpdate) *TeamMemberRoleUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TeamMemberRoleUpdate),
Joined: (func(x []ConversationMember) []ConversationMember {
if x == nil {
return nil
}
ret := make([]ConversationMember, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Joined),
Removed: (func(x []ConversationMember) []ConversationMember {
if x == nil {
return nil
}
ret := make([]ConversationMember, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Removed),
Reset: (func(x []ConversationMember) []ConversationMember {
if x == nil {
return nil
}
ret := make([]ConversationMember, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Reset),
Previewed: (func(x []ConversationID) []ConversationID {
if x == nil {
return nil
}
ret := make([]ConversationID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Previewed),
UnreadUpdate: (func(x *UnreadUpdate) *UnreadUpdate {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.UnreadUpdate),
UnreadUpdates: (func(x []UnreadUpdate) []UnreadUpdate {
if x == nil {
return nil
}
ret := make([]UnreadUpdate, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.UnreadUpdates),
}
}
type ConversationUpdate struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Existence ConversationExistence `codec:"existence" json:"existence"`
}
func (o ConversationUpdate) DeepCopy() ConversationUpdate {
return ConversationUpdate{
ConvID: o.ConvID.DeepCopy(),
Existence: o.Existence.DeepCopy(),
}
}
type UpdateConversations struct {
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
ConvUpdates []ConversationUpdate `codec:"convUpdates" json:"convUpdates"`
}
func (o UpdateConversations) DeepCopy() UpdateConversations {
return UpdateConversations{
InboxVers: o.InboxVers.DeepCopy(),
ConvUpdates: (func(x []ConversationUpdate) []ConversationUpdate {
if x == nil {
return nil
}
ret := make([]ConversationUpdate, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ConvUpdates),
}
}
type TeamChannelUpdate struct {
TeamID TLFID `codec:"teamID" json:"teamID"`
}
func (o TeamChannelUpdate) DeepCopy() TeamChannelUpdate {
return TeamChannelUpdate{
TeamID: o.TeamID.DeepCopy(),
}
}
type SetConvRetentionUpdate struct {
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
ConvID ConversationID `codec:"convID" json:"convID"`
Policy RetentionPolicy `codec:"policy" json:"policy"`
}
func (o SetConvRetentionUpdate) DeepCopy() SetConvRetentionUpdate {
return SetConvRetentionUpdate{
InboxVers: o.InboxVers.DeepCopy(),
ConvID: o.ConvID.DeepCopy(),
Policy: o.Policy.DeepCopy(),
}
}
type SetTeamRetentionUpdate struct {
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TeamID keybase1.TeamID `codec:"teamID" json:"teamID"`
Policy RetentionPolicy `codec:"policy" json:"policy"`
}
func (o SetTeamRetentionUpdate) DeepCopy() SetTeamRetentionUpdate {
return SetTeamRetentionUpdate{
InboxVers: o.InboxVers.DeepCopy(),
TeamID: o.TeamID.DeepCopy(),
Policy: o.Policy.DeepCopy(),
}
}
type SetConvSettingsUpdate struct {
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
ConvID ConversationID `codec:"convID" json:"convID"`
ConvSettings *ConversationSettings `codec:"convSettings,omitempty" json:"convSettings,omitempty"`
}
func (o SetConvSettingsUpdate) DeepCopy() SetConvSettingsUpdate {
return SetConvSettingsUpdate{
InboxVers: o.InboxVers.DeepCopy(),
ConvID: o.ConvID.DeepCopy(),
ConvSettings: (func(x *ConversationSettings) *ConversationSettings {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ConvSettings),
}
}
type KBFSImpteamUpgradeUpdate struct {
ConvID ConversationID `codec:"convID" json:"convID"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
TopicType TopicType `codec:"topicType" json:"topicType"`
}
func (o KBFSImpteamUpgradeUpdate) DeepCopy() KBFSImpteamUpgradeUpdate {
return KBFSImpteamUpgradeUpdate{
ConvID: o.ConvID.DeepCopy(),
InboxVers: o.InboxVers.DeepCopy(),
TopicType: o.TopicType.DeepCopy(),
}
}
type SubteamRenameUpdate struct {
ConvIDs []ConversationID `codec:"convIDs" json:"convIDs"`
InboxVers InboxVers `codec:"inboxVers" json:"inboxVers"`
}
func (o SubteamRenameUpdate) DeepCopy() SubteamRenameUpdate {
return SubteamRenameUpdate{
ConvIDs: (func(x []ConversationID) []ConversationID {
if x == nil {
return nil
}
ret := make([]ConversationID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ConvIDs),
InboxVers: o.InboxVers.DeepCopy(),
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,938 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/chat1/notify.avdl
package chat1
import (
"errors"
"fmt"
keybase1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/keybase1"
)
type ChatActivitySource int
const (
ChatActivitySource_LOCAL ChatActivitySource = 0
ChatActivitySource_REMOTE ChatActivitySource = 1
)
func (o ChatActivitySource) DeepCopy() ChatActivitySource { return o }
var ChatActivitySourceMap = map[string]ChatActivitySource{
"LOCAL": 0,
"REMOTE": 1,
}
var ChatActivitySourceRevMap = map[ChatActivitySource]string{
0: "LOCAL",
1: "REMOTE",
}
func (e ChatActivitySource) String() string {
if v, ok := ChatActivitySourceRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ChatActivityType int
const (
ChatActivityType_RESERVED ChatActivityType = 0
ChatActivityType_INCOMING_MESSAGE ChatActivityType = 1
ChatActivityType_READ_MESSAGE ChatActivityType = 2
ChatActivityType_NEW_CONVERSATION ChatActivityType = 3
ChatActivityType_SET_STATUS ChatActivityType = 4
ChatActivityType_FAILED_MESSAGE ChatActivityType = 5
ChatActivityType_MEMBERS_UPDATE ChatActivityType = 6
ChatActivityType_SET_APP_NOTIFICATION_SETTINGS ChatActivityType = 7
ChatActivityType_TEAMTYPE ChatActivityType = 8
ChatActivityType_EXPUNGE ChatActivityType = 9
ChatActivityType_EPHEMERAL_PURGE ChatActivityType = 10
ChatActivityType_REACTION_UPDATE ChatActivityType = 11
ChatActivityType_MESSAGES_UPDATED ChatActivityType = 12
)
func (o ChatActivityType) DeepCopy() ChatActivityType { return o }
var ChatActivityTypeMap = map[string]ChatActivityType{
"RESERVED": 0,
"INCOMING_MESSAGE": 1,
"READ_MESSAGE": 2,
"NEW_CONVERSATION": 3,
"SET_STATUS": 4,
"FAILED_MESSAGE": 5,
"MEMBERS_UPDATE": 6,
"SET_APP_NOTIFICATION_SETTINGS": 7,
"TEAMTYPE": 8,
"EXPUNGE": 9,
"EPHEMERAL_PURGE": 10,
"REACTION_UPDATE": 11,
"MESSAGES_UPDATED": 12,
}
var ChatActivityTypeRevMap = map[ChatActivityType]string{
0: "RESERVED",
1: "INCOMING_MESSAGE",
2: "READ_MESSAGE",
3: "NEW_CONVERSATION",
4: "SET_STATUS",
5: "FAILED_MESSAGE",
6: "MEMBERS_UPDATE",
7: "SET_APP_NOTIFICATION_SETTINGS",
8: "TEAMTYPE",
9: "EXPUNGE",
10: "EPHEMERAL_PURGE",
11: "REACTION_UPDATE",
12: "MESSAGES_UPDATED",
}
func (e ChatActivityType) String() string {
if v, ok := ChatActivityTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type IncomingMessage struct {
Message UIMessage `codec:"message" json:"message"`
ModifiedMessage *UIMessage `codec:"modifiedMessage,omitempty" json:"modifiedMessage,omitempty"`
ConvID ConversationID `codec:"convID" json:"convID"`
DisplayDesktopNotification bool `codec:"displayDesktopNotification" json:"displayDesktopNotification"`
DesktopNotificationSnippet string `codec:"desktopNotificationSnippet" json:"desktopNotificationSnippet"`
Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"`
Pagination *UIPagination `codec:"pagination,omitempty" json:"pagination,omitempty"`
}
func (o IncomingMessage) DeepCopy() IncomingMessage {
return IncomingMessage{
Message: o.Message.DeepCopy(),
ModifiedMessage: (func(x *UIMessage) *UIMessage {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ModifiedMessage),
ConvID: o.ConvID.DeepCopy(),
DisplayDesktopNotification: o.DisplayDesktopNotification,
DesktopNotificationSnippet: o.DesktopNotificationSnippet,
Conv: (func(x *InboxUIItem) *InboxUIItem {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Conv),
Pagination: (func(x *UIPagination) *UIPagination {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Pagination),
}
}
type ReadMessageInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
MsgID MessageID `codec:"msgID" json:"msgID"`
Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"`
}
func (o ReadMessageInfo) DeepCopy() ReadMessageInfo {
return ReadMessageInfo{
ConvID: o.ConvID.DeepCopy(),
MsgID: o.MsgID.DeepCopy(),
Conv: (func(x *InboxUIItem) *InboxUIItem {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Conv),
}
}
type NewConversationInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"`
}
func (o NewConversationInfo) DeepCopy() NewConversationInfo {
return NewConversationInfo{
ConvID: o.ConvID.DeepCopy(),
Conv: (func(x *InboxUIItem) *InboxUIItem {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Conv),
}
}
type SetStatusInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Status ConversationStatus `codec:"status" json:"status"`
Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"`
}
func (o SetStatusInfo) DeepCopy() SetStatusInfo {
return SetStatusInfo{
ConvID: o.ConvID.DeepCopy(),
Status: o.Status.DeepCopy(),
Conv: (func(x *InboxUIItem) *InboxUIItem {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Conv),
}
}
type SetAppNotificationSettingsInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Settings ConversationNotificationInfo `codec:"settings" json:"settings"`
}
func (o SetAppNotificationSettingsInfo) DeepCopy() SetAppNotificationSettingsInfo {
return SetAppNotificationSettingsInfo{
ConvID: o.ConvID.DeepCopy(),
Settings: o.Settings.DeepCopy(),
}
}
type FailedMessageInfo struct {
OutboxRecords []OutboxRecord `codec:"outboxRecords" json:"outboxRecords"`
IsEphemeralPurge bool `codec:"isEphemeralPurge" json:"isEphemeralPurge"`
Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"`
}
func (o FailedMessageInfo) DeepCopy() FailedMessageInfo {
return FailedMessageInfo{
OutboxRecords: (func(x []OutboxRecord) []OutboxRecord {
if x == nil {
return nil
}
ret := make([]OutboxRecord, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.OutboxRecords),
IsEphemeralPurge: o.IsEphemeralPurge,
Conv: (func(x *InboxUIItem) *InboxUIItem {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Conv),
}
}
type MemberInfo struct {
Member string `codec:"member" json:"member"`
Status ConversationMemberStatus `codec:"status" json:"status"`
}
func (o MemberInfo) DeepCopy() MemberInfo {
return MemberInfo{
Member: o.Member,
Status: o.Status.DeepCopy(),
}
}
type MembersUpdateInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Members []MemberInfo `codec:"members" json:"members"`
}
func (o MembersUpdateInfo) DeepCopy() MembersUpdateInfo {
return MembersUpdateInfo{
ConvID: o.ConvID.DeepCopy(),
Members: (func(x []MemberInfo) []MemberInfo {
if x == nil {
return nil
}
ret := make([]MemberInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Members),
}
}
type TeamTypeInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
TeamType TeamType `codec:"teamType" json:"teamType"`
Conv *InboxUIItem `codec:"conv,omitempty" json:"conv,omitempty"`
}
func (o TeamTypeInfo) DeepCopy() TeamTypeInfo {
return TeamTypeInfo{
ConvID: o.ConvID.DeepCopy(),
TeamType: o.TeamType.DeepCopy(),
Conv: (func(x *InboxUIItem) *InboxUIItem {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Conv),
}
}
type ExpungeInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Expunge Expunge `codec:"expunge" json:"expunge"`
}
func (o ExpungeInfo) DeepCopy() ExpungeInfo {
return ExpungeInfo{
ConvID: o.ConvID.DeepCopy(),
Expunge: o.Expunge.DeepCopy(),
}
}
type EphemeralPurgeNotifInfo struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Msgs []UIMessage `codec:"msgs" json:"msgs"`
}
func (o EphemeralPurgeNotifInfo) DeepCopy() EphemeralPurgeNotifInfo {
return EphemeralPurgeNotifInfo{
ConvID: o.ConvID.DeepCopy(),
Msgs: (func(x []UIMessage) []UIMessage {
if x == nil {
return nil
}
ret := make([]UIMessage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Msgs),
}
}
type ReactionUpdate struct {
Reactions ReactionMap `codec:"reactions" json:"reactions"`
TargetMsgID MessageID `codec:"targetMsgID" json:"targetMsgID"`
}
func (o ReactionUpdate) DeepCopy() ReactionUpdate {
return ReactionUpdate{
Reactions: o.Reactions.DeepCopy(),
TargetMsgID: o.TargetMsgID.DeepCopy(),
}
}
type ReactionUpdateNotif struct {
ConvID ConversationID `codec:"convID" json:"convID"`
UserReacjis keybase1.UserReacjis `codec:"userReacjis" json:"userReacjis"`
ReactionUpdates []ReactionUpdate `codec:"reactionUpdates" json:"reactionUpdates"`
}
func (o ReactionUpdateNotif) DeepCopy() ReactionUpdateNotif {
return ReactionUpdateNotif{
ConvID: o.ConvID.DeepCopy(),
UserReacjis: o.UserReacjis.DeepCopy(),
ReactionUpdates: (func(x []ReactionUpdate) []ReactionUpdate {
if x == nil {
return nil
}
ret := make([]ReactionUpdate, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ReactionUpdates),
}
}
type MessagesUpdated struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Updates []UIMessage `codec:"updates" json:"updates"`
}
func (o MessagesUpdated) DeepCopy() MessagesUpdated {
return MessagesUpdated{
ConvID: o.ConvID.DeepCopy(),
Updates: (func(x []UIMessage) []UIMessage {
if x == nil {
return nil
}
ret := make([]UIMessage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Updates),
}
}
type ChatActivity struct {
ActivityType__ ChatActivityType `codec:"activityType" json:"activityType"`
IncomingMessage__ *IncomingMessage `codec:"incomingMessage,omitempty" json:"incomingMessage,omitempty"`
ReadMessage__ *ReadMessageInfo `codec:"readMessage,omitempty" json:"readMessage,omitempty"`
NewConversation__ *NewConversationInfo `codec:"newConversation,omitempty" json:"newConversation,omitempty"`
SetStatus__ *SetStatusInfo `codec:"setStatus,omitempty" json:"setStatus,omitempty"`
FailedMessage__ *FailedMessageInfo `codec:"failedMessage,omitempty" json:"failedMessage,omitempty"`
MembersUpdate__ *MembersUpdateInfo `codec:"membersUpdate,omitempty" json:"membersUpdate,omitempty"`
SetAppNotificationSettings__ *SetAppNotificationSettingsInfo `codec:"setAppNotificationSettings,omitempty" json:"setAppNotificationSettings,omitempty"`
Teamtype__ *TeamTypeInfo `codec:"teamtype,omitempty" json:"teamtype,omitempty"`
Expunge__ *ExpungeInfo `codec:"expunge,omitempty" json:"expunge,omitempty"`
EphemeralPurge__ *EphemeralPurgeNotifInfo `codec:"ephemeralPurge,omitempty" json:"ephemeralPurge,omitempty"`
ReactionUpdate__ *ReactionUpdateNotif `codec:"reactionUpdate,omitempty" json:"reactionUpdate,omitempty"`
MessagesUpdated__ *MessagesUpdated `codec:"messagesUpdated,omitempty" json:"messagesUpdated,omitempty"`
}
func (o *ChatActivity) ActivityType() (ret ChatActivityType, err error) {
switch o.ActivityType__ {
case ChatActivityType_INCOMING_MESSAGE:
if o.IncomingMessage__ == nil {
err = errors.New("unexpected nil value for IncomingMessage__")
return ret, err
}
case ChatActivityType_READ_MESSAGE:
if o.ReadMessage__ == nil {
err = errors.New("unexpected nil value for ReadMessage__")
return ret, err
}
case ChatActivityType_NEW_CONVERSATION:
if o.NewConversation__ == nil {
err = errors.New("unexpected nil value for NewConversation__")
return ret, err
}
case ChatActivityType_SET_STATUS:
if o.SetStatus__ == nil {
err = errors.New("unexpected nil value for SetStatus__")
return ret, err
}
case ChatActivityType_FAILED_MESSAGE:
if o.FailedMessage__ == nil {
err = errors.New("unexpected nil value for FailedMessage__")
return ret, err
}
case ChatActivityType_MEMBERS_UPDATE:
if o.MembersUpdate__ == nil {
err = errors.New("unexpected nil value for MembersUpdate__")
return ret, err
}
case ChatActivityType_SET_APP_NOTIFICATION_SETTINGS:
if o.SetAppNotificationSettings__ == nil {
err = errors.New("unexpected nil value for SetAppNotificationSettings__")
return ret, err
}
case ChatActivityType_TEAMTYPE:
if o.Teamtype__ == nil {
err = errors.New("unexpected nil value for Teamtype__")
return ret, err
}
case ChatActivityType_EXPUNGE:
if o.Expunge__ == nil {
err = errors.New("unexpected nil value for Expunge__")
return ret, err
}
case ChatActivityType_EPHEMERAL_PURGE:
if o.EphemeralPurge__ == nil {
err = errors.New("unexpected nil value for EphemeralPurge__")
return ret, err
}
case ChatActivityType_REACTION_UPDATE:
if o.ReactionUpdate__ == nil {
err = errors.New("unexpected nil value for ReactionUpdate__")
return ret, err
}
case ChatActivityType_MESSAGES_UPDATED:
if o.MessagesUpdated__ == nil {
err = errors.New("unexpected nil value for MessagesUpdated__")
return ret, err
}
}
return o.ActivityType__, nil
}
func (o ChatActivity) IncomingMessage() (res IncomingMessage) {
if o.ActivityType__ != ChatActivityType_INCOMING_MESSAGE {
panic("wrong case accessed")
}
if o.IncomingMessage__ == nil {
return
}
return *o.IncomingMessage__
}
func (o ChatActivity) ReadMessage() (res ReadMessageInfo) {
if o.ActivityType__ != ChatActivityType_READ_MESSAGE {
panic("wrong case accessed")
}
if o.ReadMessage__ == nil {
return
}
return *o.ReadMessage__
}
func (o ChatActivity) NewConversation() (res NewConversationInfo) {
if o.ActivityType__ != ChatActivityType_NEW_CONVERSATION {
panic("wrong case accessed")
}
if o.NewConversation__ == nil {
return
}
return *o.NewConversation__
}
func (o ChatActivity) SetStatus() (res SetStatusInfo) {
if o.ActivityType__ != ChatActivityType_SET_STATUS {
panic("wrong case accessed")
}
if o.SetStatus__ == nil {
return
}
return *o.SetStatus__
}
func (o ChatActivity) FailedMessage() (res FailedMessageInfo) {
if o.ActivityType__ != ChatActivityType_FAILED_MESSAGE {
panic("wrong case accessed")
}
if o.FailedMessage__ == nil {
return
}
return *o.FailedMessage__
}
func (o ChatActivity) MembersUpdate() (res MembersUpdateInfo) {
if o.ActivityType__ != ChatActivityType_MEMBERS_UPDATE {
panic("wrong case accessed")
}
if o.MembersUpdate__ == nil {
return
}
return *o.MembersUpdate__
}
func (o ChatActivity) SetAppNotificationSettings() (res SetAppNotificationSettingsInfo) {
if o.ActivityType__ != ChatActivityType_SET_APP_NOTIFICATION_SETTINGS {
panic("wrong case accessed")
}
if o.SetAppNotificationSettings__ == nil {
return
}
return *o.SetAppNotificationSettings__
}
func (o ChatActivity) Teamtype() (res TeamTypeInfo) {
if o.ActivityType__ != ChatActivityType_TEAMTYPE {
panic("wrong case accessed")
}
if o.Teamtype__ == nil {
return
}
return *o.Teamtype__
}
func (o ChatActivity) Expunge() (res ExpungeInfo) {
if o.ActivityType__ != ChatActivityType_EXPUNGE {
panic("wrong case accessed")
}
if o.Expunge__ == nil {
return
}
return *o.Expunge__
}
func (o ChatActivity) EphemeralPurge() (res EphemeralPurgeNotifInfo) {
if o.ActivityType__ != ChatActivityType_EPHEMERAL_PURGE {
panic("wrong case accessed")
}
if o.EphemeralPurge__ == nil {
return
}
return *o.EphemeralPurge__
}
func (o ChatActivity) ReactionUpdate() (res ReactionUpdateNotif) {
if o.ActivityType__ != ChatActivityType_REACTION_UPDATE {
panic("wrong case accessed")
}
if o.ReactionUpdate__ == nil {
return
}
return *o.ReactionUpdate__
}
func (o ChatActivity) MessagesUpdated() (res MessagesUpdated) {
if o.ActivityType__ != ChatActivityType_MESSAGES_UPDATED {
panic("wrong case accessed")
}
if o.MessagesUpdated__ == nil {
return
}
return *o.MessagesUpdated__
}
func NewChatActivityWithIncomingMessage(v IncomingMessage) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_INCOMING_MESSAGE,
IncomingMessage__: &v,
}
}
func NewChatActivityWithReadMessage(v ReadMessageInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_READ_MESSAGE,
ReadMessage__: &v,
}
}
func NewChatActivityWithNewConversation(v NewConversationInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_NEW_CONVERSATION,
NewConversation__: &v,
}
}
func NewChatActivityWithSetStatus(v SetStatusInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_SET_STATUS,
SetStatus__: &v,
}
}
func NewChatActivityWithFailedMessage(v FailedMessageInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_FAILED_MESSAGE,
FailedMessage__: &v,
}
}
func NewChatActivityWithMembersUpdate(v MembersUpdateInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_MEMBERS_UPDATE,
MembersUpdate__: &v,
}
}
func NewChatActivityWithSetAppNotificationSettings(v SetAppNotificationSettingsInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_SET_APP_NOTIFICATION_SETTINGS,
SetAppNotificationSettings__: &v,
}
}
func NewChatActivityWithTeamtype(v TeamTypeInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_TEAMTYPE,
Teamtype__: &v,
}
}
func NewChatActivityWithExpunge(v ExpungeInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_EXPUNGE,
Expunge__: &v,
}
}
func NewChatActivityWithEphemeralPurge(v EphemeralPurgeNotifInfo) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_EPHEMERAL_PURGE,
EphemeralPurge__: &v,
}
}
func NewChatActivityWithReactionUpdate(v ReactionUpdateNotif) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_REACTION_UPDATE,
ReactionUpdate__: &v,
}
}
func NewChatActivityWithMessagesUpdated(v MessagesUpdated) ChatActivity {
return ChatActivity{
ActivityType__: ChatActivityType_MESSAGES_UPDATED,
MessagesUpdated__: &v,
}
}
func (o ChatActivity) DeepCopy() ChatActivity {
return ChatActivity{
ActivityType__: o.ActivityType__.DeepCopy(),
IncomingMessage__: (func(x *IncomingMessage) *IncomingMessage {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.IncomingMessage__),
ReadMessage__: (func(x *ReadMessageInfo) *ReadMessageInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ReadMessage__),
NewConversation__: (func(x *NewConversationInfo) *NewConversationInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.NewConversation__),
SetStatus__: (func(x *SetStatusInfo) *SetStatusInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.SetStatus__),
FailedMessage__: (func(x *FailedMessageInfo) *FailedMessageInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.FailedMessage__),
MembersUpdate__: (func(x *MembersUpdateInfo) *MembersUpdateInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.MembersUpdate__),
SetAppNotificationSettings__: (func(x *SetAppNotificationSettingsInfo) *SetAppNotificationSettingsInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.SetAppNotificationSettings__),
Teamtype__: (func(x *TeamTypeInfo) *TeamTypeInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Teamtype__),
Expunge__: (func(x *ExpungeInfo) *ExpungeInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Expunge__),
EphemeralPurge__: (func(x *EphemeralPurgeNotifInfo) *EphemeralPurgeNotifInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.EphemeralPurge__),
ReactionUpdate__: (func(x *ReactionUpdateNotif) *ReactionUpdateNotif {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ReactionUpdate__),
MessagesUpdated__: (func(x *MessagesUpdated) *MessagesUpdated {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.MessagesUpdated__),
}
}
type TyperInfo struct {
Uid keybase1.UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`
DeviceID keybase1.DeviceID `codec:"deviceID" json:"deviceID"`
DeviceName string `codec:"deviceName" json:"deviceName"`
DeviceType string `codec:"deviceType" json:"deviceType"`
}
func (o TyperInfo) DeepCopy() TyperInfo {
return TyperInfo{
Uid: o.Uid.DeepCopy(),
Username: o.Username,
DeviceID: o.DeviceID.DeepCopy(),
DeviceName: o.DeviceName,
DeviceType: o.DeviceType,
}
}
type ConvTypingUpdate struct {
ConvID ConversationID `codec:"convID" json:"convID"`
Typers []TyperInfo `codec:"typers" json:"typers"`
}
func (o ConvTypingUpdate) DeepCopy() ConvTypingUpdate {
return ConvTypingUpdate{
ConvID: o.ConvID.DeepCopy(),
Typers: (func(x []TyperInfo) []TyperInfo {
if x == nil {
return nil
}
ret := make([]TyperInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Typers),
}
}
type StaleUpdateType int
const (
StaleUpdateType_CLEAR StaleUpdateType = 0
StaleUpdateType_NEWACTIVITY StaleUpdateType = 1
)
func (o StaleUpdateType) DeepCopy() StaleUpdateType { return o }
var StaleUpdateTypeMap = map[string]StaleUpdateType{
"CLEAR": 0,
"NEWACTIVITY": 1,
}
var StaleUpdateTypeRevMap = map[StaleUpdateType]string{
0: "CLEAR",
1: "NEWACTIVITY",
}
func (e StaleUpdateType) String() string {
if v, ok := StaleUpdateTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ConversationStaleUpdate struct {
ConvID ConversationID `codec:"convID" json:"convID"`
UpdateType StaleUpdateType `codec:"updateType" json:"updateType"`
}
func (o ConversationStaleUpdate) DeepCopy() ConversationStaleUpdate {
return ConversationStaleUpdate{
ConvID: o.ConvID.DeepCopy(),
UpdateType: o.UpdateType.DeepCopy(),
}
}
type ChatSyncIncrementalConv struct {
Conv UnverifiedInboxUIItem `codec:"conv" json:"conv"`
ShouldUnbox bool `codec:"shouldUnbox" json:"shouldUnbox"`
}
func (o ChatSyncIncrementalConv) DeepCopy() ChatSyncIncrementalConv {
return ChatSyncIncrementalConv{
Conv: o.Conv.DeepCopy(),
ShouldUnbox: o.ShouldUnbox,
}
}
type ChatSyncIncrementalInfo struct {
Items []ChatSyncIncrementalConv `codec:"items" json:"items"`
Removals []string `codec:"removals" json:"removals"`
}
func (o ChatSyncIncrementalInfo) DeepCopy() ChatSyncIncrementalInfo {
return ChatSyncIncrementalInfo{
Items: (func(x []ChatSyncIncrementalConv) []ChatSyncIncrementalConv {
if x == nil {
return nil
}
ret := make([]ChatSyncIncrementalConv, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Items),
Removals: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.Removals),
}
}
type ChatSyncResult struct {
SyncType__ SyncInboxResType `codec:"syncType" json:"syncType"`
Incremental__ *ChatSyncIncrementalInfo `codec:"incremental,omitempty" json:"incremental,omitempty"`
}
func (o *ChatSyncResult) SyncType() (ret SyncInboxResType, err error) {
switch o.SyncType__ {
case SyncInboxResType_INCREMENTAL:
if o.Incremental__ == nil {
err = errors.New("unexpected nil value for Incremental__")
return ret, err
}
}
return o.SyncType__, nil
}
func (o ChatSyncResult) Incremental() (res ChatSyncIncrementalInfo) {
if o.SyncType__ != SyncInboxResType_INCREMENTAL {
panic("wrong case accessed")
}
if o.Incremental__ == nil {
return
}
return *o.Incremental__
}
func NewChatSyncResultWithCurrent() ChatSyncResult {
return ChatSyncResult{
SyncType__: SyncInboxResType_CURRENT,
}
}
func NewChatSyncResultWithClear() ChatSyncResult {
return ChatSyncResult{
SyncType__: SyncInboxResType_CLEAR,
}
}
func NewChatSyncResultWithIncremental(v ChatSyncIncrementalInfo) ChatSyncResult {
return ChatSyncResult{
SyncType__: SyncInboxResType_INCREMENTAL,
Incremental__: &v,
}
}
func (o ChatSyncResult) DeepCopy() ChatSyncResult {
return ChatSyncResult{
SyncType__: o.SyncType__.DeepCopy(),
Incremental__: (func(x *ChatSyncIncrementalInfo) *ChatSyncIncrementalInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Incremental__),
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,850 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/chat1/unfurl.avdl
package chat1
import (
"errors"
"fmt"
gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1"
)
type UnfurlType int
const (
UnfurlType_GENERIC UnfurlType = 0
UnfurlType_YOUTUBE UnfurlType = 1
UnfurlType_GIPHY UnfurlType = 2
UnfurlType_MAPS UnfurlType = 3
)
func (o UnfurlType) DeepCopy() UnfurlType { return o }
var UnfurlTypeMap = map[string]UnfurlType{
"GENERIC": 0,
"YOUTUBE": 1,
"GIPHY": 2,
"MAPS": 3,
}
var UnfurlTypeRevMap = map[UnfurlType]string{
0: "GENERIC",
1: "YOUTUBE",
2: "GIPHY",
3: "MAPS",
}
func (e UnfurlType) String() string {
if v, ok := UnfurlTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type UnfurlVideo struct {
Url string `codec:"url" json:"url"`
MimeType string `codec:"mimeType" json:"mimeType"`
Height int `codec:"height" json:"height"`
Width int `codec:"width" json:"width"`
}
func (o UnfurlVideo) DeepCopy() UnfurlVideo {
return UnfurlVideo{
Url: o.Url,
MimeType: o.MimeType,
Height: o.Height,
Width: o.Width,
}
}
type UnfurlGenericRaw struct {
Title string `codec:"title" json:"title"`
Url string `codec:"url" json:"url"`
SiteName string `codec:"siteName" json:"siteName"`
FaviconUrl *string `codec:"faviconUrl,omitempty" json:"faviconUrl,omitempty"`
ImageUrl *string `codec:"imageUrl,omitempty" json:"imageUrl,omitempty"`
Video *UnfurlVideo `codec:"video,omitempty" json:"video,omitempty"`
PublishTime *int `codec:"publishTime,omitempty" json:"publishTime,omitempty"`
Description *string `codec:"description,omitempty" json:"description,omitempty"`
}
func (o UnfurlGenericRaw) DeepCopy() UnfurlGenericRaw {
return UnfurlGenericRaw{
Title: o.Title,
Url: o.Url,
SiteName: o.SiteName,
FaviconUrl: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.FaviconUrl),
ImageUrl: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.ImageUrl),
Video: (func(x *UnfurlVideo) *UnfurlVideo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Video),
PublishTime: (func(x *int) *int {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.PublishTime),
Description: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Description),
}
}
type UnfurlYoutubeRaw struct {
}
func (o UnfurlYoutubeRaw) DeepCopy() UnfurlYoutubeRaw {
return UnfurlYoutubeRaw{}
}
type UnfurlGiphyRaw struct {
ImageUrl *string `codec:"imageUrl,omitempty" json:"imageUrl,omitempty"`
Video *UnfurlVideo `codec:"video,omitempty" json:"video,omitempty"`
FaviconUrl *string `codec:"faviconUrl,omitempty" json:"faviconUrl,omitempty"`
}
func (o UnfurlGiphyRaw) DeepCopy() UnfurlGiphyRaw {
return UnfurlGiphyRaw{
ImageUrl: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.ImageUrl),
Video: (func(x *UnfurlVideo) *UnfurlVideo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Video),
FaviconUrl: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.FaviconUrl),
}
}
type UnfurlMapsRaw struct {
Title string `codec:"title" json:"title"`
Url string `codec:"url" json:"url"`
SiteName string `codec:"siteName" json:"siteName"`
ImageUrl string `codec:"imageUrl" json:"imageUrl"`
HistoryImageUrl *string `codec:"historyImageUrl,omitempty" json:"historyImageUrl,omitempty"`
Description string `codec:"description" json:"description"`
Coord Coordinate `codec:"coord" json:"coord"`
Time gregor1.Time `codec:"time" json:"time"`
LiveLocationEndTime *gregor1.Time `codec:"liveLocationEndTime,omitempty" json:"liveLocationEndTime,omitempty"`
LiveLocationDone bool `codec:"liveLocationDone" json:"liveLocationDone"`
}
func (o UnfurlMapsRaw) DeepCopy() UnfurlMapsRaw {
return UnfurlMapsRaw{
Title: o.Title,
Url: o.Url,
SiteName: o.SiteName,
ImageUrl: o.ImageUrl,
HistoryImageUrl: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.HistoryImageUrl),
Description: o.Description,
Coord: o.Coord.DeepCopy(),
Time: o.Time.DeepCopy(),
LiveLocationEndTime: (func(x *gregor1.Time) *gregor1.Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.LiveLocationEndTime),
LiveLocationDone: o.LiveLocationDone,
}
}
type UnfurlRaw struct {
UnfurlType__ UnfurlType `codec:"unfurlType" json:"unfurlType"`
Generic__ *UnfurlGenericRaw `codec:"generic,omitempty" json:"generic,omitempty"`
Youtube__ *UnfurlYoutubeRaw `codec:"youtube,omitempty" json:"youtube,omitempty"`
Giphy__ *UnfurlGiphyRaw `codec:"giphy,omitempty" json:"giphy,omitempty"`
Maps__ *UnfurlMapsRaw `codec:"maps,omitempty" json:"maps,omitempty"`
}
func (o *UnfurlRaw) UnfurlType() (ret UnfurlType, err error) {
switch o.UnfurlType__ {
case UnfurlType_GENERIC:
if o.Generic__ == nil {
err = errors.New("unexpected nil value for Generic__")
return ret, err
}
case UnfurlType_YOUTUBE:
if o.Youtube__ == nil {
err = errors.New("unexpected nil value for Youtube__")
return ret, err
}
case UnfurlType_GIPHY:
if o.Giphy__ == nil {
err = errors.New("unexpected nil value for Giphy__")
return ret, err
}
case UnfurlType_MAPS:
if o.Maps__ == nil {
err = errors.New("unexpected nil value for Maps__")
return ret, err
}
}
return o.UnfurlType__, nil
}
func (o UnfurlRaw) Generic() (res UnfurlGenericRaw) {
if o.UnfurlType__ != UnfurlType_GENERIC {
panic("wrong case accessed")
}
if o.Generic__ == nil {
return
}
return *o.Generic__
}
func (o UnfurlRaw) Youtube() (res UnfurlYoutubeRaw) {
if o.UnfurlType__ != UnfurlType_YOUTUBE {
panic("wrong case accessed")
}
if o.Youtube__ == nil {
return
}
return *o.Youtube__
}
func (o UnfurlRaw) Giphy() (res UnfurlGiphyRaw) {
if o.UnfurlType__ != UnfurlType_GIPHY {
panic("wrong case accessed")
}
if o.Giphy__ == nil {
return
}
return *o.Giphy__
}
func (o UnfurlRaw) Maps() (res UnfurlMapsRaw) {
if o.UnfurlType__ != UnfurlType_MAPS {
panic("wrong case accessed")
}
if o.Maps__ == nil {
return
}
return *o.Maps__
}
func NewUnfurlRawWithGeneric(v UnfurlGenericRaw) UnfurlRaw {
return UnfurlRaw{
UnfurlType__: UnfurlType_GENERIC,
Generic__: &v,
}
}
func NewUnfurlRawWithYoutube(v UnfurlYoutubeRaw) UnfurlRaw {
return UnfurlRaw{
UnfurlType__: UnfurlType_YOUTUBE,
Youtube__: &v,
}
}
func NewUnfurlRawWithGiphy(v UnfurlGiphyRaw) UnfurlRaw {
return UnfurlRaw{
UnfurlType__: UnfurlType_GIPHY,
Giphy__: &v,
}
}
func NewUnfurlRawWithMaps(v UnfurlMapsRaw) UnfurlRaw {
return UnfurlRaw{
UnfurlType__: UnfurlType_MAPS,
Maps__: &v,
}
}
func (o UnfurlRaw) DeepCopy() UnfurlRaw {
return UnfurlRaw{
UnfurlType__: o.UnfurlType__.DeepCopy(),
Generic__: (func(x *UnfurlGenericRaw) *UnfurlGenericRaw {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Generic__),
Youtube__: (func(x *UnfurlYoutubeRaw) *UnfurlYoutubeRaw {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Youtube__),
Giphy__: (func(x *UnfurlGiphyRaw) *UnfurlGiphyRaw {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Giphy__),
Maps__: (func(x *UnfurlMapsRaw) *UnfurlMapsRaw {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Maps__),
}
}
type UnfurlGenericMapInfo struct {
Coord Coordinate `codec:"coord" json:"coord"`
Time gregor1.Time `codec:"time" json:"time"`
LiveLocationEndTime *gregor1.Time `codec:"liveLocationEndTime,omitempty" json:"liveLocationEndTime,omitempty"`
IsLiveLocationDone bool `codec:"isLiveLocationDone" json:"isLiveLocationDone"`
}
func (o UnfurlGenericMapInfo) DeepCopy() UnfurlGenericMapInfo {
return UnfurlGenericMapInfo{
Coord: o.Coord.DeepCopy(),
Time: o.Time.DeepCopy(),
LiveLocationEndTime: (func(x *gregor1.Time) *gregor1.Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.LiveLocationEndTime),
IsLiveLocationDone: o.IsLiveLocationDone,
}
}
type UnfurlGeneric struct {
Title string `codec:"title" json:"title"`
Url string `codec:"url" json:"url"`
SiteName string `codec:"siteName" json:"siteName"`
Favicon *Asset `codec:"favicon,omitempty" json:"favicon,omitempty"`
Image *Asset `codec:"image,omitempty" json:"image,omitempty"`
PublishTime *int `codec:"publishTime,omitempty" json:"publishTime,omitempty"`
Description *string `codec:"description,omitempty" json:"description,omitempty"`
MapInfo *UnfurlGenericMapInfo `codec:"mapInfo,omitempty" json:"mapInfo,omitempty"`
}
func (o UnfurlGeneric) DeepCopy() UnfurlGeneric {
return UnfurlGeneric{
Title: o.Title,
Url: o.Url,
SiteName: o.SiteName,
Favicon: (func(x *Asset) *Asset {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Favicon),
Image: (func(x *Asset) *Asset {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Image),
PublishTime: (func(x *int) *int {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.PublishTime),
Description: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Description),
MapInfo: (func(x *UnfurlGenericMapInfo) *UnfurlGenericMapInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.MapInfo),
}
}
type UnfurlYoutube struct {
}
func (o UnfurlYoutube) DeepCopy() UnfurlYoutube {
return UnfurlYoutube{}
}
type UnfurlGiphy struct {
Favicon *Asset `codec:"favicon,omitempty" json:"favicon,omitempty"`
Image *Asset `codec:"image,omitempty" json:"image,omitempty"`
Video *Asset `codec:"video,omitempty" json:"video,omitempty"`
}
func (o UnfurlGiphy) DeepCopy() UnfurlGiphy {
return UnfurlGiphy{
Favicon: (func(x *Asset) *Asset {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Favicon),
Image: (func(x *Asset) *Asset {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Image),
Video: (func(x *Asset) *Asset {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Video),
}
}
type Unfurl struct {
UnfurlType__ UnfurlType `codec:"unfurlType" json:"unfurlType"`
Generic__ *UnfurlGeneric `codec:"generic,omitempty" json:"generic,omitempty"`
Youtube__ *UnfurlYoutube `codec:"youtube,omitempty" json:"youtube,omitempty"`
Giphy__ *UnfurlGiphy `codec:"giphy,omitempty" json:"giphy,omitempty"`
}
func (o *Unfurl) UnfurlType() (ret UnfurlType, err error) {
switch o.UnfurlType__ {
case UnfurlType_GENERIC:
if o.Generic__ == nil {
err = errors.New("unexpected nil value for Generic__")
return ret, err
}
case UnfurlType_YOUTUBE:
if o.Youtube__ == nil {
err = errors.New("unexpected nil value for Youtube__")
return ret, err
}
case UnfurlType_GIPHY:
if o.Giphy__ == nil {
err = errors.New("unexpected nil value for Giphy__")
return ret, err
}
}
return o.UnfurlType__, nil
}
func (o Unfurl) Generic() (res UnfurlGeneric) {
if o.UnfurlType__ != UnfurlType_GENERIC {
panic("wrong case accessed")
}
if o.Generic__ == nil {
return
}
return *o.Generic__
}
func (o Unfurl) Youtube() (res UnfurlYoutube) {
if o.UnfurlType__ != UnfurlType_YOUTUBE {
panic("wrong case accessed")
}
if o.Youtube__ == nil {
return
}
return *o.Youtube__
}
func (o Unfurl) Giphy() (res UnfurlGiphy) {
if o.UnfurlType__ != UnfurlType_GIPHY {
panic("wrong case accessed")
}
if o.Giphy__ == nil {
return
}
return *o.Giphy__
}
func NewUnfurlWithGeneric(v UnfurlGeneric) Unfurl {
return Unfurl{
UnfurlType__: UnfurlType_GENERIC,
Generic__: &v,
}
}
func NewUnfurlWithYoutube(v UnfurlYoutube) Unfurl {
return Unfurl{
UnfurlType__: UnfurlType_YOUTUBE,
Youtube__: &v,
}
}
func NewUnfurlWithGiphy(v UnfurlGiphy) Unfurl {
return Unfurl{
UnfurlType__: UnfurlType_GIPHY,
Giphy__: &v,
}
}
func (o Unfurl) DeepCopy() Unfurl {
return Unfurl{
UnfurlType__: o.UnfurlType__.DeepCopy(),
Generic__: (func(x *UnfurlGeneric) *UnfurlGeneric {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Generic__),
Youtube__: (func(x *UnfurlYoutube) *UnfurlYoutube {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Youtube__),
Giphy__: (func(x *UnfurlGiphy) *UnfurlGiphy {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Giphy__),
}
}
type UnfurlResult struct {
Unfurl Unfurl `codec:"unfurl" json:"unfurl"`
Url string `codec:"url" json:"url"`
}
func (o UnfurlResult) DeepCopy() UnfurlResult {
return UnfurlResult{
Unfurl: o.Unfurl.DeepCopy(),
Url: o.Url,
}
}
type UnfurlImageDisplay struct {
Url string `codec:"url" json:"url"`
Height int `codec:"height" json:"height"`
Width int `codec:"width" json:"width"`
IsVideo bool `codec:"isVideo" json:"isVideo"`
}
func (o UnfurlImageDisplay) DeepCopy() UnfurlImageDisplay {
return UnfurlImageDisplay{
Url: o.Url,
Height: o.Height,
Width: o.Width,
IsVideo: o.IsVideo,
}
}
type UnfurlGenericDisplay struct {
Title string `codec:"title" json:"title"`
Url string `codec:"url" json:"url"`
SiteName string `codec:"siteName" json:"siteName"`
Favicon *UnfurlImageDisplay `codec:"favicon,omitempty" json:"favicon,omitempty"`
Media *UnfurlImageDisplay `codec:"media,omitempty" json:"media,omitempty"`
PublishTime *int `codec:"publishTime,omitempty" json:"publishTime,omitempty"`
Description *string `codec:"description,omitempty" json:"description,omitempty"`
MapInfo *UnfurlGenericMapInfo `codec:"mapInfo,omitempty" json:"mapInfo,omitempty"`
}
func (o UnfurlGenericDisplay) DeepCopy() UnfurlGenericDisplay {
return UnfurlGenericDisplay{
Title: o.Title,
Url: o.Url,
SiteName: o.SiteName,
Favicon: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Favicon),
Media: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Media),
PublishTime: (func(x *int) *int {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.PublishTime),
Description: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Description),
MapInfo: (func(x *UnfurlGenericMapInfo) *UnfurlGenericMapInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.MapInfo),
}
}
type UnfurlYoutubeDisplay struct {
}
func (o UnfurlYoutubeDisplay) DeepCopy() UnfurlYoutubeDisplay {
return UnfurlYoutubeDisplay{}
}
type UnfurlGiphyDisplay struct {
Favicon *UnfurlImageDisplay `codec:"favicon,omitempty" json:"favicon,omitempty"`
Image *UnfurlImageDisplay `codec:"image,omitempty" json:"image,omitempty"`
Video *UnfurlImageDisplay `codec:"video,omitempty" json:"video,omitempty"`
}
func (o UnfurlGiphyDisplay) DeepCopy() UnfurlGiphyDisplay {
return UnfurlGiphyDisplay{
Favicon: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Favicon),
Image: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Image),
Video: (func(x *UnfurlImageDisplay) *UnfurlImageDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Video),
}
}
type UnfurlDisplay struct {
UnfurlType__ UnfurlType `codec:"unfurlType" json:"unfurlType"`
Generic__ *UnfurlGenericDisplay `codec:"generic,omitempty" json:"generic,omitempty"`
Youtube__ *UnfurlYoutubeDisplay `codec:"youtube,omitempty" json:"youtube,omitempty"`
Giphy__ *UnfurlGiphyDisplay `codec:"giphy,omitempty" json:"giphy,omitempty"`
}
func (o *UnfurlDisplay) UnfurlType() (ret UnfurlType, err error) {
switch o.UnfurlType__ {
case UnfurlType_GENERIC:
if o.Generic__ == nil {
err = errors.New("unexpected nil value for Generic__")
return ret, err
}
case UnfurlType_YOUTUBE:
if o.Youtube__ == nil {
err = errors.New("unexpected nil value for Youtube__")
return ret, err
}
case UnfurlType_GIPHY:
if o.Giphy__ == nil {
err = errors.New("unexpected nil value for Giphy__")
return ret, err
}
}
return o.UnfurlType__, nil
}
func (o UnfurlDisplay) Generic() (res UnfurlGenericDisplay) {
if o.UnfurlType__ != UnfurlType_GENERIC {
panic("wrong case accessed")
}
if o.Generic__ == nil {
return
}
return *o.Generic__
}
func (o UnfurlDisplay) Youtube() (res UnfurlYoutubeDisplay) {
if o.UnfurlType__ != UnfurlType_YOUTUBE {
panic("wrong case accessed")
}
if o.Youtube__ == nil {
return
}
return *o.Youtube__
}
func (o UnfurlDisplay) Giphy() (res UnfurlGiphyDisplay) {
if o.UnfurlType__ != UnfurlType_GIPHY {
panic("wrong case accessed")
}
if o.Giphy__ == nil {
return
}
return *o.Giphy__
}
func NewUnfurlDisplayWithGeneric(v UnfurlGenericDisplay) UnfurlDisplay {
return UnfurlDisplay{
UnfurlType__: UnfurlType_GENERIC,
Generic__: &v,
}
}
func NewUnfurlDisplayWithYoutube(v UnfurlYoutubeDisplay) UnfurlDisplay {
return UnfurlDisplay{
UnfurlType__: UnfurlType_YOUTUBE,
Youtube__: &v,
}
}
func NewUnfurlDisplayWithGiphy(v UnfurlGiphyDisplay) UnfurlDisplay {
return UnfurlDisplay{
UnfurlType__: UnfurlType_GIPHY,
Giphy__: &v,
}
}
func (o UnfurlDisplay) DeepCopy() UnfurlDisplay {
return UnfurlDisplay{
UnfurlType__: o.UnfurlType__.DeepCopy(),
Generic__: (func(x *UnfurlGenericDisplay) *UnfurlGenericDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Generic__),
Youtube__: (func(x *UnfurlYoutubeDisplay) *UnfurlYoutubeDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Youtube__),
Giphy__: (func(x *UnfurlGiphyDisplay) *UnfurlGiphyDisplay {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Giphy__),
}
}
type UnfurlMode int
const (
UnfurlMode_ALWAYS UnfurlMode = 0
UnfurlMode_NEVER UnfurlMode = 1
UnfurlMode_WHITELISTED UnfurlMode = 2
)
func (o UnfurlMode) DeepCopy() UnfurlMode { return o }
var UnfurlModeMap = map[string]UnfurlMode{
"ALWAYS": 0,
"NEVER": 1,
"WHITELISTED": 2,
}
var UnfurlModeRevMap = map[UnfurlMode]string{
0: "ALWAYS",
1: "NEVER",
2: "WHITELISTED",
}
func (e UnfurlMode) String() string {
if v, ok := UnfurlModeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type UnfurlSettings struct {
Mode UnfurlMode `codec:"mode" json:"mode"`
Whitelist map[string]bool `codec:"whitelist" json:"whitelist"`
}
func (o UnfurlSettings) DeepCopy() UnfurlSettings {
return UnfurlSettings{
Mode: o.Mode.DeepCopy(),
Whitelist: (func(x map[string]bool) map[string]bool {
if x == nil {
return nil
}
ret := make(map[string]bool, len(x))
for k, v := range x {
kCopy := k
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.Whitelist),
}
}
type UnfurlSettingsDisplay struct {
Mode UnfurlMode `codec:"mode" json:"mode"`
Whitelist []string `codec:"whitelist" json:"whitelist"`
}
func (o UnfurlSettingsDisplay) DeepCopy() UnfurlSettingsDisplay {
return UnfurlSettingsDisplay{
Mode: o.Mode.DeepCopy(),
Whitelist: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.Whitelist),
}
}

View File

@ -0,0 +1,20 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/gregor1/auth.avdl
package gregor1
type AuthResult struct {
Uid UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`
Sid SessionID `codec:"sid" json:"sid"`
IsAdmin bool `codec:"isAdmin" json:"isAdmin"`
}
func (o AuthResult) DeepCopy() AuthResult {
return AuthResult{
Uid: o.Uid.DeepCopy(),
Username: o.Username,
Sid: o.Sid.DeepCopy(),
IsAdmin: o.IsAdmin,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/gregor1/auth_internal.avdl
package gregor1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/gregor1/auth_update.avdl
package gregor1

View File

@ -0,0 +1,394 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/gregor1/common.avdl
package gregor1
type TimeOrOffset struct {
Time_ Time `codec:"time" json:"time"`
Offset_ DurationMsec `codec:"offset" json:"offset"`
}
func (o TimeOrOffset) DeepCopy() TimeOrOffset {
return TimeOrOffset{
Time_: o.Time_.DeepCopy(),
Offset_: o.Offset_.DeepCopy(),
}
}
type Metadata struct {
Uid_ UID `codec:"uid" json:"uid"`
MsgID_ MsgID `codec:"msgID" json:"msgID"`
Ctime_ Time `codec:"ctime" json:"ctime"`
DeviceID_ DeviceID `codec:"deviceID" json:"deviceID"`
InBandMsgType_ int `codec:"inBandMsgType" json:"inBandMsgType"`
}
func (o Metadata) DeepCopy() Metadata {
return Metadata{
Uid_: o.Uid_.DeepCopy(),
MsgID_: o.MsgID_.DeepCopy(),
Ctime_: o.Ctime_.DeepCopy(),
DeviceID_: o.DeviceID_.DeepCopy(),
InBandMsgType_: o.InBandMsgType_,
}
}
type InBandMessage struct {
StateUpdate_ *StateUpdateMessage `codec:"stateUpdate,omitempty" json:"stateUpdate,omitempty"`
StateSync_ *StateSyncMessage `codec:"stateSync,omitempty" json:"stateSync,omitempty"`
}
func (o InBandMessage) DeepCopy() InBandMessage {
return InBandMessage{
StateUpdate_: (func(x *StateUpdateMessage) *StateUpdateMessage {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.StateUpdate_),
StateSync_: (func(x *StateSyncMessage) *StateSyncMessage {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.StateSync_),
}
}
type State struct {
Items_ []ItemAndMetadata `codec:"items" json:"items"`
}
func (o State) DeepCopy() State {
return State{
Items_: (func(x []ItemAndMetadata) []ItemAndMetadata {
if x == nil {
return nil
}
ret := make([]ItemAndMetadata, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Items_),
}
}
type StateUpdateMessage struct {
Md_ Metadata `codec:"md" json:"md"`
Creation_ *Item `codec:"creation,omitempty" json:"creation,omitempty"`
Dismissal_ *Dismissal `codec:"dismissal,omitempty" json:"dismissal,omitempty"`
}
func (o StateUpdateMessage) DeepCopy() StateUpdateMessage {
return StateUpdateMessage{
Md_: o.Md_.DeepCopy(),
Creation_: (func(x *Item) *Item {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Creation_),
Dismissal_: (func(x *Dismissal) *Dismissal {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Dismissal_),
}
}
type StateSyncMessage struct {
Md_ Metadata `codec:"md" json:"md"`
}
func (o StateSyncMessage) DeepCopy() StateSyncMessage {
return StateSyncMessage{
Md_: o.Md_.DeepCopy(),
}
}
type MsgRange struct {
EndTime_ TimeOrOffset `codec:"endTime" json:"endTime"`
Category_ Category `codec:"category" json:"category"`
SkipMsgIDs_ []MsgID `codec:"skipMsgIDs" json:"skipMsgIDs"`
}
func (o MsgRange) DeepCopy() MsgRange {
return MsgRange{
EndTime_: o.EndTime_.DeepCopy(),
Category_: o.Category_.DeepCopy(),
SkipMsgIDs_: (func(x []MsgID) []MsgID {
if x == nil {
return nil
}
ret := make([]MsgID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.SkipMsgIDs_),
}
}
type Dismissal struct {
MsgIDs_ []MsgID `codec:"msgIDs" json:"msgIDs"`
Ranges_ []MsgRange `codec:"ranges" json:"ranges"`
}
func (o Dismissal) DeepCopy() Dismissal {
return Dismissal{
MsgIDs_: (func(x []MsgID) []MsgID {
if x == nil {
return nil
}
ret := make([]MsgID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.MsgIDs_),
Ranges_: (func(x []MsgRange) []MsgRange {
if x == nil {
return nil
}
ret := make([]MsgRange, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Ranges_),
}
}
type Item struct {
Category_ Category `codec:"category" json:"category"`
Dtime_ TimeOrOffset `codec:"dtime" json:"dtime"`
RemindTimes_ []TimeOrOffset `codec:"remindTimes" json:"remindTimes"`
Body_ Body `codec:"body" json:"body"`
}
func (o Item) DeepCopy() Item {
return Item{
Category_: o.Category_.DeepCopy(),
Dtime_: o.Dtime_.DeepCopy(),
RemindTimes_: (func(x []TimeOrOffset) []TimeOrOffset {
if x == nil {
return nil
}
ret := make([]TimeOrOffset, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RemindTimes_),
Body_: o.Body_.DeepCopy(),
}
}
type ItemAndMetadata struct {
Md_ *Metadata `codec:"md,omitempty" json:"md,omitempty"`
Item_ *Item `codec:"item,omitempty" json:"item,omitempty"`
}
func (o ItemAndMetadata) DeepCopy() ItemAndMetadata {
return ItemAndMetadata{
Md_: (func(x *Metadata) *Metadata {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Md_),
Item_: (func(x *Item) *Item {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Item_),
}
}
type Reminder struct {
Item_ ItemAndMetadata `codec:"item" json:"item"`
Seqno_ int `codec:"seqno" json:"seqno"`
RemindTime_ Time `codec:"remindTime" json:"remindTime"`
}
func (o Reminder) DeepCopy() Reminder {
return Reminder{
Item_: o.Item_.DeepCopy(),
Seqno_: o.Seqno_,
RemindTime_: o.RemindTime_.DeepCopy(),
}
}
type ReminderID struct {
Uid_ UID `codec:"uid" json:"uid"`
MsgID_ MsgID `codec:"msgID" json:"msgID"`
Seqno_ int `codec:"seqno" json:"seqno"`
}
func (o ReminderID) DeepCopy() ReminderID {
return ReminderID{
Uid_: o.Uid_.DeepCopy(),
MsgID_: o.MsgID_.DeepCopy(),
Seqno_: o.Seqno_,
}
}
type OutOfBandMessage struct {
Uid_ UID `codec:"uid" json:"uid"`
System_ System `codec:"system" json:"system"`
Body_ Body `codec:"body" json:"body"`
}
func (o OutOfBandMessage) DeepCopy() OutOfBandMessage {
return OutOfBandMessage{
Uid_: o.Uid_.DeepCopy(),
System_: o.System_.DeepCopy(),
Body_: o.Body_.DeepCopy(),
}
}
type ReminderSet struct {
Reminders_ []Reminder `codec:"reminders" json:"reminders"`
MoreRemindersReady_ bool `codec:"moreRemindersReady" json:"moreRemindersReady"`
}
func (o ReminderSet) DeepCopy() ReminderSet {
return ReminderSet{
Reminders_: (func(x []Reminder) []Reminder {
if x == nil {
return nil
}
ret := make([]Reminder, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Reminders_),
MoreRemindersReady_: o.MoreRemindersReady_,
}
}
type Message struct {
Oobm_ *OutOfBandMessage `codec:"oobm,omitempty" json:"oobm,omitempty"`
Ibm_ *InBandMessage `codec:"ibm,omitempty" json:"ibm,omitempty"`
}
func (o Message) DeepCopy() Message {
return Message{
Oobm_: (func(x *OutOfBandMessage) *OutOfBandMessage {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Oobm_),
Ibm_: (func(x *InBandMessage) *InBandMessage {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Ibm_),
}
}
type DurationMsec int64
func (o DurationMsec) DeepCopy() DurationMsec {
return o
}
type DurationSec int64
func (o DurationSec) DeepCopy() DurationSec {
return o
}
type Category string
func (o Category) DeepCopy() Category {
return o
}
type System string
func (o System) DeepCopy() System {
return o
}
type UID []byte
func (o UID) DeepCopy() UID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type MsgID []byte
func (o MsgID) DeepCopy() MsgID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type DeviceID []byte
func (o DeviceID) DeepCopy() DeviceID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type Body []byte
func (o Body) DeepCopy() Body {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type Time int64
func (o Time) DeepCopy() Time {
return o
}
type SessionID string
func (o SessionID) DeepCopy() SessionID {
return o
}
type SessionToken string
func (o SessionToken) DeepCopy() SessionToken {
return o
}

View File

@ -0,0 +1,72 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/gregor1/incoming.avdl
package gregor1
type SyncResult struct {
Msgs []InBandMessage `codec:"msgs" json:"msgs"`
Hash []byte `codec:"hash" json:"hash"`
}
func (o SyncResult) DeepCopy() SyncResult {
return SyncResult{
Msgs: (func(x []InBandMessage) []InBandMessage {
if x == nil {
return nil
}
ret := make([]InBandMessage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Msgs),
Hash: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Hash),
}
}
// DescribeConnectedUsers will take a list of users, and return the list of users
// which are connected to any Gregor in the cluster, and what devices (and device type)
// those users are connected with.
type ConnectedDevice struct {
DeviceID DeviceID `codec:"deviceID" json:"deviceID"`
DeviceType string `codec:"deviceType" json:"deviceType"`
DevicePlatform string `codec:"devicePlatform" json:"devicePlatform"`
UserAgent string `codec:"userAgent" json:"userAgent"`
}
func (o ConnectedDevice) DeepCopy() ConnectedDevice {
return ConnectedDevice{
DeviceID: o.DeviceID.DeepCopy(),
DeviceType: o.DeviceType,
DevicePlatform: o.DevicePlatform,
UserAgent: o.UserAgent,
}
}
type ConnectedUser struct {
Uid UID `codec:"uid" json:"uid"`
Devices []ConnectedDevice `codec:"devices" json:"devices"`
}
func (o ConnectedUser) DeepCopy() ConnectedUser {
return ConnectedUser{
Uid: o.Uid.DeepCopy(),
Devices: (func(x []ConnectedDevice) []ConnectedDevice {
if x == nil {
return nil
}
ret := make([]ConnectedDevice, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Devices),
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/gregor1/outgoing.avdl
package gregor1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/gregor1/remind.avdl
package gregor1

View File

@ -0,0 +1,98 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/account.avdl
package keybase1
type HasServerKeysRes struct {
HasServerKeys bool `codec:"hasServerKeys" json:"hasServerKeys"`
}
func (o HasServerKeysRes) DeepCopy() HasServerKeysRes {
return HasServerKeysRes{
HasServerKeys: o.HasServerKeys,
}
}
type LockdownHistory struct {
Status bool `codec:"status" json:"status"`
CreationTime Time `codec:"creationTime" json:"ctime"`
DeviceID DeviceID `codec:"deviceID" json:"device_id"`
DeviceName string `codec:"deviceName" json:"deviceName"`
}
func (o LockdownHistory) DeepCopy() LockdownHistory {
return LockdownHistory{
Status: o.Status,
CreationTime: o.CreationTime.DeepCopy(),
DeviceID: o.DeviceID.DeepCopy(),
DeviceName: o.DeviceName,
}
}
type GetLockdownResponse struct {
History []LockdownHistory `codec:"history" json:"history"`
Status bool `codec:"status" json:"status"`
}
func (o GetLockdownResponse) DeepCopy() GetLockdownResponse {
return GetLockdownResponse{
History: (func(x []LockdownHistory) []LockdownHistory {
if x == nil {
return nil
}
ret := make([]LockdownHistory, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.History),
Status: o.Status,
}
}
type TeamContactSettings struct {
TeamID TeamID `codec:"teamID" json:"team_id"`
Enabled bool `codec:"enabled" json:"enabled"`
}
func (o TeamContactSettings) DeepCopy() TeamContactSettings {
return TeamContactSettings{
TeamID: o.TeamID.DeepCopy(),
Enabled: o.Enabled,
}
}
type ContactSettings struct {
Version *int `codec:"version,omitempty" json:"version,omitempty"`
AllowFolloweeDegrees int `codec:"allowFolloweeDegrees" json:"allow_followee_degrees"`
AllowGoodTeams bool `codec:"allowGoodTeams" json:"allow_good_teams"`
Enabled bool `codec:"enabled" json:"enabled"`
Teams []TeamContactSettings `codec:"teams" json:"teams"`
}
func (o ContactSettings) DeepCopy() ContactSettings {
return ContactSettings{
Version: (func(x *int) *int {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Version),
AllowFolloweeDegrees: o.AllowFolloweeDegrees,
AllowGoodTeams: o.AllowGoodTeams,
Enabled: o.Enabled,
Teams: (func(x []TeamContactSettings) []TeamContactSettings {
if x == nil {
return nil
}
ret := make([]TeamContactSettings, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Teams),
}
}

View File

@ -0,0 +1,22 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/airdrop.avdl
package keybase1
type AirdropDetails struct {
Uid UID `codec:"uid" json:"uid"`
Kid BinaryKID `codec:"kid" json:"kid"`
Vid VID `codec:"vid" json:"vid"`
Vers string `codec:"vers" json:"vers"`
Time Time `codec:"time" json:"time"`
}
func (o AirdropDetails) DeepCopy() AirdropDetails {
return AirdropDetails{
Uid: o.Uid.DeepCopy(),
Kid: o.Kid.DeepCopy(),
Vid: o.Vid.DeepCopy(),
Vers: o.Vers,
Time: o.Time.DeepCopy(),
}
}

View File

@ -0,0 +1,20 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/apiserver.avdl
package keybase1
type APIRes struct {
Status string `codec:"status" json:"status"`
Body string `codec:"body" json:"body"`
HttpStatus int `codec:"httpStatus" json:"httpStatus"`
AppStatus string `codec:"appStatus" json:"appStatus"`
}
func (o APIRes) DeepCopy() APIRes {
return APIRes{
Status: o.Status,
Body: o.Body,
HttpStatus: o.HttpStatus,
AppStatus: o.AppStatus,
}
}

View File

@ -0,0 +1,75 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/appstate.avdl
package keybase1
import (
"fmt"
)
type MobileAppState int
const (
MobileAppState_FOREGROUND MobileAppState = 0
MobileAppState_BACKGROUND MobileAppState = 1
MobileAppState_INACTIVE MobileAppState = 2
MobileAppState_BACKGROUNDACTIVE MobileAppState = 3
)
func (o MobileAppState) DeepCopy() MobileAppState { return o }
var MobileAppStateMap = map[string]MobileAppState{
"FOREGROUND": 0,
"BACKGROUND": 1,
"INACTIVE": 2,
"BACKGROUNDACTIVE": 3,
}
var MobileAppStateRevMap = map[MobileAppState]string{
0: "FOREGROUND",
1: "BACKGROUND",
2: "INACTIVE",
3: "BACKGROUNDACTIVE",
}
func (e MobileAppState) String() string {
if v, ok := MobileAppStateRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type MobileNetworkState int
const (
MobileNetworkState_NONE MobileNetworkState = 0
MobileNetworkState_WIFI MobileNetworkState = 1
MobileNetworkState_CELLULAR MobileNetworkState = 2
MobileNetworkState_UNKNOWN MobileNetworkState = 3
MobileNetworkState_NOTAVAILABLE MobileNetworkState = 4
)
func (o MobileNetworkState) DeepCopy() MobileNetworkState { return o }
var MobileNetworkStateMap = map[string]MobileNetworkState{
"NONE": 0,
"WIFI": 1,
"CELLULAR": 2,
"UNKNOWN": 3,
"NOTAVAILABLE": 4,
}
var MobileNetworkStateRevMap = map[MobileNetworkState]string{
0: "NONE",
1: "WIFI",
2: "CELLULAR",
3: "UNKNOWN",
4: "NOTAVAILABLE",
}
func (e MobileNetworkState) String() string {
if v, ok := MobileNetworkStateRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}

View File

@ -0,0 +1,76 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/audit.avdl
package keybase1
import (
"fmt"
)
type BoxAuditAttemptResult int
const (
BoxAuditAttemptResult_FAILURE_RETRYABLE BoxAuditAttemptResult = 0
BoxAuditAttemptResult_FAILURE_MALICIOUS_SERVER BoxAuditAttemptResult = 1
BoxAuditAttemptResult_OK_VERIFIED BoxAuditAttemptResult = 2
BoxAuditAttemptResult_OK_NOT_ATTEMPTED_ROLE BoxAuditAttemptResult = 3
BoxAuditAttemptResult_OK_NOT_ATTEMPTED_OPENTEAM BoxAuditAttemptResult = 4
BoxAuditAttemptResult_OK_NOT_ATTEMPTED_SUBTEAM BoxAuditAttemptResult = 5
)
func (o BoxAuditAttemptResult) DeepCopy() BoxAuditAttemptResult { return o }
var BoxAuditAttemptResultMap = map[string]BoxAuditAttemptResult{
"FAILURE_RETRYABLE": 0,
"FAILURE_MALICIOUS_SERVER": 1,
"OK_VERIFIED": 2,
"OK_NOT_ATTEMPTED_ROLE": 3,
"OK_NOT_ATTEMPTED_OPENTEAM": 4,
"OK_NOT_ATTEMPTED_SUBTEAM": 5,
}
var BoxAuditAttemptResultRevMap = map[BoxAuditAttemptResult]string{
0: "FAILURE_RETRYABLE",
1: "FAILURE_MALICIOUS_SERVER",
2: "OK_VERIFIED",
3: "OK_NOT_ATTEMPTED_ROLE",
4: "OK_NOT_ATTEMPTED_OPENTEAM",
5: "OK_NOT_ATTEMPTED_SUBTEAM",
}
func (e BoxAuditAttemptResult) String() string {
if v, ok := BoxAuditAttemptResultRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type BoxAuditAttempt struct {
Ctime UnixTime `codec:"ctime" json:"ctime"`
Error *string `codec:"error,omitempty" json:"error,omitempty"`
Result BoxAuditAttemptResult `codec:"result" json:"result"`
Generation *PerTeamKeyGeneration `codec:"generation,omitempty" json:"generation,omitempty"`
Rotated bool `codec:"rotated" json:"rotated"`
}
func (o BoxAuditAttempt) DeepCopy() BoxAuditAttempt {
return BoxAuditAttempt{
Ctime: o.Ctime.DeepCopy(),
Error: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Error),
Result: o.Result.DeepCopy(),
Generation: (func(x *PerTeamKeyGeneration) *PerTeamKeyGeneration {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Generation),
Rotated: o.Rotated,
}
}

View File

@ -0,0 +1,72 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/avatars.avdl
package keybase1
type AvatarUrl string
func (o AvatarUrl) DeepCopy() AvatarUrl {
return o
}
type AvatarFormat string
func (o AvatarFormat) DeepCopy() AvatarFormat {
return o
}
type LoadAvatarsRes struct {
Picmap map[string]map[AvatarFormat]AvatarUrl `codec:"picmap" json:"picmap"`
}
func (o LoadAvatarsRes) DeepCopy() LoadAvatarsRes {
return LoadAvatarsRes{
Picmap: (func(x map[string]map[AvatarFormat]AvatarUrl) map[string]map[AvatarFormat]AvatarUrl {
if x == nil {
return nil
}
ret := make(map[string]map[AvatarFormat]AvatarUrl, len(x))
for k, v := range x {
kCopy := k
vCopy := (func(x map[AvatarFormat]AvatarUrl) map[AvatarFormat]AvatarUrl {
if x == nil {
return nil
}
ret := make(map[AvatarFormat]AvatarUrl, len(x))
for k, v := range x {
kCopy := k.DeepCopy()
vCopy := v.DeepCopy()
ret[kCopy] = vCopy
}
return ret
})(v)
ret[kCopy] = vCopy
}
return ret
})(o.Picmap),
}
}
type AvatarClearCacheMsg struct {
Name string `codec:"name" json:"name"`
Formats []AvatarFormat `codec:"formats" json:"formats"`
Typ AvatarUpdateType `codec:"typ" json:"typ"`
}
func (o AvatarClearCacheMsg) DeepCopy() AvatarClearCacheMsg {
return AvatarClearCacheMsg{
Name: o.Name,
Formats: (func(x []AvatarFormat) []AvatarFormat {
if x == nil {
return nil
}
ret := make([]AvatarFormat, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Formats),
Typ: o.Typ.DeepCopy(),
}
}

View File

@ -0,0 +1,63 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/backend_common.avdl
package keybase1
import (
"fmt"
)
type BlockType int
const (
BlockType_DATA BlockType = 0
BlockType_MD BlockType = 1
BlockType_GIT BlockType = 2
)
func (o BlockType) DeepCopy() BlockType { return o }
var BlockTypeMap = map[string]BlockType{
"DATA": 0,
"MD": 1,
"GIT": 2,
}
var BlockTypeRevMap = map[BlockType]string{
0: "DATA",
1: "MD",
2: "GIT",
}
func (e BlockType) String() string {
if v, ok := BlockTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type BlockIdCombo struct {
BlockHash string `codec:"blockHash" json:"blockHash"`
ChargedTo UserOrTeamID `codec:"chargedTo" json:"chargedTo"`
BlockType BlockType `codec:"blockType" json:"blockType"`
}
func (o BlockIdCombo) DeepCopy() BlockIdCombo {
return BlockIdCombo{
BlockHash: o.BlockHash,
ChargedTo: o.ChargedTo.DeepCopy(),
BlockType: o.BlockType.DeepCopy(),
}
}
type ChallengeInfo struct {
Now int64 `codec:"now" json:"now"`
Challenge string `codec:"challenge" json:"challenge"`
}
func (o ChallengeInfo) DeepCopy() ChallengeInfo {
return ChallengeInfo{
Now: o.Now,
Challenge: o.Challenge,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/badger.avdl
package keybase1

View File

@ -0,0 +1,153 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/block.avdl
package keybase1
import (
"fmt"
)
type BlockStatus int
const (
BlockStatus_UNKNOWN BlockStatus = 0
BlockStatus_LIVE BlockStatus = 1
BlockStatus_ARCHIVED BlockStatus = 2
)
func (o BlockStatus) DeepCopy() BlockStatus { return o }
var BlockStatusMap = map[string]BlockStatus{
"UNKNOWN": 0,
"LIVE": 1,
"ARCHIVED": 2,
}
var BlockStatusRevMap = map[BlockStatus]string{
0: "UNKNOWN",
1: "LIVE",
2: "ARCHIVED",
}
func (e BlockStatus) String() string {
if v, ok := BlockStatusRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type GetBlockRes struct {
BlockKey string `codec:"blockKey" json:"blockKey"`
Buf []byte `codec:"buf" json:"buf"`
Size int `codec:"size" json:"size"`
Status BlockStatus `codec:"status" json:"status"`
}
func (o GetBlockRes) DeepCopy() GetBlockRes {
return GetBlockRes{
BlockKey: o.BlockKey,
Buf: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Buf),
Size: o.Size,
Status: o.Status.DeepCopy(),
}
}
type BlockRefNonce [8]byte
func (o BlockRefNonce) DeepCopy() BlockRefNonce {
var ret BlockRefNonce
copy(ret[:], o[:])
return ret
}
type BlockReference struct {
Bid BlockIdCombo `codec:"bid" json:"bid"`
Nonce BlockRefNonce `codec:"nonce" json:"nonce"`
ChargedTo UserOrTeamID `codec:"chargedTo" json:"chargedTo"`
}
func (o BlockReference) DeepCopy() BlockReference {
return BlockReference{
Bid: o.Bid.DeepCopy(),
Nonce: o.Nonce.DeepCopy(),
ChargedTo: o.ChargedTo.DeepCopy(),
}
}
type BlockReferenceCount struct {
Ref BlockReference `codec:"ref" json:"ref"`
LiveCount int `codec:"liveCount" json:"liveCount"`
}
func (o BlockReferenceCount) DeepCopy() BlockReferenceCount {
return BlockReferenceCount{
Ref: o.Ref.DeepCopy(),
LiveCount: o.LiveCount,
}
}
type DowngradeReferenceRes struct {
Completed []BlockReferenceCount `codec:"completed" json:"completed"`
Failed BlockReference `codec:"failed" json:"failed"`
}
func (o DowngradeReferenceRes) DeepCopy() DowngradeReferenceRes {
return DowngradeReferenceRes{
Completed: (func(x []BlockReferenceCount) []BlockReferenceCount {
if x == nil {
return nil
}
ret := make([]BlockReferenceCount, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Completed),
Failed: o.Failed.DeepCopy(),
}
}
type BlockIdCount struct {
Id BlockIdCombo `codec:"id" json:"id"`
LiveCount int `codec:"liveCount" json:"liveCount"`
}
func (o BlockIdCount) DeepCopy() BlockIdCount {
return BlockIdCount{
Id: o.Id.DeepCopy(),
LiveCount: o.LiveCount,
}
}
type ReferenceCountRes struct {
Counts []BlockIdCount `codec:"counts" json:"counts"`
}
func (o ReferenceCountRes) DeepCopy() ReferenceCountRes {
return ReferenceCountRes{
Counts: (func(x []BlockIdCount) []BlockIdCount {
if x == nil {
return nil
}
ret := make([]BlockIdCount, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Counts),
}
}
type BlockPingResponse struct {
}
func (o BlockPingResponse) DeepCopy() BlockPingResponse {
return BlockPingResponse{}
}

View File

@ -0,0 +1,22 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/bot.avdl
package keybase1
type BotToken string
func (o BotToken) DeepCopy() BotToken {
return o
}
type BotTokenInfo struct {
Token BotToken `codec:"token" json:"bot_token"`
Ctime Time `codec:"ctime" json:"ctime"`
}
func (o BotTokenInfo) DeepCopy() BotTokenInfo {
return BotTokenInfo{
Token: o.Token.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/btc.avdl
package keybase1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,842 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/config.avdl
package keybase1
import (
"errors"
"fmt"
)
type CurrentStatus struct {
Configured bool `codec:"configured" json:"configured"`
Registered bool `codec:"registered" json:"registered"`
LoggedIn bool `codec:"loggedIn" json:"loggedIn"`
SessionIsValid bool `codec:"sessionIsValid" json:"sessionIsValid"`
User *User `codec:"user,omitempty" json:"user,omitempty"`
}
func (o CurrentStatus) DeepCopy() CurrentStatus {
return CurrentStatus{
Configured: o.Configured,
Registered: o.Registered,
LoggedIn: o.LoggedIn,
SessionIsValid: o.SessionIsValid,
User: (func(x *User) *User {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.User),
}
}
type SessionStatus struct {
SessionFor string `codec:"SessionFor" json:"SessionFor"`
Loaded bool `codec:"Loaded" json:"Loaded"`
Cleared bool `codec:"Cleared" json:"Cleared"`
SaltOnly bool `codec:"SaltOnly" json:"SaltOnly"`
Expired bool `codec:"Expired" json:"Expired"`
}
func (o SessionStatus) DeepCopy() SessionStatus {
return SessionStatus{
SessionFor: o.SessionFor,
Loaded: o.Loaded,
Cleared: o.Cleared,
SaltOnly: o.SaltOnly,
Expired: o.Expired,
}
}
type ClientDetails struct {
Pid int `codec:"pid" json:"pid"`
ClientType ClientType `codec:"clientType" json:"clientType"`
Argv []string `codec:"argv" json:"argv"`
Desc string `codec:"desc" json:"desc"`
Version string `codec:"version" json:"version"`
}
func (o ClientDetails) DeepCopy() ClientDetails {
return ClientDetails{
Pid: o.Pid,
ClientType: o.ClientType.DeepCopy(),
Argv: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.Argv),
Desc: o.Desc,
Version: o.Version,
}
}
type ClientStatus struct {
Details ClientDetails `codec:"details" json:"details"`
ConnectionID int `codec:"connectionID" json:"connectionID"`
NotificationChannels NotificationChannels `codec:"notificationChannels" json:"notificationChannels"`
}
func (o ClientStatus) DeepCopy() ClientStatus {
return ClientStatus{
Details: o.Details.DeepCopy(),
ConnectionID: o.ConnectionID,
NotificationChannels: o.NotificationChannels.DeepCopy(),
}
}
type PlatformInfo struct {
Os string `codec:"os" json:"os"`
OsVersion string `codec:"osVersion" json:"osVersion"`
Arch string `codec:"arch" json:"arch"`
GoVersion string `codec:"goVersion" json:"goVersion"`
}
func (o PlatformInfo) DeepCopy() PlatformInfo {
return PlatformInfo{
Os: o.Os,
OsVersion: o.OsVersion,
Arch: o.Arch,
GoVersion: o.GoVersion,
}
}
type LoadDeviceErr struct {
Where string `codec:"where" json:"where"`
Desc string `codec:"desc" json:"desc"`
}
func (o LoadDeviceErr) DeepCopy() LoadDeviceErr {
return LoadDeviceErr{
Where: o.Where,
Desc: o.Desc,
}
}
type DirSizeInfo struct {
NumFiles int `codec:"numFiles" json:"numFiles"`
Name string `codec:"name" json:"name"`
HumanSize string `codec:"humanSize" json:"humanSize"`
}
func (o DirSizeInfo) DeepCopy() DirSizeInfo {
return DirSizeInfo{
NumFiles: o.NumFiles,
Name: o.Name,
HumanSize: o.HumanSize,
}
}
type ExtendedStatus struct {
Standalone bool `codec:"standalone" json:"standalone"`
PassphraseStreamCached bool `codec:"passphraseStreamCached" json:"passphraseStreamCached"`
TsecCached bool `codec:"tsecCached" json:"tsecCached"`
DeviceSigKeyCached bool `codec:"deviceSigKeyCached" json:"deviceSigKeyCached"`
DeviceEncKeyCached bool `codec:"deviceEncKeyCached" json:"deviceEncKeyCached"`
PaperSigKeyCached bool `codec:"paperSigKeyCached" json:"paperSigKeyCached"`
PaperEncKeyCached bool `codec:"paperEncKeyCached" json:"paperEncKeyCached"`
StoredSecret bool `codec:"storedSecret" json:"storedSecret"`
SecretPromptSkip bool `codec:"secretPromptSkip" json:"secretPromptSkip"`
RememberPassphrase bool `codec:"rememberPassphrase" json:"rememberPassphrase"`
Device *Device `codec:"device,omitempty" json:"device,omitempty"`
DeviceErr *LoadDeviceErr `codec:"deviceErr,omitempty" json:"deviceErr,omitempty"`
LogDir string `codec:"logDir" json:"logDir"`
Session *SessionStatus `codec:"session,omitempty" json:"session,omitempty"`
DefaultUsername string `codec:"defaultUsername" json:"defaultUsername"`
ProvisionedUsernames []string `codec:"provisionedUsernames" json:"provisionedUsernames"`
ConfiguredAccounts []ConfiguredAccount `codec:"configuredAccounts" json:"configuredAccounts"`
Clients []ClientStatus `codec:"Clients" json:"Clients"`
DeviceEkNames []string `codec:"deviceEkNames" json:"deviceEkNames"`
PlatformInfo PlatformInfo `codec:"platformInfo" json:"platformInfo"`
DefaultDeviceID DeviceID `codec:"defaultDeviceID" json:"defaultDeviceID"`
LocalDbStats []string `codec:"localDbStats" json:"localDbStats"`
LocalChatDbStats []string `codec:"localChatDbStats" json:"localChatDbStats"`
LocalBlockCacheDbStats []string `codec:"localBlockCacheDbStats" json:"localBlockCacheDbStats"`
LocalSyncCacheDbStats []string `codec:"localSyncCacheDbStats" json:"localSyncCacheDbStats"`
CacheDirSizeInfo []DirSizeInfo `codec:"cacheDirSizeInfo" json:"cacheDirSizeInfo"`
UiRouterMapping map[string]int `codec:"uiRouterMapping" json:"uiRouterMapping"`
}
func (o ExtendedStatus) DeepCopy() ExtendedStatus {
return ExtendedStatus{
Standalone: o.Standalone,
PassphraseStreamCached: o.PassphraseStreamCached,
TsecCached: o.TsecCached,
DeviceSigKeyCached: o.DeviceSigKeyCached,
DeviceEncKeyCached: o.DeviceEncKeyCached,
PaperSigKeyCached: o.PaperSigKeyCached,
PaperEncKeyCached: o.PaperEncKeyCached,
StoredSecret: o.StoredSecret,
SecretPromptSkip: o.SecretPromptSkip,
RememberPassphrase: o.RememberPassphrase,
Device: (func(x *Device) *Device {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Device),
DeviceErr: (func(x *LoadDeviceErr) *LoadDeviceErr {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.DeviceErr),
LogDir: o.LogDir,
Session: (func(x *SessionStatus) *SessionStatus {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Session),
DefaultUsername: o.DefaultUsername,
ProvisionedUsernames: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.ProvisionedUsernames),
ConfiguredAccounts: (func(x []ConfiguredAccount) []ConfiguredAccount {
if x == nil {
return nil
}
ret := make([]ConfiguredAccount, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ConfiguredAccounts),
Clients: (func(x []ClientStatus) []ClientStatus {
if x == nil {
return nil
}
ret := make([]ClientStatus, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Clients),
DeviceEkNames: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.DeviceEkNames),
PlatformInfo: o.PlatformInfo.DeepCopy(),
DefaultDeviceID: o.DefaultDeviceID.DeepCopy(),
LocalDbStats: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.LocalDbStats),
LocalChatDbStats: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.LocalChatDbStats),
LocalBlockCacheDbStats: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.LocalBlockCacheDbStats),
LocalSyncCacheDbStats: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.LocalSyncCacheDbStats),
CacheDirSizeInfo: (func(x []DirSizeInfo) []DirSizeInfo {
if x == nil {
return nil
}
ret := make([]DirSizeInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.CacheDirSizeInfo),
UiRouterMapping: (func(x map[string]int) map[string]int {
if x == nil {
return nil
}
ret := make(map[string]int, len(x))
for k, v := range x {
kCopy := k
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.UiRouterMapping),
}
}
type KbClientStatus struct {
Version string `codec:"version" json:"version"`
}
func (o KbClientStatus) DeepCopy() KbClientStatus {
return KbClientStatus{
Version: o.Version,
}
}
type KbServiceStatus struct {
Version string `codec:"version" json:"version"`
Running bool `codec:"running" json:"running"`
Pid string `codec:"pid" json:"pid"`
Log string `codec:"log" json:"log"`
EkLog string `codec:"ekLog" json:"ekLog"`
}
func (o KbServiceStatus) DeepCopy() KbServiceStatus {
return KbServiceStatus{
Version: o.Version,
Running: o.Running,
Pid: o.Pid,
Log: o.Log,
EkLog: o.EkLog,
}
}
type KBFSStatus struct {
Version string `codec:"version" json:"version"`
InstalledVersion string `codec:"installedVersion" json:"installedVersion"`
Running bool `codec:"running" json:"running"`
Pid string `codec:"pid" json:"pid"`
Log string `codec:"log" json:"log"`
Mount string `codec:"mount" json:"mount"`
}
func (o KBFSStatus) DeepCopy() KBFSStatus {
return KBFSStatus{
Version: o.Version,
InstalledVersion: o.InstalledVersion,
Running: o.Running,
Pid: o.Pid,
Log: o.Log,
Mount: o.Mount,
}
}
type DesktopStatus struct {
Version string `codec:"version" json:"version"`
Running bool `codec:"running" json:"running"`
Log string `codec:"log" json:"log"`
}
func (o DesktopStatus) DeepCopy() DesktopStatus {
return DesktopStatus{
Version: o.Version,
Running: o.Running,
Log: o.Log,
}
}
type UpdaterStatus struct {
Log string `codec:"log" json:"log"`
}
func (o UpdaterStatus) DeepCopy() UpdaterStatus {
return UpdaterStatus{
Log: o.Log,
}
}
type StartStatus struct {
Log string `codec:"log" json:"log"`
}
func (o StartStatus) DeepCopy() StartStatus {
return StartStatus{
Log: o.Log,
}
}
type GitStatus struct {
Log string `codec:"log" json:"log"`
}
func (o GitStatus) DeepCopy() GitStatus {
return GitStatus{
Log: o.Log,
}
}
type FullStatus struct {
Username string `codec:"username" json:"username"`
ConfigPath string `codec:"configPath" json:"configPath"`
CurStatus CurrentStatus `codec:"curStatus" json:"curStatus"`
ExtStatus ExtendedStatus `codec:"extStatus" json:"extStatus"`
Client KbClientStatus `codec:"client" json:"client"`
Service KbServiceStatus `codec:"service" json:"service"`
Kbfs KBFSStatus `codec:"kbfs" json:"kbfs"`
Desktop DesktopStatus `codec:"desktop" json:"desktop"`
Updater UpdaterStatus `codec:"updater" json:"updater"`
Start StartStatus `codec:"start" json:"start"`
Git GitStatus `codec:"git" json:"git"`
}
func (o FullStatus) DeepCopy() FullStatus {
return FullStatus{
Username: o.Username,
ConfigPath: o.ConfigPath,
CurStatus: o.CurStatus.DeepCopy(),
ExtStatus: o.ExtStatus.DeepCopy(),
Client: o.Client.DeepCopy(),
Service: o.Service.DeepCopy(),
Kbfs: o.Kbfs.DeepCopy(),
Desktop: o.Desktop.DeepCopy(),
Updater: o.Updater.DeepCopy(),
Start: o.Start.DeepCopy(),
Git: o.Git.DeepCopy(),
}
}
type LogSendID string
func (o LogSendID) DeepCopy() LogSendID {
return o
}
type AllProvisionedUsernames struct {
DefaultUsername string `codec:"defaultUsername" json:"defaultUsername"`
ProvisionedUsernames []string `codec:"provisionedUsernames" json:"provisionedUsernames"`
HasProvisionedUser bool `codec:"hasProvisionedUser" json:"hasProvisionedUser"`
}
func (o AllProvisionedUsernames) DeepCopy() AllProvisionedUsernames {
return AllProvisionedUsernames{
DefaultUsername: o.DefaultUsername,
ProvisionedUsernames: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.ProvisionedUsernames),
HasProvisionedUser: o.HasProvisionedUser,
}
}
type ForkType int
const (
ForkType_NONE ForkType = 0
ForkType_AUTO ForkType = 1
ForkType_WATCHDOG ForkType = 2
ForkType_LAUNCHD ForkType = 3
ForkType_SYSTEMD ForkType = 4
)
func (o ForkType) DeepCopy() ForkType { return o }
var ForkTypeMap = map[string]ForkType{
"NONE": 0,
"AUTO": 1,
"WATCHDOG": 2,
"LAUNCHD": 3,
"SYSTEMD": 4,
}
var ForkTypeRevMap = map[ForkType]string{
0: "NONE",
1: "AUTO",
2: "WATCHDOG",
3: "LAUNCHD",
4: "SYSTEMD",
}
func (e ForkType) String() string {
if v, ok := ForkTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type Config struct {
ServerURI string `codec:"serverURI" json:"serverURI"`
SocketFile string `codec:"socketFile" json:"socketFile"`
Label string `codec:"label" json:"label"`
RunMode string `codec:"runMode" json:"runMode"`
GpgExists bool `codec:"gpgExists" json:"gpgExists"`
GpgPath string `codec:"gpgPath" json:"gpgPath"`
Version string `codec:"version" json:"version"`
Path string `codec:"path" json:"path"`
BinaryRealpath string `codec:"binaryRealpath" json:"binaryRealpath"`
ConfigPath string `codec:"configPath" json:"configPath"`
VersionShort string `codec:"versionShort" json:"versionShort"`
VersionFull string `codec:"versionFull" json:"versionFull"`
IsAutoForked bool `codec:"isAutoForked" json:"isAutoForked"`
ForkType ForkType `codec:"forkType" json:"forkType"`
}
func (o Config) DeepCopy() Config {
return Config{
ServerURI: o.ServerURI,
SocketFile: o.SocketFile,
Label: o.Label,
RunMode: o.RunMode,
GpgExists: o.GpgExists,
GpgPath: o.GpgPath,
Version: o.Version,
Path: o.Path,
BinaryRealpath: o.BinaryRealpath,
ConfigPath: o.ConfigPath,
VersionShort: o.VersionShort,
VersionFull: o.VersionFull,
IsAutoForked: o.IsAutoForked,
ForkType: o.ForkType.DeepCopy(),
}
}
type ConfigValue struct {
IsNull bool `codec:"isNull" json:"isNull"`
B *bool `codec:"b,omitempty" json:"b,omitempty"`
I *int `codec:"i,omitempty" json:"i,omitempty"`
F *float64 `codec:"f,omitempty" json:"f,omitempty"`
S *string `codec:"s,omitempty" json:"s,omitempty"`
O *string `codec:"o,omitempty" json:"o,omitempty"`
}
func (o ConfigValue) DeepCopy() ConfigValue {
return ConfigValue{
IsNull: o.IsNull,
B: (func(x *bool) *bool {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.B),
I: (func(x *int) *int {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.I),
F: (func(x *float64) *float64 {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.F),
S: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.S),
O: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.O),
}
}
type OutOfDateInfo struct {
UpgradeTo string `codec:"upgradeTo" json:"upgradeTo"`
UpgradeURI string `codec:"upgradeURI" json:"upgradeURI"`
CustomMessage string `codec:"customMessage" json:"customMessage"`
CriticalClockSkew int64 `codec:"criticalClockSkew" json:"criticalClockSkew"`
}
func (o OutOfDateInfo) DeepCopy() OutOfDateInfo {
return OutOfDateInfo{
UpgradeTo: o.UpgradeTo,
UpgradeURI: o.UpgradeURI,
CustomMessage: o.CustomMessage,
CriticalClockSkew: o.CriticalClockSkew,
}
}
type UpdateInfoStatus int
const (
UpdateInfoStatus_UP_TO_DATE UpdateInfoStatus = 0
UpdateInfoStatus_NEED_UPDATE UpdateInfoStatus = 1
UpdateInfoStatus_CRITICALLY_OUT_OF_DATE UpdateInfoStatus = 2
)
func (o UpdateInfoStatus) DeepCopy() UpdateInfoStatus { return o }
var UpdateInfoStatusMap = map[string]UpdateInfoStatus{
"UP_TO_DATE": 0,
"NEED_UPDATE": 1,
"CRITICALLY_OUT_OF_DATE": 2,
}
var UpdateInfoStatusRevMap = map[UpdateInfoStatus]string{
0: "UP_TO_DATE",
1: "NEED_UPDATE",
2: "CRITICALLY_OUT_OF_DATE",
}
func (e UpdateInfoStatus) String() string {
if v, ok := UpdateInfoStatusRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type UpdateInfo struct {
Status UpdateInfoStatus `codec:"status" json:"status"`
Message string `codec:"message" json:"message"`
}
func (o UpdateInfo) DeepCopy() UpdateInfo {
return UpdateInfo{
Status: o.Status.DeepCopy(),
Message: o.Message,
}
}
type BootstrapStatus struct {
Registered bool `codec:"registered" json:"registered"`
LoggedIn bool `codec:"loggedIn" json:"loggedIn"`
Uid UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`
DeviceID DeviceID `codec:"deviceID" json:"deviceID"`
DeviceName string `codec:"deviceName" json:"deviceName"`
Fullname FullName `codec:"fullname" json:"fullname"`
UserReacjis UserReacjis `codec:"userReacjis" json:"userReacjis"`
HttpSrvInfo *HttpSrvInfo `codec:"httpSrvInfo,omitempty" json:"httpSrvInfo,omitempty"`
}
func (o BootstrapStatus) DeepCopy() BootstrapStatus {
return BootstrapStatus{
Registered: o.Registered,
LoggedIn: o.LoggedIn,
Uid: o.Uid.DeepCopy(),
Username: o.Username,
DeviceID: o.DeviceID.DeepCopy(),
DeviceName: o.DeviceName,
Fullname: o.Fullname.DeepCopy(),
UserReacjis: o.UserReacjis.DeepCopy(),
HttpSrvInfo: (func(x *HttpSrvInfo) *HttpSrvInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.HttpSrvInfo),
}
}
type UpdateInfoStatus2 int
const (
UpdateInfoStatus2_OK UpdateInfoStatus2 = 0
UpdateInfoStatus2_SUGGESTED UpdateInfoStatus2 = 1
UpdateInfoStatus2_CRITICAL UpdateInfoStatus2 = 2
)
func (o UpdateInfoStatus2) DeepCopy() UpdateInfoStatus2 { return o }
var UpdateInfoStatus2Map = map[string]UpdateInfoStatus2{
"OK": 0,
"SUGGESTED": 1,
"CRITICAL": 2,
}
var UpdateInfoStatus2RevMap = map[UpdateInfoStatus2]string{
0: "OK",
1: "SUGGESTED",
2: "CRITICAL",
}
func (e UpdateInfoStatus2) String() string {
if v, ok := UpdateInfoStatus2RevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type UpdateDetails struct {
Message string `codec:"message" json:"message"`
}
func (o UpdateDetails) DeepCopy() UpdateDetails {
return UpdateDetails{
Message: o.Message,
}
}
type UpdateInfo2 struct {
Status__ UpdateInfoStatus2 `codec:"status" json:"status"`
Suggested__ *UpdateDetails `codec:"suggested,omitempty" json:"suggested,omitempty"`
Critical__ *UpdateDetails `codec:"critical,omitempty" json:"critical,omitempty"`
}
func (o *UpdateInfo2) Status() (ret UpdateInfoStatus2, err error) {
switch o.Status__ {
case UpdateInfoStatus2_SUGGESTED:
if o.Suggested__ == nil {
err = errors.New("unexpected nil value for Suggested__")
return ret, err
}
case UpdateInfoStatus2_CRITICAL:
if o.Critical__ == nil {
err = errors.New("unexpected nil value for Critical__")
return ret, err
}
}
return o.Status__, nil
}
func (o UpdateInfo2) Suggested() (res UpdateDetails) {
if o.Status__ != UpdateInfoStatus2_SUGGESTED {
panic("wrong case accessed")
}
if o.Suggested__ == nil {
return
}
return *o.Suggested__
}
func (o UpdateInfo2) Critical() (res UpdateDetails) {
if o.Status__ != UpdateInfoStatus2_CRITICAL {
panic("wrong case accessed")
}
if o.Critical__ == nil {
return
}
return *o.Critical__
}
func NewUpdateInfo2WithOk() UpdateInfo2 {
return UpdateInfo2{
Status__: UpdateInfoStatus2_OK,
}
}
func NewUpdateInfo2WithSuggested(v UpdateDetails) UpdateInfo2 {
return UpdateInfo2{
Status__: UpdateInfoStatus2_SUGGESTED,
Suggested__: &v,
}
}
func NewUpdateInfo2WithCritical(v UpdateDetails) UpdateInfo2 {
return UpdateInfo2{
Status__: UpdateInfoStatus2_CRITICAL,
Critical__: &v,
}
}
func (o UpdateInfo2) DeepCopy() UpdateInfo2 {
return UpdateInfo2{
Status__: o.Status__.DeepCopy(),
Suggested__: (func(x *UpdateDetails) *UpdateDetails {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Suggested__),
Critical__: (func(x *UpdateDetails) *UpdateDetails {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Critical__),
}
}
type ProxyType int
const (
ProxyType_No_Proxy ProxyType = 0
ProxyType_HTTP_Connect ProxyType = 1
ProxyType_Socks ProxyType = 2
)
func (o ProxyType) DeepCopy() ProxyType { return o }
var ProxyTypeMap = map[string]ProxyType{
"No_Proxy": 0,
"HTTP_Connect": 1,
"Socks": 2,
}
var ProxyTypeRevMap = map[ProxyType]string{
0: "No_Proxy",
1: "HTTP_Connect",
2: "Socks",
}
func (e ProxyType) String() string {
if v, ok := ProxyTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ProxyData struct {
AddressWithPort string `codec:"addressWithPort" json:"addressWithPort"`
ProxyType ProxyType `codec:"proxyType" json:"proxyType"`
CertPinning bool `codec:"certPinning" json:"certPinning"`
}
func (o ProxyData) DeepCopy() ProxyData {
return ProxyData{
AddressWithPort: o.AddressWithPort,
ProxyType: o.ProxyType.DeepCopy(),
CertPinning: o.CertPinning,
}
}

View File

@ -0,0 +1,724 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/constants.avdl
package keybase1
import (
"fmt"
)
type StatusCode int
const (
StatusCode_SCOk StatusCode = 0
StatusCode_SCInputError StatusCode = 100
StatusCode_SCLoginRequired StatusCode = 201
StatusCode_SCBadSession StatusCode = 202
StatusCode_SCBadLoginUserNotFound StatusCode = 203
StatusCode_SCBadLoginPassword StatusCode = 204
StatusCode_SCNotFound StatusCode = 205
StatusCode_SCThrottleControl StatusCode = 210
StatusCode_SCDeleted StatusCode = 216
StatusCode_SCGeneric StatusCode = 218
StatusCode_SCAlreadyLoggedIn StatusCode = 235
StatusCode_SCExists StatusCode = 230
StatusCode_SCCanceled StatusCode = 237
StatusCode_SCInputCanceled StatusCode = 239
StatusCode_SCBadUsername StatusCode = 243
StatusCode_SCOffline StatusCode = 267
StatusCode_SCReloginRequired StatusCode = 274
StatusCode_SCResolutionFailed StatusCode = 275
StatusCode_SCProfileNotPublic StatusCode = 276
StatusCode_SCIdentifyFailed StatusCode = 277
StatusCode_SCTrackingBroke StatusCode = 278
StatusCode_SCWrongCryptoFormat StatusCode = 279
StatusCode_SCDecryptionError StatusCode = 280
StatusCode_SCInvalidAddress StatusCode = 281
StatusCode_SCNoSession StatusCode = 283
StatusCode_SCAccountReset StatusCode = 290
StatusCode_SCIdentifiesFailed StatusCode = 295
StatusCode_SCNoSpaceOnDevice StatusCode = 297
StatusCode_SCMerkleClientError StatusCode = 299
StatusCode_SCBadEmail StatusCode = 472
StatusCode_SCRateLimit StatusCode = 602
StatusCode_SCBadSignupUsernameTaken StatusCode = 701
StatusCode_SCDuplicate StatusCode = 706
StatusCode_SCBadInvitationCode StatusCode = 707
StatusCode_SCBadSignupUsernameReserved StatusCode = 710
StatusCode_SCBadSignupTeamName StatusCode = 711
StatusCode_SCFeatureFlag StatusCode = 712
StatusCode_SCEmailTaken StatusCode = 713
StatusCode_SCEmailAlreadyAdded StatusCode = 714
StatusCode_SCEmailLimitExceeded StatusCode = 715
StatusCode_SCEmailCannotDeletePrimary StatusCode = 716
StatusCode_SCEmailUnknown StatusCode = 717
StatusCode_SCBotSignupTokenNotFound StatusCode = 719
StatusCode_SCNoUpdate StatusCode = 723
StatusCode_SCMissingResult StatusCode = 801
StatusCode_SCKeyNotFound StatusCode = 901
StatusCode_SCKeyCorrupted StatusCode = 905
StatusCode_SCKeyInUse StatusCode = 907
StatusCode_SCKeyBadGen StatusCode = 913
StatusCode_SCKeyNoSecret StatusCode = 914
StatusCode_SCKeyBadUIDs StatusCode = 915
StatusCode_SCKeyNoActive StatusCode = 916
StatusCode_SCKeyNoSig StatusCode = 917
StatusCode_SCKeyBadSig StatusCode = 918
StatusCode_SCKeyBadEldest StatusCode = 919
StatusCode_SCKeyNoEldest StatusCode = 920
StatusCode_SCKeyDuplicateUpdate StatusCode = 921
StatusCode_SCSibkeyAlreadyExists StatusCode = 922
StatusCode_SCDecryptionKeyNotFound StatusCode = 924
StatusCode_SCKeyNoPGPEncryption StatusCode = 927
StatusCode_SCKeyNoNaClEncryption StatusCode = 928
StatusCode_SCKeySyncedPGPNotFound StatusCode = 929
StatusCode_SCKeyNoMatchingGPG StatusCode = 930
StatusCode_SCKeyRevoked StatusCode = 931
StatusCode_SCSigCannotVerify StatusCode = 1002
StatusCode_SCSigWrongKey StatusCode = 1008
StatusCode_SCSigOldSeqno StatusCode = 1010
StatusCode_SCSigCreationDisallowed StatusCode = 1016
StatusCode_SCSigMissingRatchet StatusCode = 1021
StatusCode_SCSigBadTotalOrder StatusCode = 1022
StatusCode_SCBadTrackSession StatusCode = 1301
StatusCode_SCDeviceBadName StatusCode = 1404
StatusCode_SCDeviceBadStatus StatusCode = 1405
StatusCode_SCDeviceNameInUse StatusCode = 1408
StatusCode_SCDeviceNotFound StatusCode = 1409
StatusCode_SCDeviceMismatch StatusCode = 1410
StatusCode_SCDeviceRequired StatusCode = 1411
StatusCode_SCDevicePrevProvisioned StatusCode = 1413
StatusCode_SCDeviceNoProvision StatusCode = 1414
StatusCode_SCDeviceProvisionViaDevice StatusCode = 1415
StatusCode_SCRevokeCurrentDevice StatusCode = 1416
StatusCode_SCRevokeLastDevice StatusCode = 1417
StatusCode_SCDeviceProvisionOffline StatusCode = 1418
StatusCode_SCRevokeLastDevicePGP StatusCode = 1419
StatusCode_SCStreamExists StatusCode = 1501
StatusCode_SCStreamNotFound StatusCode = 1502
StatusCode_SCStreamWrongKind StatusCode = 1503
StatusCode_SCStreamEOF StatusCode = 1504
StatusCode_SCStreamUnknown StatusCode = 1505
StatusCode_SCGenericAPIError StatusCode = 1600
StatusCode_SCAPINetworkError StatusCode = 1601
StatusCode_SCTimeout StatusCode = 1602
StatusCode_SCProofError StatusCode = 1701
StatusCode_SCIdentificationExpired StatusCode = 1702
StatusCode_SCSelfNotFound StatusCode = 1703
StatusCode_SCBadKexPhrase StatusCode = 1704
StatusCode_SCNoUIDelegation StatusCode = 1705
StatusCode_SCNoUI StatusCode = 1706
StatusCode_SCGPGUnavailable StatusCode = 1707
StatusCode_SCInvalidVersionError StatusCode = 1800
StatusCode_SCOldVersionError StatusCode = 1801
StatusCode_SCInvalidLocationError StatusCode = 1802
StatusCode_SCServiceStatusError StatusCode = 1803
StatusCode_SCInstallError StatusCode = 1804
StatusCode_SCLoadKextError StatusCode = 1810
StatusCode_SCLoadKextPermError StatusCode = 1811
StatusCode_SCGitInternal StatusCode = 2300
StatusCode_SCGitRepoAlreadyExists StatusCode = 2301
StatusCode_SCGitInvalidRepoName StatusCode = 2302
StatusCode_SCGitCannotDelete StatusCode = 2303
StatusCode_SCGitRepoDoesntExist StatusCode = 2304
StatusCode_SCLoginStateTimeout StatusCode = 2400
StatusCode_SCChatInternal StatusCode = 2500
StatusCode_SCChatRateLimit StatusCode = 2501
StatusCode_SCChatConvExists StatusCode = 2502
StatusCode_SCChatUnknownTLFID StatusCode = 2503
StatusCode_SCChatNotInConv StatusCode = 2504
StatusCode_SCChatBadMsg StatusCode = 2505
StatusCode_SCChatBroadcast StatusCode = 2506
StatusCode_SCChatAlreadySuperseded StatusCode = 2507
StatusCode_SCChatAlreadyDeleted StatusCode = 2508
StatusCode_SCChatTLFFinalized StatusCode = 2509
StatusCode_SCChatCollision StatusCode = 2510
StatusCode_SCIdentifySummaryError StatusCode = 2511
StatusCode_SCNeedSelfRekey StatusCode = 2512
StatusCode_SCNeedOtherRekey StatusCode = 2513
StatusCode_SCChatMessageCollision StatusCode = 2514
StatusCode_SCChatDuplicateMessage StatusCode = 2515
StatusCode_SCChatClientError StatusCode = 2516
StatusCode_SCChatNotInTeam StatusCode = 2517
StatusCode_SCChatStalePreviousState StatusCode = 2518
StatusCode_SCChatEphemeralRetentionPolicyViolatedError StatusCode = 2519
StatusCode_SCTeamBadMembership StatusCode = 2604
StatusCode_SCTeamSelfNotOwner StatusCode = 2607
StatusCode_SCTeamNotFound StatusCode = 2614
StatusCode_SCTeamExists StatusCode = 2619
StatusCode_SCTeamReadError StatusCode = 2623
StatusCode_SCTeamWritePermDenied StatusCode = 2625
StatusCode_SCTeamBadGeneration StatusCode = 2634
StatusCode_SCNoOp StatusCode = 2638
StatusCode_SCTeamInviteBadCancel StatusCode = 2645
StatusCode_SCTeamInviteBadToken StatusCode = 2646
StatusCode_SCTeamTarDuplicate StatusCode = 2663
StatusCode_SCTeamTarNotFound StatusCode = 2664
StatusCode_SCTeamMemberExists StatusCode = 2665
StatusCode_SCTeamNotReleased StatusCode = 2666
StatusCode_SCTeamPermanentlyLeft StatusCode = 2667
StatusCode_SCTeamNeedRootId StatusCode = 2668
StatusCode_SCTeamHasLiveChildren StatusCode = 2669
StatusCode_SCTeamDeleteError StatusCode = 2670
StatusCode_SCTeamBadRootTeam StatusCode = 2671
StatusCode_SCTeamNameConflictsWithUser StatusCode = 2672
StatusCode_SCTeamDeleteNoUpPointer StatusCode = 2673
StatusCode_SCTeamNeedOwner StatusCode = 2674
StatusCode_SCTeamNoOwnerAllowed StatusCode = 2675
StatusCode_SCTeamImplicitNoNonSbs StatusCode = 2676
StatusCode_SCTeamImplicitBadHash StatusCode = 2677
StatusCode_SCTeamImplicitBadName StatusCode = 2678
StatusCode_SCTeamImplicitClash StatusCode = 2679
StatusCode_SCTeamImplicitDuplicate StatusCode = 2680
StatusCode_SCTeamImplicitBadOp StatusCode = 2681
StatusCode_SCTeamImplicitBadRole StatusCode = 2682
StatusCode_SCTeamImplicitNotFound StatusCode = 2683
StatusCode_SCTeamBadAdminSeqnoType StatusCode = 2684
StatusCode_SCTeamImplicitBadAdd StatusCode = 2685
StatusCode_SCTeamImplicitBadRemove StatusCode = 2686
StatusCode_SCTeamInviteTokenReused StatusCode = 2696
StatusCode_SCTeamKeyMaskNotFound StatusCode = 2697
StatusCode_SCTeamBanned StatusCode = 2702
StatusCode_SCTeamInvalidBan StatusCode = 2703
StatusCode_SCTeamShowcasePermDenied StatusCode = 2711
StatusCode_SCTeamProvisionalCanKey StatusCode = 2721
StatusCode_SCTeamProvisionalCannotKey StatusCode = 2722
StatusCode_SCTeamFTLOutdated StatusCode = 2736
StatusCode_SCTeamStorageWrongRevision StatusCode = 2760
StatusCode_SCTeamStorageBadGeneration StatusCode = 2761
StatusCode_SCTeamStorageNotFound StatusCode = 2762
StatusCode_SCTeamContactSettingsBlock StatusCode = 2763
StatusCode_SCEphemeralKeyBadGeneration StatusCode = 2900
StatusCode_SCEphemeralKeyUnexpectedBox StatusCode = 2901
StatusCode_SCEphemeralKeyMissingBox StatusCode = 2902
StatusCode_SCEphemeralKeyWrongNumberOfKeys StatusCode = 2903
StatusCode_SCEphemeralKeyMismatchedKey StatusCode = 2904
StatusCode_SCEphemeralPairwiseMACsMissingUIDs StatusCode = 2905
StatusCode_SCEphemeralDeviceAfterEK StatusCode = 2906
StatusCode_SCEphemeralMemberAfterEK StatusCode = 2907
StatusCode_SCEphemeralDeviceStale StatusCode = 2908
StatusCode_SCEphemeralUserStale StatusCode = 2909
StatusCode_SCStellarError StatusCode = 3100
StatusCode_SCStellarBadInput StatusCode = 3101
StatusCode_SCStellarWrongRevision StatusCode = 3102
StatusCode_SCStellarMissingBundle StatusCode = 3103
StatusCode_SCStellarBadPuk StatusCode = 3104
StatusCode_SCStellarMissingAccount StatusCode = 3105
StatusCode_SCStellarBadPrev StatusCode = 3106
StatusCode_SCStellarWrongPrimary StatusCode = 3107
StatusCode_SCStellarUnsupportedCurrency StatusCode = 3108
StatusCode_SCStellarNeedDisclaimer StatusCode = 3109
StatusCode_SCStellarDeviceNotMobile StatusCode = 3110
StatusCode_SCStellarMobileOnlyPurgatory StatusCode = 3111
StatusCode_SCStellarIncompatibleVersion StatusCode = 3112
StatusCode_SCNISTWrongSize StatusCode = 3201
StatusCode_SCNISTBadMode StatusCode = 3202
StatusCode_SCNISTHashWrongSize StatusCode = 3203
StatusCode_SCNISTSigWrongSize StatusCode = 3204
StatusCode_SCNISTSigBadInput StatusCode = 3205
StatusCode_SCNISTSigBadUID StatusCode = 3206
StatusCode_SCNISTSigBadDeviceID StatusCode = 3207
StatusCode_SCNISTSigBadNonce StatusCode = 3208
StatusCode_SCNISTNoSigOrHash StatusCode = 3209
StatusCode_SCNISTExpired StatusCode = 3210
StatusCode_SCNISTSigRevoked StatusCode = 3211
StatusCode_SCNISTKeyRevoked StatusCode = 3212
StatusCode_SCNISTUserDeleted StatusCode = 3213
StatusCode_SCNISTNoDevice StatusCode = 3214
StatusCode_SCNISTSigCannot_verify StatusCode = 3215
StatusCode_SCNISTReplay StatusCode = 3216
StatusCode_SCNISTSigBadLifetime StatusCode = 3217
StatusCode_SCNISTNotFound StatusCode = 3218
StatusCode_SCNISTBadClock StatusCode = 3219
StatusCode_SCNISTSigBadCtime StatusCode = 3220
StatusCode_SCBadSignupUsernameDeleted StatusCode = 3221
StatusCode_SCPhoneNumberUnknown StatusCode = 3400
StatusCode_SCPhoneNumberAlreadyVerified StatusCode = 3401
StatusCode_SCPhoneNumberVerificationCodeExpired StatusCode = 3402
StatusCode_SCPhoneNumberWrongVerificationCode StatusCode = 3403
StatusCode_SCPhoneNumberLimitExceeded StatusCode = 3404
StatusCode_SCNoPaperKeys StatusCode = 3605
StatusCode_SCTeambotKeyGenerationExists StatusCode = 3800
StatusCode_SCTeambotKeyOldBoxedGeneration StatusCode = 3801
StatusCode_SCTeambotKeyBadGeneration StatusCode = 3802
StatusCode_SCAirdropRegisterFailedMisc StatusCode = 4207
)
func (o StatusCode) DeepCopy() StatusCode { return o }
var StatusCodeMap = map[string]StatusCode{
"SCOk": 0,
"SCInputError": 100,
"SCLoginRequired": 201,
"SCBadSession": 202,
"SCBadLoginUserNotFound": 203,
"SCBadLoginPassword": 204,
"SCNotFound": 205,
"SCThrottleControl": 210,
"SCDeleted": 216,
"SCGeneric": 218,
"SCAlreadyLoggedIn": 235,
"SCExists": 230,
"SCCanceled": 237,
"SCInputCanceled": 239,
"SCBadUsername": 243,
"SCOffline": 267,
"SCReloginRequired": 274,
"SCResolutionFailed": 275,
"SCProfileNotPublic": 276,
"SCIdentifyFailed": 277,
"SCTrackingBroke": 278,
"SCWrongCryptoFormat": 279,
"SCDecryptionError": 280,
"SCInvalidAddress": 281,
"SCNoSession": 283,
"SCAccountReset": 290,
"SCIdentifiesFailed": 295,
"SCNoSpaceOnDevice": 297,
"SCMerkleClientError": 299,
"SCBadEmail": 472,
"SCRateLimit": 602,
"SCBadSignupUsernameTaken": 701,
"SCDuplicate": 706,
"SCBadInvitationCode": 707,
"SCBadSignupUsernameReserved": 710,
"SCBadSignupTeamName": 711,
"SCFeatureFlag": 712,
"SCEmailTaken": 713,
"SCEmailAlreadyAdded": 714,
"SCEmailLimitExceeded": 715,
"SCEmailCannotDeletePrimary": 716,
"SCEmailUnknown": 717,
"SCBotSignupTokenNotFound": 719,
"SCNoUpdate": 723,
"SCMissingResult": 801,
"SCKeyNotFound": 901,
"SCKeyCorrupted": 905,
"SCKeyInUse": 907,
"SCKeyBadGen": 913,
"SCKeyNoSecret": 914,
"SCKeyBadUIDs": 915,
"SCKeyNoActive": 916,
"SCKeyNoSig": 917,
"SCKeyBadSig": 918,
"SCKeyBadEldest": 919,
"SCKeyNoEldest": 920,
"SCKeyDuplicateUpdate": 921,
"SCSibkeyAlreadyExists": 922,
"SCDecryptionKeyNotFound": 924,
"SCKeyNoPGPEncryption": 927,
"SCKeyNoNaClEncryption": 928,
"SCKeySyncedPGPNotFound": 929,
"SCKeyNoMatchingGPG": 930,
"SCKeyRevoked": 931,
"SCSigCannotVerify": 1002,
"SCSigWrongKey": 1008,
"SCSigOldSeqno": 1010,
"SCSigCreationDisallowed": 1016,
"SCSigMissingRatchet": 1021,
"SCSigBadTotalOrder": 1022,
"SCBadTrackSession": 1301,
"SCDeviceBadName": 1404,
"SCDeviceBadStatus": 1405,
"SCDeviceNameInUse": 1408,
"SCDeviceNotFound": 1409,
"SCDeviceMismatch": 1410,
"SCDeviceRequired": 1411,
"SCDevicePrevProvisioned": 1413,
"SCDeviceNoProvision": 1414,
"SCDeviceProvisionViaDevice": 1415,
"SCRevokeCurrentDevice": 1416,
"SCRevokeLastDevice": 1417,
"SCDeviceProvisionOffline": 1418,
"SCRevokeLastDevicePGP": 1419,
"SCStreamExists": 1501,
"SCStreamNotFound": 1502,
"SCStreamWrongKind": 1503,
"SCStreamEOF": 1504,
"SCStreamUnknown": 1505,
"SCGenericAPIError": 1600,
"SCAPINetworkError": 1601,
"SCTimeout": 1602,
"SCProofError": 1701,
"SCIdentificationExpired": 1702,
"SCSelfNotFound": 1703,
"SCBadKexPhrase": 1704,
"SCNoUIDelegation": 1705,
"SCNoUI": 1706,
"SCGPGUnavailable": 1707,
"SCInvalidVersionError": 1800,
"SCOldVersionError": 1801,
"SCInvalidLocationError": 1802,
"SCServiceStatusError": 1803,
"SCInstallError": 1804,
"SCLoadKextError": 1810,
"SCLoadKextPermError": 1811,
"SCGitInternal": 2300,
"SCGitRepoAlreadyExists": 2301,
"SCGitInvalidRepoName": 2302,
"SCGitCannotDelete": 2303,
"SCGitRepoDoesntExist": 2304,
"SCLoginStateTimeout": 2400,
"SCChatInternal": 2500,
"SCChatRateLimit": 2501,
"SCChatConvExists": 2502,
"SCChatUnknownTLFID": 2503,
"SCChatNotInConv": 2504,
"SCChatBadMsg": 2505,
"SCChatBroadcast": 2506,
"SCChatAlreadySuperseded": 2507,
"SCChatAlreadyDeleted": 2508,
"SCChatTLFFinalized": 2509,
"SCChatCollision": 2510,
"SCIdentifySummaryError": 2511,
"SCNeedSelfRekey": 2512,
"SCNeedOtherRekey": 2513,
"SCChatMessageCollision": 2514,
"SCChatDuplicateMessage": 2515,
"SCChatClientError": 2516,
"SCChatNotInTeam": 2517,
"SCChatStalePreviousState": 2518,
"SCChatEphemeralRetentionPolicyViolatedError": 2519,
"SCTeamBadMembership": 2604,
"SCTeamSelfNotOwner": 2607,
"SCTeamNotFound": 2614,
"SCTeamExists": 2619,
"SCTeamReadError": 2623,
"SCTeamWritePermDenied": 2625,
"SCTeamBadGeneration": 2634,
"SCNoOp": 2638,
"SCTeamInviteBadCancel": 2645,
"SCTeamInviteBadToken": 2646,
"SCTeamTarDuplicate": 2663,
"SCTeamTarNotFound": 2664,
"SCTeamMemberExists": 2665,
"SCTeamNotReleased": 2666,
"SCTeamPermanentlyLeft": 2667,
"SCTeamNeedRootId": 2668,
"SCTeamHasLiveChildren": 2669,
"SCTeamDeleteError": 2670,
"SCTeamBadRootTeam": 2671,
"SCTeamNameConflictsWithUser": 2672,
"SCTeamDeleteNoUpPointer": 2673,
"SCTeamNeedOwner": 2674,
"SCTeamNoOwnerAllowed": 2675,
"SCTeamImplicitNoNonSbs": 2676,
"SCTeamImplicitBadHash": 2677,
"SCTeamImplicitBadName": 2678,
"SCTeamImplicitClash": 2679,
"SCTeamImplicitDuplicate": 2680,
"SCTeamImplicitBadOp": 2681,
"SCTeamImplicitBadRole": 2682,
"SCTeamImplicitNotFound": 2683,
"SCTeamBadAdminSeqnoType": 2684,
"SCTeamImplicitBadAdd": 2685,
"SCTeamImplicitBadRemove": 2686,
"SCTeamInviteTokenReused": 2696,
"SCTeamKeyMaskNotFound": 2697,
"SCTeamBanned": 2702,
"SCTeamInvalidBan": 2703,
"SCTeamShowcasePermDenied": 2711,
"SCTeamProvisionalCanKey": 2721,
"SCTeamProvisionalCannotKey": 2722,
"SCTeamFTLOutdated": 2736,
"SCTeamStorageWrongRevision": 2760,
"SCTeamStorageBadGeneration": 2761,
"SCTeamStorageNotFound": 2762,
"SCTeamContactSettingsBlock": 2763,
"SCEphemeralKeyBadGeneration": 2900,
"SCEphemeralKeyUnexpectedBox": 2901,
"SCEphemeralKeyMissingBox": 2902,
"SCEphemeralKeyWrongNumberOfKeys": 2903,
"SCEphemeralKeyMismatchedKey": 2904,
"SCEphemeralPairwiseMACsMissingUIDs": 2905,
"SCEphemeralDeviceAfterEK": 2906,
"SCEphemeralMemberAfterEK": 2907,
"SCEphemeralDeviceStale": 2908,
"SCEphemeralUserStale": 2909,
"SCStellarError": 3100,
"SCStellarBadInput": 3101,
"SCStellarWrongRevision": 3102,
"SCStellarMissingBundle": 3103,
"SCStellarBadPuk": 3104,
"SCStellarMissingAccount": 3105,
"SCStellarBadPrev": 3106,
"SCStellarWrongPrimary": 3107,
"SCStellarUnsupportedCurrency": 3108,
"SCStellarNeedDisclaimer": 3109,
"SCStellarDeviceNotMobile": 3110,
"SCStellarMobileOnlyPurgatory": 3111,
"SCStellarIncompatibleVersion": 3112,
"SCNISTWrongSize": 3201,
"SCNISTBadMode": 3202,
"SCNISTHashWrongSize": 3203,
"SCNISTSigWrongSize": 3204,
"SCNISTSigBadInput": 3205,
"SCNISTSigBadUID": 3206,
"SCNISTSigBadDeviceID": 3207,
"SCNISTSigBadNonce": 3208,
"SCNISTNoSigOrHash": 3209,
"SCNISTExpired": 3210,
"SCNISTSigRevoked": 3211,
"SCNISTKeyRevoked": 3212,
"SCNISTUserDeleted": 3213,
"SCNISTNoDevice": 3214,
"SCNISTSigCannot_verify": 3215,
"SCNISTReplay": 3216,
"SCNISTSigBadLifetime": 3217,
"SCNISTNotFound": 3218,
"SCNISTBadClock": 3219,
"SCNISTSigBadCtime": 3220,
"SCBadSignupUsernameDeleted": 3221,
"SCPhoneNumberUnknown": 3400,
"SCPhoneNumberAlreadyVerified": 3401,
"SCPhoneNumberVerificationCodeExpired": 3402,
"SCPhoneNumberWrongVerificationCode": 3403,
"SCPhoneNumberLimitExceeded": 3404,
"SCNoPaperKeys": 3605,
"SCTeambotKeyGenerationExists": 3800,
"SCTeambotKeyOldBoxedGeneration": 3801,
"SCTeambotKeyBadGeneration": 3802,
"SCAirdropRegisterFailedMisc": 4207,
}
var StatusCodeRevMap = map[StatusCode]string{
0: "SCOk",
100: "SCInputError",
201: "SCLoginRequired",
202: "SCBadSession",
203: "SCBadLoginUserNotFound",
204: "SCBadLoginPassword",
205: "SCNotFound",
210: "SCThrottleControl",
216: "SCDeleted",
218: "SCGeneric",
235: "SCAlreadyLoggedIn",
230: "SCExists",
237: "SCCanceled",
239: "SCInputCanceled",
243: "SCBadUsername",
267: "SCOffline",
274: "SCReloginRequired",
275: "SCResolutionFailed",
276: "SCProfileNotPublic",
277: "SCIdentifyFailed",
278: "SCTrackingBroke",
279: "SCWrongCryptoFormat",
280: "SCDecryptionError",
281: "SCInvalidAddress",
283: "SCNoSession",
290: "SCAccountReset",
295: "SCIdentifiesFailed",
297: "SCNoSpaceOnDevice",
299: "SCMerkleClientError",
472: "SCBadEmail",
602: "SCRateLimit",
701: "SCBadSignupUsernameTaken",
706: "SCDuplicate",
707: "SCBadInvitationCode",
710: "SCBadSignupUsernameReserved",
711: "SCBadSignupTeamName",
712: "SCFeatureFlag",
713: "SCEmailTaken",
714: "SCEmailAlreadyAdded",
715: "SCEmailLimitExceeded",
716: "SCEmailCannotDeletePrimary",
717: "SCEmailUnknown",
719: "SCBotSignupTokenNotFound",
723: "SCNoUpdate",
801: "SCMissingResult",
901: "SCKeyNotFound",
905: "SCKeyCorrupted",
907: "SCKeyInUse",
913: "SCKeyBadGen",
914: "SCKeyNoSecret",
915: "SCKeyBadUIDs",
916: "SCKeyNoActive",
917: "SCKeyNoSig",
918: "SCKeyBadSig",
919: "SCKeyBadEldest",
920: "SCKeyNoEldest",
921: "SCKeyDuplicateUpdate",
922: "SCSibkeyAlreadyExists",
924: "SCDecryptionKeyNotFound",
927: "SCKeyNoPGPEncryption",
928: "SCKeyNoNaClEncryption",
929: "SCKeySyncedPGPNotFound",
930: "SCKeyNoMatchingGPG",
931: "SCKeyRevoked",
1002: "SCSigCannotVerify",
1008: "SCSigWrongKey",
1010: "SCSigOldSeqno",
1016: "SCSigCreationDisallowed",
1021: "SCSigMissingRatchet",
1022: "SCSigBadTotalOrder",
1301: "SCBadTrackSession",
1404: "SCDeviceBadName",
1405: "SCDeviceBadStatus",
1408: "SCDeviceNameInUse",
1409: "SCDeviceNotFound",
1410: "SCDeviceMismatch",
1411: "SCDeviceRequired",
1413: "SCDevicePrevProvisioned",
1414: "SCDeviceNoProvision",
1415: "SCDeviceProvisionViaDevice",
1416: "SCRevokeCurrentDevice",
1417: "SCRevokeLastDevice",
1418: "SCDeviceProvisionOffline",
1419: "SCRevokeLastDevicePGP",
1501: "SCStreamExists",
1502: "SCStreamNotFound",
1503: "SCStreamWrongKind",
1504: "SCStreamEOF",
1505: "SCStreamUnknown",
1600: "SCGenericAPIError",
1601: "SCAPINetworkError",
1602: "SCTimeout",
1701: "SCProofError",
1702: "SCIdentificationExpired",
1703: "SCSelfNotFound",
1704: "SCBadKexPhrase",
1705: "SCNoUIDelegation",
1706: "SCNoUI",
1707: "SCGPGUnavailable",
1800: "SCInvalidVersionError",
1801: "SCOldVersionError",
1802: "SCInvalidLocationError",
1803: "SCServiceStatusError",
1804: "SCInstallError",
1810: "SCLoadKextError",
1811: "SCLoadKextPermError",
2300: "SCGitInternal",
2301: "SCGitRepoAlreadyExists",
2302: "SCGitInvalidRepoName",
2303: "SCGitCannotDelete",
2304: "SCGitRepoDoesntExist",
2400: "SCLoginStateTimeout",
2500: "SCChatInternal",
2501: "SCChatRateLimit",
2502: "SCChatConvExists",
2503: "SCChatUnknownTLFID",
2504: "SCChatNotInConv",
2505: "SCChatBadMsg",
2506: "SCChatBroadcast",
2507: "SCChatAlreadySuperseded",
2508: "SCChatAlreadyDeleted",
2509: "SCChatTLFFinalized",
2510: "SCChatCollision",
2511: "SCIdentifySummaryError",
2512: "SCNeedSelfRekey",
2513: "SCNeedOtherRekey",
2514: "SCChatMessageCollision",
2515: "SCChatDuplicateMessage",
2516: "SCChatClientError",
2517: "SCChatNotInTeam",
2518: "SCChatStalePreviousState",
2519: "SCChatEphemeralRetentionPolicyViolatedError",
2604: "SCTeamBadMembership",
2607: "SCTeamSelfNotOwner",
2614: "SCTeamNotFound",
2619: "SCTeamExists",
2623: "SCTeamReadError",
2625: "SCTeamWritePermDenied",
2634: "SCTeamBadGeneration",
2638: "SCNoOp",
2645: "SCTeamInviteBadCancel",
2646: "SCTeamInviteBadToken",
2663: "SCTeamTarDuplicate",
2664: "SCTeamTarNotFound",
2665: "SCTeamMemberExists",
2666: "SCTeamNotReleased",
2667: "SCTeamPermanentlyLeft",
2668: "SCTeamNeedRootId",
2669: "SCTeamHasLiveChildren",
2670: "SCTeamDeleteError",
2671: "SCTeamBadRootTeam",
2672: "SCTeamNameConflictsWithUser",
2673: "SCTeamDeleteNoUpPointer",
2674: "SCTeamNeedOwner",
2675: "SCTeamNoOwnerAllowed",
2676: "SCTeamImplicitNoNonSbs",
2677: "SCTeamImplicitBadHash",
2678: "SCTeamImplicitBadName",
2679: "SCTeamImplicitClash",
2680: "SCTeamImplicitDuplicate",
2681: "SCTeamImplicitBadOp",
2682: "SCTeamImplicitBadRole",
2683: "SCTeamImplicitNotFound",
2684: "SCTeamBadAdminSeqnoType",
2685: "SCTeamImplicitBadAdd",
2686: "SCTeamImplicitBadRemove",
2696: "SCTeamInviteTokenReused",
2697: "SCTeamKeyMaskNotFound",
2702: "SCTeamBanned",
2703: "SCTeamInvalidBan",
2711: "SCTeamShowcasePermDenied",
2721: "SCTeamProvisionalCanKey",
2722: "SCTeamProvisionalCannotKey",
2736: "SCTeamFTLOutdated",
2760: "SCTeamStorageWrongRevision",
2761: "SCTeamStorageBadGeneration",
2762: "SCTeamStorageNotFound",
2763: "SCTeamContactSettingsBlock",
2900: "SCEphemeralKeyBadGeneration",
2901: "SCEphemeralKeyUnexpectedBox",
2902: "SCEphemeralKeyMissingBox",
2903: "SCEphemeralKeyWrongNumberOfKeys",
2904: "SCEphemeralKeyMismatchedKey",
2905: "SCEphemeralPairwiseMACsMissingUIDs",
2906: "SCEphemeralDeviceAfterEK",
2907: "SCEphemeralMemberAfterEK",
2908: "SCEphemeralDeviceStale",
2909: "SCEphemeralUserStale",
3100: "SCStellarError",
3101: "SCStellarBadInput",
3102: "SCStellarWrongRevision",
3103: "SCStellarMissingBundle",
3104: "SCStellarBadPuk",
3105: "SCStellarMissingAccount",
3106: "SCStellarBadPrev",
3107: "SCStellarWrongPrimary",
3108: "SCStellarUnsupportedCurrency",
3109: "SCStellarNeedDisclaimer",
3110: "SCStellarDeviceNotMobile",
3111: "SCStellarMobileOnlyPurgatory",
3112: "SCStellarIncompatibleVersion",
3201: "SCNISTWrongSize",
3202: "SCNISTBadMode",
3203: "SCNISTHashWrongSize",
3204: "SCNISTSigWrongSize",
3205: "SCNISTSigBadInput",
3206: "SCNISTSigBadUID",
3207: "SCNISTSigBadDeviceID",
3208: "SCNISTSigBadNonce",
3209: "SCNISTNoSigOrHash",
3210: "SCNISTExpired",
3211: "SCNISTSigRevoked",
3212: "SCNISTKeyRevoked",
3213: "SCNISTUserDeleted",
3214: "SCNISTNoDevice",
3215: "SCNISTSigCannot_verify",
3216: "SCNISTReplay",
3217: "SCNISTSigBadLifetime",
3218: "SCNISTNotFound",
3219: "SCNISTBadClock",
3220: "SCNISTSigBadCtime",
3221: "SCBadSignupUsernameDeleted",
3400: "SCPhoneNumberUnknown",
3401: "SCPhoneNumberAlreadyVerified",
3402: "SCPhoneNumberVerificationCodeExpired",
3403: "SCPhoneNumberWrongVerificationCode",
3404: "SCPhoneNumberLimitExceeded",
3605: "SCNoPaperKeys",
3800: "SCTeambotKeyGenerationExists",
3801: "SCTeambotKeyOldBoxedGeneration",
3802: "SCTeambotKeyBadGeneration",
4207: "SCAirdropRegisterFailedMisc",
}
func (e StatusCode) String() string {
if v, ok := StatusCodeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}

View File

@ -0,0 +1,127 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/contacts.avdl
package keybase1
type ContactComponent struct {
Label string `codec:"label" json:"label"`
PhoneNumber *RawPhoneNumber `codec:"phoneNumber,omitempty" json:"phoneNumber,omitempty"`
Email *EmailAddress `codec:"email,omitempty" json:"email,omitempty"`
}
func (o ContactComponent) DeepCopy() ContactComponent {
return ContactComponent{
Label: o.Label,
PhoneNumber: (func(x *RawPhoneNumber) *RawPhoneNumber {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.PhoneNumber),
Email: (func(x *EmailAddress) *EmailAddress {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Email),
}
}
type Contact struct {
Name string `codec:"name" json:"name"`
Components []ContactComponent `codec:"components" json:"components"`
}
func (o Contact) DeepCopy() Contact {
return Contact{
Name: o.Name,
Components: (func(x []ContactComponent) []ContactComponent {
if x == nil {
return nil
}
ret := make([]ContactComponent, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Components),
}
}
type ProcessedContact struct {
ContactIndex int `codec:"contactIndex" json:"contactIndex"`
ContactName string `codec:"contactName" json:"contactName"`
Component ContactComponent `codec:"component" json:"component"`
Resolved bool `codec:"resolved" json:"resolved"`
Uid UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`
FullName string `codec:"fullName" json:"fullName"`
Following bool `codec:"following" json:"following"`
ServiceMap map[string]string `codec:"serviceMap" json:"serviceMap"`
Assertion string `codec:"assertion" json:"assertion"`
DisplayName string `codec:"displayName" json:"displayName"`
DisplayLabel string `codec:"displayLabel" json:"displayLabel"`
}
func (o ProcessedContact) DeepCopy() ProcessedContact {
return ProcessedContact{
ContactIndex: o.ContactIndex,
ContactName: o.ContactName,
Component: o.Component.DeepCopy(),
Resolved: o.Resolved,
Uid: o.Uid.DeepCopy(),
Username: o.Username,
FullName: o.FullName,
Following: o.Following,
ServiceMap: (func(x map[string]string) map[string]string {
if x == nil {
return nil
}
ret := make(map[string]string, len(x))
for k, v := range x {
kCopy := k
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.ServiceMap),
Assertion: o.Assertion,
DisplayName: o.DisplayName,
DisplayLabel: o.DisplayLabel,
}
}
type ContactListResolutionResult struct {
NewlyResolved []ProcessedContact `codec:"newlyResolved" json:"newlyResolved"`
Resolved []ProcessedContact `codec:"resolved" json:"resolved"`
}
func (o ContactListResolutionResult) DeepCopy() ContactListResolutionResult {
return ContactListResolutionResult{
NewlyResolved: (func(x []ProcessedContact) []ProcessedContact {
if x == nil {
return nil
}
ret := make([]ProcessedContact, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.NewlyResolved),
Resolved: (func(x []ProcessedContact) []ProcessedContact {
if x == nil {
return nil
}
ret := make([]ProcessedContact, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Resolved),
}
}

View File

@ -0,0 +1,86 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/crypto.avdl
package keybase1
type ED25519PublicKey [32]byte
func (o ED25519PublicKey) DeepCopy() ED25519PublicKey {
var ret ED25519PublicKey
copy(ret[:], o[:])
return ret
}
type ED25519Signature [64]byte
func (o ED25519Signature) DeepCopy() ED25519Signature {
var ret ED25519Signature
copy(ret[:], o[:])
return ret
}
type ED25519SignatureInfo struct {
Sig ED25519Signature `codec:"sig" json:"sig"`
PublicKey ED25519PublicKey `codec:"publicKey" json:"publicKey"`
}
func (o ED25519SignatureInfo) DeepCopy() ED25519SignatureInfo {
return ED25519SignatureInfo{
Sig: o.Sig.DeepCopy(),
PublicKey: o.PublicKey.DeepCopy(),
}
}
type EncryptedBytes32 [48]byte
func (o EncryptedBytes32) DeepCopy() EncryptedBytes32 {
var ret EncryptedBytes32
copy(ret[:], o[:])
return ret
}
type BoxNonce [24]byte
func (o BoxNonce) DeepCopy() BoxNonce {
var ret BoxNonce
copy(ret[:], o[:])
return ret
}
type BoxPublicKey [32]byte
func (o BoxPublicKey) DeepCopy() BoxPublicKey {
var ret BoxPublicKey
copy(ret[:], o[:])
return ret
}
type CiphertextBundle struct {
Kid KID `codec:"kid" json:"kid"`
Ciphertext EncryptedBytes32 `codec:"ciphertext" json:"ciphertext"`
Nonce BoxNonce `codec:"nonce" json:"nonce"`
PublicKey BoxPublicKey `codec:"publicKey" json:"publicKey"`
}
func (o CiphertextBundle) DeepCopy() CiphertextBundle {
return CiphertextBundle{
Kid: o.Kid.DeepCopy(),
Ciphertext: o.Ciphertext.DeepCopy(),
Nonce: o.Nonce.DeepCopy(),
PublicKey: o.PublicKey.DeepCopy(),
}
}
type UnboxAnyRes struct {
Kid KID `codec:"kid" json:"kid"`
Plaintext Bytes32 `codec:"plaintext" json:"plaintext"`
Index int `codec:"index" json:"index"`
}
func (o UnboxAnyRes) DeepCopy() UnboxAnyRes {
return UnboxAnyRes{
Kid: o.Kid.DeepCopy(),
Plaintext: o.Plaintext.DeepCopy(),
Index: o.Index,
}
}

View File

@ -0,0 +1,16 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/cryptocurrency.avdl
package keybase1
type RegisterAddressRes struct {
Type string `codec:"type" json:"type"`
Family string `codec:"family" json:"family"`
}
func (o RegisterAddressRes) DeepCopy() RegisterAddressRes {
return RegisterAddressRes{
Type: o.Type,
Family: o.Family,
}
}

View File

@ -0,0 +1,129 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/ctl.avdl
package keybase1
import (
"fmt"
)
type ExitCode int
const (
ExitCode_OK ExitCode = 0
ExitCode_NOTOK ExitCode = 2
ExitCode_RESTART ExitCode = 4
)
func (o ExitCode) DeepCopy() ExitCode { return o }
var ExitCodeMap = map[string]ExitCode{
"OK": 0,
"NOTOK": 2,
"RESTART": 4,
}
var ExitCodeRevMap = map[ExitCode]string{
0: "OK",
2: "NOTOK",
4: "RESTART",
}
func (e ExitCode) String() string {
if v, ok := ExitCodeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type DbType int
const (
DbType_MAIN DbType = 0
DbType_CHAT DbType = 1
DbType_FS_BLOCK_CACHE DbType = 2
DbType_FS_BLOCK_CACHE_META DbType = 3
DbType_FS_SYNC_BLOCK_CACHE DbType = 4
DbType_FS_SYNC_BLOCK_CACHE_META DbType = 5
)
func (o DbType) DeepCopy() DbType { return o }
var DbTypeMap = map[string]DbType{
"MAIN": 0,
"CHAT": 1,
"FS_BLOCK_CACHE": 2,
"FS_BLOCK_CACHE_META": 3,
"FS_SYNC_BLOCK_CACHE": 4,
"FS_SYNC_BLOCK_CACHE_META": 5,
}
var DbTypeRevMap = map[DbType]string{
0: "MAIN",
1: "CHAT",
2: "FS_BLOCK_CACHE",
3: "FS_BLOCK_CACHE_META",
4: "FS_SYNC_BLOCK_CACHE",
5: "FS_SYNC_BLOCK_CACHE_META",
}
func (e DbType) String() string {
if v, ok := DbTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type DbKey struct {
DbType DbType `codec:"dbType" json:"dbType"`
ObjType int `codec:"objType" json:"objType"`
Key string `codec:"key" json:"key"`
}
func (o DbKey) DeepCopy() DbKey {
return DbKey{
DbType: o.DbType.DeepCopy(),
ObjType: o.ObjType,
Key: o.Key,
}
}
type DbValue []byte
func (o DbValue) DeepCopy() DbValue {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type OnLoginStartupStatus int
const (
OnLoginStartupStatus_UNKNOWN OnLoginStartupStatus = 0
OnLoginStartupStatus_DISABLED OnLoginStartupStatus = 1
OnLoginStartupStatus_ENABLED OnLoginStartupStatus = 2
)
func (o OnLoginStartupStatus) DeepCopy() OnLoginStartupStatus { return o }
var OnLoginStartupStatusMap = map[string]OnLoginStartupStatus{
"UNKNOWN": 0,
"DISABLED": 1,
"ENABLED": 2,
}
var OnLoginStartupStatusRevMap = map[OnLoginStartupStatus]string{
0: "UNKNOWN",
1: "DISABLED",
2: "ENABLED",
}
func (e OnLoginStartupStatus) String() string {
if v, ok := OnLoginStartupStatusRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}

View File

@ -0,0 +1,14 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/debugging.avdl
package keybase1
type FirstStepResult struct {
ValPlusTwo int `codec:"valPlusTwo" json:"valPlusTwo"`
}
func (o FirstStepResult) DeepCopy() FirstStepResult {
return FirstStepResult{
ValPlusTwo: o.ValPlusTwo,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/delegate_ui_ctl.avdl
package keybase1

View File

@ -0,0 +1,52 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/device.avdl
package keybase1
type DeviceDetail struct {
Device Device `codec:"device" json:"device"`
Eldest bool `codec:"eldest" json:"eldest"`
Provisioner *Device `codec:"provisioner,omitempty" json:"provisioner,omitempty"`
ProvisionedAt *Time `codec:"provisionedAt,omitempty" json:"provisionedAt,omitempty"`
RevokedAt *Time `codec:"revokedAt,omitempty" json:"revokedAt,omitempty"`
RevokedBy KID `codec:"revokedBy" json:"revokedBy"`
RevokedByDevice *Device `codec:"revokedByDevice,omitempty" json:"revokedByDevice,omitempty"`
CurrentDevice bool `codec:"currentDevice" json:"currentDevice"`
}
func (o DeviceDetail) DeepCopy() DeviceDetail {
return DeviceDetail{
Device: o.Device.DeepCopy(),
Eldest: o.Eldest,
Provisioner: (func(x *Device) *Device {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Provisioner),
ProvisionedAt: (func(x *Time) *Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ProvisionedAt),
RevokedAt: (func(x *Time) *Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.RevokedAt),
RevokedBy: o.RevokedBy.DeepCopy(),
RevokedByDevice: (func(x *Device) *Device {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.RevokedByDevice),
CurrentDevice: o.CurrentDevice,
}
}

View File

@ -0,0 +1,42 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/emails.avdl
package keybase1
type EmailLookupResult struct {
Email EmailAddress `codec:"email" json:"email"`
Uid *UID `codec:"uid,omitempty" json:"uid,omitempty"`
}
func (o EmailLookupResult) DeepCopy() EmailLookupResult {
return EmailLookupResult{
Email: o.Email.DeepCopy(),
Uid: (func(x *UID) *UID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Uid),
}
}
type EmailAddressVerifiedMsg struct {
Email EmailAddress `codec:"email" json:"email"`
}
func (o EmailAddressVerifiedMsg) DeepCopy() EmailAddressVerifiedMsg {
return EmailAddressVerifiedMsg{
Email: o.Email.DeepCopy(),
}
}
type EmailAddressChangedMsg struct {
Email EmailAddress `codec:"email" json:"email"`
}
func (o EmailAddressChangedMsg) DeepCopy() EmailAddressChangedMsg {
return EmailAddressChangedMsg{
Email: o.Email.DeepCopy(),
}
}

View File

@ -0,0 +1,423 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/ephemeral.avdl
package keybase1
import (
"errors"
"fmt"
)
type EkGeneration int64
func (o EkGeneration) DeepCopy() EkGeneration {
return o
}
type DeviceEkMetadata struct {
Kid KID `codec:"kid" json:"device_ephemeral_dh_public"`
HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"`
Generation EkGeneration `codec:"generation" json:"generation"`
Ctime Time `codec:"ctime" json:"ctime"`
DeviceCtime Time `codec:"deviceCtime" json:"deviceCtime"`
}
func (o DeviceEkMetadata) DeepCopy() DeviceEkMetadata {
return DeviceEkMetadata{
Kid: o.Kid.DeepCopy(),
HashMeta: o.HashMeta.DeepCopy(),
Generation: o.Generation.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
DeviceCtime: o.DeviceCtime.DeepCopy(),
}
}
type DeviceEkStatement struct {
CurrentDeviceEkMetadata DeviceEkMetadata `codec:"currentDeviceEkMetadata" json:"current_device_ek_metadata"`
}
func (o DeviceEkStatement) DeepCopy() DeviceEkStatement {
return DeviceEkStatement{
CurrentDeviceEkMetadata: o.CurrentDeviceEkMetadata.DeepCopy(),
}
}
type DeviceEk struct {
Seed Bytes32 `codec:"seed" json:"seed"`
Metadata DeviceEkMetadata `codec:"metadata" json:"metadata"`
}
func (o DeviceEk) DeepCopy() DeviceEk {
return DeviceEk{
Seed: o.Seed.DeepCopy(),
Metadata: o.Metadata.DeepCopy(),
}
}
type UserEkStatement struct {
CurrentUserEkMetadata UserEkMetadata `codec:"currentUserEkMetadata" json:"current_user_ek_metadata"`
}
func (o UserEkStatement) DeepCopy() UserEkStatement {
return UserEkStatement{
CurrentUserEkMetadata: o.CurrentUserEkMetadata.DeepCopy(),
}
}
type UserEkMetadata struct {
Kid KID `codec:"kid" json:"user_ephemeral_dh_public"`
HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"`
Generation EkGeneration `codec:"generation" json:"generation"`
Ctime Time `codec:"ctime" json:"ctime"`
}
func (o UserEkMetadata) DeepCopy() UserEkMetadata {
return UserEkMetadata{
Kid: o.Kid.DeepCopy(),
HashMeta: o.HashMeta.DeepCopy(),
Generation: o.Generation.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
}
}
type UserEkBoxed struct {
Box string `codec:"box" json:"box"`
DeviceEkGeneration EkGeneration `codec:"deviceEkGeneration" json:"device_ek_generation"`
Metadata UserEkMetadata `codec:"metadata" json:"metadata"`
}
func (o UserEkBoxed) DeepCopy() UserEkBoxed {
return UserEkBoxed{
Box: o.Box,
DeviceEkGeneration: o.DeviceEkGeneration.DeepCopy(),
Metadata: o.Metadata.DeepCopy(),
}
}
type UserEkBoxMetadata struct {
Box string `codec:"box" json:"box"`
RecipientGeneration EkGeneration `codec:"recipientGeneration" json:"recipient_generation"`
RecipientDeviceID DeviceID `codec:"recipientDeviceID" json:"recipient_device_id"`
}
func (o UserEkBoxMetadata) DeepCopy() UserEkBoxMetadata {
return UserEkBoxMetadata{
Box: o.Box,
RecipientGeneration: o.RecipientGeneration.DeepCopy(),
RecipientDeviceID: o.RecipientDeviceID.DeepCopy(),
}
}
type UserEk struct {
Seed Bytes32 `codec:"seed" json:"seed"`
Metadata UserEkMetadata `codec:"metadata" json:"metadata"`
}
func (o UserEk) DeepCopy() UserEk {
return UserEk{
Seed: o.Seed.DeepCopy(),
Metadata: o.Metadata.DeepCopy(),
}
}
type UserEkReboxArg struct {
UserEkBoxMetadata UserEkBoxMetadata `codec:"userEkBoxMetadata" json:"userEkBoxMetadata"`
DeviceID DeviceID `codec:"deviceID" json:"deviceID"`
DeviceEkStatementSig string `codec:"deviceEkStatementSig" json:"deviceEkStatementSig"`
}
func (o UserEkReboxArg) DeepCopy() UserEkReboxArg {
return UserEkReboxArg{
UserEkBoxMetadata: o.UserEkBoxMetadata.DeepCopy(),
DeviceID: o.DeviceID.DeepCopy(),
DeviceEkStatementSig: o.DeviceEkStatementSig,
}
}
type TeamEkMetadata struct {
Kid KID `codec:"kid" json:"team_ephemeral_dh_public"`
HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"`
Generation EkGeneration `codec:"generation" json:"generation"`
Ctime Time `codec:"ctime" json:"ctime"`
}
func (o TeamEkMetadata) DeepCopy() TeamEkMetadata {
return TeamEkMetadata{
Kid: o.Kid.DeepCopy(),
HashMeta: o.HashMeta.DeepCopy(),
Generation: o.Generation.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
}
}
type TeamEkStatement struct {
CurrentTeamEkMetadata TeamEkMetadata `codec:"currentTeamEkMetadata" json:"current_team_ek_metadata"`
}
func (o TeamEkStatement) DeepCopy() TeamEkStatement {
return TeamEkStatement{
CurrentTeamEkMetadata: o.CurrentTeamEkMetadata.DeepCopy(),
}
}
type TeamEkBoxed struct {
Box string `codec:"box" json:"box"`
UserEkGeneration EkGeneration `codec:"userEkGeneration" json:"user_ek_generation"`
Metadata TeamEkMetadata `codec:"metadata" json:"metadata"`
}
func (o TeamEkBoxed) DeepCopy() TeamEkBoxed {
return TeamEkBoxed{
Box: o.Box,
UserEkGeneration: o.UserEkGeneration.DeepCopy(),
Metadata: o.Metadata.DeepCopy(),
}
}
type TeamEkBoxMetadata struct {
Box string `codec:"box" json:"box"`
RecipientGeneration EkGeneration `codec:"recipientGeneration" json:"recipient_generation"`
RecipientUID UID `codec:"recipientUID" json:"recipient_uid"`
}
func (o TeamEkBoxMetadata) DeepCopy() TeamEkBoxMetadata {
return TeamEkBoxMetadata{
Box: o.Box,
RecipientGeneration: o.RecipientGeneration.DeepCopy(),
RecipientUID: o.RecipientUID.DeepCopy(),
}
}
type TeamEk struct {
Seed Bytes32 `codec:"seed" json:"seed"`
Metadata TeamEkMetadata `codec:"metadata" json:"metadata"`
}
func (o TeamEk) DeepCopy() TeamEk {
return TeamEk{
Seed: o.Seed.DeepCopy(),
Metadata: o.Metadata.DeepCopy(),
}
}
type TeambotEkMetadata struct {
Kid KID `codec:"kid" json:"teambot_dh_public"`
Generation EkGeneration `codec:"generation" json:"generation"`
Uid UID `codec:"uid" json:"uid"`
UserEkGeneration EkGeneration `codec:"userEkGeneration" json:"user_ek_generation"`
HashMeta HashMeta `codec:"hashMeta" json:"hash_meta"`
Ctime Time `codec:"ctime" json:"ctime"`
}
func (o TeambotEkMetadata) DeepCopy() TeambotEkMetadata {
return TeambotEkMetadata{
Kid: o.Kid.DeepCopy(),
Generation: o.Generation.DeepCopy(),
Uid: o.Uid.DeepCopy(),
UserEkGeneration: o.UserEkGeneration.DeepCopy(),
HashMeta: o.HashMeta.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
}
}
type TeambotEkBoxed struct {
Box string `codec:"box" json:"box"`
Metadata TeambotEkMetadata `codec:"metadata" json:"metadata"`
}
func (o TeambotEkBoxed) DeepCopy() TeambotEkBoxed {
return TeambotEkBoxed{
Box: o.Box,
Metadata: o.Metadata.DeepCopy(),
}
}
type TeambotEk struct {
Seed Bytes32 `codec:"seed" json:"seed"`
Metadata TeambotEkMetadata `codec:"metadata" json:"metadata"`
}
func (o TeambotEk) DeepCopy() TeambotEk {
return TeambotEk{
Seed: o.Seed.DeepCopy(),
Metadata: o.Metadata.DeepCopy(),
}
}
type TeamEphemeralKeyType int
const (
TeamEphemeralKeyType_TEAM TeamEphemeralKeyType = 0
TeamEphemeralKeyType_TEAMBOT TeamEphemeralKeyType = 1
)
func (o TeamEphemeralKeyType) DeepCopy() TeamEphemeralKeyType { return o }
var TeamEphemeralKeyTypeMap = map[string]TeamEphemeralKeyType{
"TEAM": 0,
"TEAMBOT": 1,
}
var TeamEphemeralKeyTypeRevMap = map[TeamEphemeralKeyType]string{
0: "TEAM",
1: "TEAMBOT",
}
func (e TeamEphemeralKeyType) String() string {
if v, ok := TeamEphemeralKeyTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type TeamEphemeralKey struct {
KeyType__ TeamEphemeralKeyType `codec:"keyType" json:"keyType"`
Team__ *TeamEk `codec:"team,omitempty" json:"team,omitempty"`
Teambot__ *TeambotEk `codec:"teambot,omitempty" json:"teambot,omitempty"`
}
func (o *TeamEphemeralKey) KeyType() (ret TeamEphemeralKeyType, err error) {
switch o.KeyType__ {
case TeamEphemeralKeyType_TEAM:
if o.Team__ == nil {
err = errors.New("unexpected nil value for Team__")
return ret, err
}
case TeamEphemeralKeyType_TEAMBOT:
if o.Teambot__ == nil {
err = errors.New("unexpected nil value for Teambot__")
return ret, err
}
}
return o.KeyType__, nil
}
func (o TeamEphemeralKey) Team() (res TeamEk) {
if o.KeyType__ != TeamEphemeralKeyType_TEAM {
panic("wrong case accessed")
}
if o.Team__ == nil {
return
}
return *o.Team__
}
func (o TeamEphemeralKey) Teambot() (res TeambotEk) {
if o.KeyType__ != TeamEphemeralKeyType_TEAMBOT {
panic("wrong case accessed")
}
if o.Teambot__ == nil {
return
}
return *o.Teambot__
}
func NewTeamEphemeralKeyWithTeam(v TeamEk) TeamEphemeralKey {
return TeamEphemeralKey{
KeyType__: TeamEphemeralKeyType_TEAM,
Team__: &v,
}
}
func NewTeamEphemeralKeyWithTeambot(v TeambotEk) TeamEphemeralKey {
return TeamEphemeralKey{
KeyType__: TeamEphemeralKeyType_TEAMBOT,
Teambot__: &v,
}
}
func (o TeamEphemeralKey) DeepCopy() TeamEphemeralKey {
return TeamEphemeralKey{
KeyType__: o.KeyType__.DeepCopy(),
Team__: (func(x *TeamEk) *TeamEk {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Team__),
Teambot__: (func(x *TeambotEk) *TeambotEk {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Teambot__),
}
}
type TeamEphemeralKeyBoxed struct {
KeyType__ TeamEphemeralKeyType `codec:"keyType" json:"keyType"`
Team__ *TeamEkBoxed `codec:"team,omitempty" json:"team,omitempty"`
Teambot__ *TeambotEkBoxed `codec:"teambot,omitempty" json:"teambot,omitempty"`
}
func (o *TeamEphemeralKeyBoxed) KeyType() (ret TeamEphemeralKeyType, err error) {
switch o.KeyType__ {
case TeamEphemeralKeyType_TEAM:
if o.Team__ == nil {
err = errors.New("unexpected nil value for Team__")
return ret, err
}
case TeamEphemeralKeyType_TEAMBOT:
if o.Teambot__ == nil {
err = errors.New("unexpected nil value for Teambot__")
return ret, err
}
}
return o.KeyType__, nil
}
func (o TeamEphemeralKeyBoxed) Team() (res TeamEkBoxed) {
if o.KeyType__ != TeamEphemeralKeyType_TEAM {
panic("wrong case accessed")
}
if o.Team__ == nil {
return
}
return *o.Team__
}
func (o TeamEphemeralKeyBoxed) Teambot() (res TeambotEkBoxed) {
if o.KeyType__ != TeamEphemeralKeyType_TEAMBOT {
panic("wrong case accessed")
}
if o.Teambot__ == nil {
return
}
return *o.Teambot__
}
func NewTeamEphemeralKeyBoxedWithTeam(v TeamEkBoxed) TeamEphemeralKeyBoxed {
return TeamEphemeralKeyBoxed{
KeyType__: TeamEphemeralKeyType_TEAM,
Team__: &v,
}
}
func NewTeamEphemeralKeyBoxedWithTeambot(v TeambotEkBoxed) TeamEphemeralKeyBoxed {
return TeamEphemeralKeyBoxed{
KeyType__: TeamEphemeralKeyType_TEAMBOT,
Teambot__: &v,
}
}
func (o TeamEphemeralKeyBoxed) DeepCopy() TeamEphemeralKeyBoxed {
return TeamEphemeralKeyBoxed{
KeyType__: o.KeyType__.DeepCopy(),
Team__: (func(x *TeamEkBoxed) *TeamEkBoxed {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Team__),
Teambot__: (func(x *TeambotEkBoxed) *TeambotEkBoxed {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Teambot__),
}
}

View File

@ -0,0 +1,330 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/favorite.avdl
package keybase1
import (
"errors"
"fmt"
)
type FolderType int
const (
FolderType_UNKNOWN FolderType = 0
FolderType_PRIVATE FolderType = 1
FolderType_PUBLIC FolderType = 2
FolderType_TEAM FolderType = 3
)
func (o FolderType) DeepCopy() FolderType { return o }
var FolderTypeMap = map[string]FolderType{
"UNKNOWN": 0,
"PRIVATE": 1,
"PUBLIC": 2,
"TEAM": 3,
}
var FolderTypeRevMap = map[FolderType]string{
0: "UNKNOWN",
1: "PRIVATE",
2: "PUBLIC",
3: "TEAM",
}
func (e FolderType) String() string {
if v, ok := FolderTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type FolderConflictType int
const (
FolderConflictType_NONE FolderConflictType = 0
FolderConflictType_IN_CONFLICT FolderConflictType = 1
FolderConflictType_IN_CONFLICT_AND_STUCK FolderConflictType = 2
FolderConflictType_CLEARED_CONFLICT FolderConflictType = 3
)
func (o FolderConflictType) DeepCopy() FolderConflictType { return o }
var FolderConflictTypeMap = map[string]FolderConflictType{
"NONE": 0,
"IN_CONFLICT": 1,
"IN_CONFLICT_AND_STUCK": 2,
"CLEARED_CONFLICT": 3,
}
var FolderConflictTypeRevMap = map[FolderConflictType]string{
0: "NONE",
1: "IN_CONFLICT",
2: "IN_CONFLICT_AND_STUCK",
3: "CLEARED_CONFLICT",
}
func (e FolderConflictType) String() string {
if v, ok := FolderConflictTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ConflictStateType int
const (
ConflictStateType_NormalView ConflictStateType = 1
ConflictStateType_ManualResolvingLocalView ConflictStateType = 2
)
func (o ConflictStateType) DeepCopy() ConflictStateType { return o }
var ConflictStateTypeMap = map[string]ConflictStateType{
"NormalView": 1,
"ManualResolvingLocalView": 2,
}
var ConflictStateTypeRevMap = map[ConflictStateType]string{
1: "NormalView",
2: "ManualResolvingLocalView",
}
func (e ConflictStateType) String() string {
if v, ok := ConflictStateTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type FolderNormalView struct {
ResolvingConflict bool `codec:"resolvingConflict" json:"resolvingConflict"`
StuckInConflict bool `codec:"stuckInConflict" json:"stuckInConflict"`
LocalViews []Path `codec:"localViews" json:"localViews"`
}
func (o FolderNormalView) DeepCopy() FolderNormalView {
return FolderNormalView{
ResolvingConflict: o.ResolvingConflict,
StuckInConflict: o.StuckInConflict,
LocalViews: (func(x []Path) []Path {
if x == nil {
return nil
}
ret := make([]Path, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.LocalViews),
}
}
type FolderConflictManualResolvingLocalView struct {
NormalView Path `codec:"normalView" json:"normalView"`
}
func (o FolderConflictManualResolvingLocalView) DeepCopy() FolderConflictManualResolvingLocalView {
return FolderConflictManualResolvingLocalView{
NormalView: o.NormalView.DeepCopy(),
}
}
type ConflictState struct {
ConflictStateType__ ConflictStateType `codec:"conflictStateType" json:"conflictStateType"`
Normalview__ *FolderNormalView `codec:"normalview,omitempty" json:"normalview,omitempty"`
Manualresolvinglocalview__ *FolderConflictManualResolvingLocalView `codec:"manualresolvinglocalview,omitempty" json:"manualresolvinglocalview,omitempty"`
}
func (o *ConflictState) ConflictStateType() (ret ConflictStateType, err error) {
switch o.ConflictStateType__ {
case ConflictStateType_NormalView:
if o.Normalview__ == nil {
err = errors.New("unexpected nil value for Normalview__")
return ret, err
}
case ConflictStateType_ManualResolvingLocalView:
if o.Manualresolvinglocalview__ == nil {
err = errors.New("unexpected nil value for Manualresolvinglocalview__")
return ret, err
}
}
return o.ConflictStateType__, nil
}
func (o ConflictState) Normalview() (res FolderNormalView) {
if o.ConflictStateType__ != ConflictStateType_NormalView {
panic("wrong case accessed")
}
if o.Normalview__ == nil {
return
}
return *o.Normalview__
}
func (o ConflictState) Manualresolvinglocalview() (res FolderConflictManualResolvingLocalView) {
if o.ConflictStateType__ != ConflictStateType_ManualResolvingLocalView {
panic("wrong case accessed")
}
if o.Manualresolvinglocalview__ == nil {
return
}
return *o.Manualresolvinglocalview__
}
func NewConflictStateWithNormalview(v FolderNormalView) ConflictState {
return ConflictState{
ConflictStateType__: ConflictStateType_NormalView,
Normalview__: &v,
}
}
func NewConflictStateWithManualresolvinglocalview(v FolderConflictManualResolvingLocalView) ConflictState {
return ConflictState{
ConflictStateType__: ConflictStateType_ManualResolvingLocalView,
Manualresolvinglocalview__: &v,
}
}
func (o ConflictState) DeepCopy() ConflictState {
return ConflictState{
ConflictStateType__: o.ConflictStateType__.DeepCopy(),
Normalview__: (func(x *FolderNormalView) *FolderNormalView {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Normalview__),
Manualresolvinglocalview__: (func(x *FolderConflictManualResolvingLocalView) *FolderConflictManualResolvingLocalView {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Manualresolvinglocalview__),
}
}
// Folder represents a favorite top-level folder in kbfs.
// This type is likely to change significantly as all the various parts are
// connected and tested.
type Folder struct {
Name string `codec:"name" json:"name"`
Private bool `codec:"private" json:"private"`
Created bool `codec:"created" json:"created"`
FolderType FolderType `codec:"folderType" json:"folderType"`
TeamID *TeamID `codec:"team_id,omitempty" json:"team_id,omitempty"`
ResetMembers []User `codec:"reset_members" json:"reset_members"`
Mtime *Time `codec:"mtime,omitempty" json:"mtime,omitempty"`
ConflictState *ConflictState `codec:"conflictState,omitempty" json:"conflictState,omitempty"`
SyncConfig *FolderSyncConfig `codec:"syncConfig,omitempty" json:"syncConfig,omitempty"`
}
func (o Folder) DeepCopy() Folder {
return Folder{
Name: o.Name,
Private: o.Private,
Created: o.Created,
FolderType: o.FolderType.DeepCopy(),
TeamID: (func(x *TeamID) *TeamID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TeamID),
ResetMembers: (func(x []User) []User {
if x == nil {
return nil
}
ret := make([]User, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ResetMembers),
Mtime: (func(x *Time) *Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Mtime),
ConflictState: (func(x *ConflictState) *ConflictState {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ConflictState),
SyncConfig: (func(x *FolderSyncConfig) *FolderSyncConfig {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.SyncConfig),
}
}
type FolderHandle struct {
Name string `codec:"name" json:"name"`
FolderType FolderType `codec:"folderType" json:"folderType"`
Created bool `codec:"created" json:"created"`
}
func (o FolderHandle) DeepCopy() FolderHandle {
return FolderHandle{
Name: o.Name,
FolderType: o.FolderType.DeepCopy(),
Created: o.Created,
}
}
type FavoritesResult struct {
FavoriteFolders []Folder `codec:"favoriteFolders" json:"favoriteFolders"`
IgnoredFolders []Folder `codec:"ignoredFolders" json:"ignoredFolders"`
NewFolders []Folder `codec:"newFolders" json:"newFolders"`
}
func (o FavoritesResult) DeepCopy() FavoritesResult {
return FavoritesResult{
FavoriteFolders: (func(x []Folder) []Folder {
if x == nil {
return nil
}
ret := make([]Folder, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.FavoriteFolders),
IgnoredFolders: (func(x []Folder) []Folder {
if x == nil {
return nil
}
ret := make([]Folder, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.IgnoredFolders),
NewFolders: (func(x []Folder) []Folder {
if x == nil {
return nil
}
ret := make([]Folder, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.NewFolders),
}
}

View File

@ -0,0 +1,84 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/featured_bot.avdl
package keybase1
type FeaturedBot struct {
BotAlias string `codec:"botAlias" json:"botAlias"`
Description string `codec:"description" json:"description"`
ExtendedDescription string `codec:"extendedDescription" json:"extendedDescription"`
BotUsername string `codec:"botUsername" json:"botUsername"`
OwnerTeam *string `codec:"ownerTeam,omitempty" json:"ownerTeam,omitempty"`
OwnerUser *string `codec:"ownerUser,omitempty" json:"ownerUser,omitempty"`
Rank int `codec:"rank" json:"rank"`
IsPromoted bool `codec:"isPromoted" json:"isPromoted"`
}
func (o FeaturedBot) DeepCopy() FeaturedBot {
return FeaturedBot{
BotAlias: o.BotAlias,
Description: o.Description,
ExtendedDescription: o.ExtendedDescription,
BotUsername: o.BotUsername,
OwnerTeam: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.OwnerTeam),
OwnerUser: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.OwnerUser),
Rank: o.Rank,
IsPromoted: o.IsPromoted,
}
}
type FeaturedBotsRes struct {
Bots []FeaturedBot `codec:"bots" json:"bots"`
IsLastPage bool `codec:"isLastPage" json:"isLastPage"`
}
func (o FeaturedBotsRes) DeepCopy() FeaturedBotsRes {
return FeaturedBotsRes{
Bots: (func(x []FeaturedBot) []FeaturedBot {
if x == nil {
return nil
}
ret := make([]FeaturedBot, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Bots),
IsLastPage: o.IsLastPage,
}
}
type SearchRes struct {
Bots []FeaturedBot `codec:"bots" json:"bots"`
IsLastPage bool `codec:"isLastPage" json:"isLastPage"`
}
func (o SearchRes) DeepCopy() SearchRes {
return SearchRes{
Bots: (func(x []FeaturedBot) []FeaturedBot {
if x == nil {
return nil
}
ret := make([]FeaturedBot, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Bots),
IsLastPage: o.IsLastPage,
}
}

View File

@ -0,0 +1,34 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/fs.avdl
package keybase1
type File struct {
Path string `codec:"path" json:"path"`
}
func (o File) DeepCopy() File {
return File{
Path: o.Path,
}
}
type ListResult struct {
Files []File `codec:"files" json:"files"`
}
func (o ListResult) DeepCopy() ListResult {
return ListResult{
Files: (func(x []File) []File {
if x == nil {
return nil
}
ret := make([]File, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Files),
}
}

View File

@ -0,0 +1,382 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/git.avdl
package keybase1
import (
"errors"
"fmt"
)
type EncryptedGitMetadata struct {
V int `codec:"v" json:"v"`
E []byte `codec:"e" json:"e"`
N BoxNonce `codec:"n" json:"n"`
Gen PerTeamKeyGeneration `codec:"gen" json:"gen"`
}
func (o EncryptedGitMetadata) DeepCopy() EncryptedGitMetadata {
return EncryptedGitMetadata{
V: o.V,
E: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.E),
N: o.N.DeepCopy(),
Gen: o.Gen.DeepCopy(),
}
}
type RepoID string
func (o RepoID) DeepCopy() RepoID {
return o
}
type GitLocalMetadataVersion int
const (
GitLocalMetadataVersion_V1 GitLocalMetadataVersion = 1
)
func (o GitLocalMetadataVersion) DeepCopy() GitLocalMetadataVersion { return o }
var GitLocalMetadataVersionMap = map[string]GitLocalMetadataVersion{
"V1": 1,
}
var GitLocalMetadataVersionRevMap = map[GitLocalMetadataVersion]string{
1: "V1",
}
func (e GitLocalMetadataVersion) String() string {
if v, ok := GitLocalMetadataVersionRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type GitLocalMetadataV1 struct {
RepoName GitRepoName `codec:"repoName" json:"repoName"`
}
func (o GitLocalMetadataV1) DeepCopy() GitLocalMetadataV1 {
return GitLocalMetadataV1{
RepoName: o.RepoName.DeepCopy(),
}
}
type GitLocalMetadataVersioned struct {
Version__ GitLocalMetadataVersion `codec:"version" json:"version"`
V1__ *GitLocalMetadataV1 `codec:"v1,omitempty" json:"v1,omitempty"`
}
func (o *GitLocalMetadataVersioned) Version() (ret GitLocalMetadataVersion, err error) {
switch o.Version__ {
case GitLocalMetadataVersion_V1:
if o.V1__ == nil {
err = errors.New("unexpected nil value for V1__")
return ret, err
}
}
return o.Version__, nil
}
func (o GitLocalMetadataVersioned) V1() (res GitLocalMetadataV1) {
if o.Version__ != GitLocalMetadataVersion_V1 {
panic("wrong case accessed")
}
if o.V1__ == nil {
return
}
return *o.V1__
}
func NewGitLocalMetadataVersionedWithV1(v GitLocalMetadataV1) GitLocalMetadataVersioned {
return GitLocalMetadataVersioned{
Version__: GitLocalMetadataVersion_V1,
V1__: &v,
}
}
func (o GitLocalMetadataVersioned) DeepCopy() GitLocalMetadataVersioned {
return GitLocalMetadataVersioned{
Version__: o.Version__.DeepCopy(),
V1__: (func(x *GitLocalMetadataV1) *GitLocalMetadataV1 {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.V1__),
}
}
type GitCommit struct {
CommitHash string `codec:"commitHash" json:"commitHash"`
Message string `codec:"message" json:"message"`
AuthorName string `codec:"authorName" json:"authorName"`
AuthorEmail string `codec:"authorEmail" json:"authorEmail"`
Ctime Time `codec:"ctime" json:"ctime"`
}
func (o GitCommit) DeepCopy() GitCommit {
return GitCommit{
CommitHash: o.CommitHash,
Message: o.Message,
AuthorName: o.AuthorName,
AuthorEmail: o.AuthorEmail,
Ctime: o.Ctime.DeepCopy(),
}
}
type GitPushType int
const (
GitPushType_DEFAULT GitPushType = 0
GitPushType_CREATEREPO GitPushType = 1
GitPushType_RENAMEREPO GitPushType = 3
)
func (o GitPushType) DeepCopy() GitPushType { return o }
var GitPushTypeMap = map[string]GitPushType{
"DEFAULT": 0,
"CREATEREPO": 1,
"RENAMEREPO": 3,
}
var GitPushTypeRevMap = map[GitPushType]string{
0: "DEFAULT",
1: "CREATEREPO",
3: "RENAMEREPO",
}
func (e GitPushType) String() string {
if v, ok := GitPushTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type GitRefMetadata struct {
RefName string `codec:"refName" json:"refName"`
Commits []GitCommit `codec:"commits" json:"commits"`
MoreCommitsAvailable bool `codec:"moreCommitsAvailable" json:"moreCommitsAvailable"`
IsDelete bool `codec:"isDelete" json:"isDelete"`
}
func (o GitRefMetadata) DeepCopy() GitRefMetadata {
return GitRefMetadata{
RefName: o.RefName,
Commits: (func(x []GitCommit) []GitCommit {
if x == nil {
return nil
}
ret := make([]GitCommit, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Commits),
MoreCommitsAvailable: o.MoreCommitsAvailable,
IsDelete: o.IsDelete,
}
}
type GitLocalMetadata struct {
RepoName GitRepoName `codec:"repoName" json:"repoName"`
Refs []GitRefMetadata `codec:"refs" json:"refs"`
PushType GitPushType `codec:"pushType" json:"pushType"`
PreviousRepoName GitRepoName `codec:"previousRepoName" json:"previousRepoName"`
}
func (o GitLocalMetadata) DeepCopy() GitLocalMetadata {
return GitLocalMetadata{
RepoName: o.RepoName.DeepCopy(),
Refs: (func(x []GitRefMetadata) []GitRefMetadata {
if x == nil {
return nil
}
ret := make([]GitRefMetadata, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Refs),
PushType: o.PushType.DeepCopy(),
PreviousRepoName: o.PreviousRepoName.DeepCopy(),
}
}
type GitServerMetadata struct {
Ctime Time `codec:"ctime" json:"ctime"`
Mtime Time `codec:"mtime" json:"mtime"`
LastModifyingUsername string `codec:"lastModifyingUsername" json:"lastModifyingUsername"`
LastModifyingDeviceID DeviceID `codec:"lastModifyingDeviceID" json:"lastModifyingDeviceID"`
LastModifyingDeviceName string `codec:"lastModifyingDeviceName" json:"lastModifyingDeviceName"`
}
func (o GitServerMetadata) DeepCopy() GitServerMetadata {
return GitServerMetadata{
Ctime: o.Ctime.DeepCopy(),
Mtime: o.Mtime.DeepCopy(),
LastModifyingUsername: o.LastModifyingUsername,
LastModifyingDeviceID: o.LastModifyingDeviceID.DeepCopy(),
LastModifyingDeviceName: o.LastModifyingDeviceName,
}
}
type GitRepoResultState int
const (
GitRepoResultState_ERR GitRepoResultState = 0
GitRepoResultState_OK GitRepoResultState = 1
)
func (o GitRepoResultState) DeepCopy() GitRepoResultState { return o }
var GitRepoResultStateMap = map[string]GitRepoResultState{
"ERR": 0,
"OK": 1,
}
var GitRepoResultStateRevMap = map[GitRepoResultState]string{
0: "ERR",
1: "OK",
}
func (e GitRepoResultState) String() string {
if v, ok := GitRepoResultStateRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type GitRepoResult struct {
State__ GitRepoResultState `codec:"state" json:"state"`
Err__ *string `codec:"err,omitempty" json:"err,omitempty"`
Ok__ *GitRepoInfo `codec:"ok,omitempty" json:"ok,omitempty"`
}
func (o *GitRepoResult) State() (ret GitRepoResultState, err error) {
switch o.State__ {
case GitRepoResultState_ERR:
if o.Err__ == nil {
err = errors.New("unexpected nil value for Err__")
return ret, err
}
case GitRepoResultState_OK:
if o.Ok__ == nil {
err = errors.New("unexpected nil value for Ok__")
return ret, err
}
}
return o.State__, nil
}
func (o GitRepoResult) Err() (res string) {
if o.State__ != GitRepoResultState_ERR {
panic("wrong case accessed")
}
if o.Err__ == nil {
return
}
return *o.Err__
}
func (o GitRepoResult) Ok() (res GitRepoInfo) {
if o.State__ != GitRepoResultState_OK {
panic("wrong case accessed")
}
if o.Ok__ == nil {
return
}
return *o.Ok__
}
func NewGitRepoResultWithErr(v string) GitRepoResult {
return GitRepoResult{
State__: GitRepoResultState_ERR,
Err__: &v,
}
}
func NewGitRepoResultWithOk(v GitRepoInfo) GitRepoResult {
return GitRepoResult{
State__: GitRepoResultState_OK,
Ok__: &v,
}
}
func (o GitRepoResult) DeepCopy() GitRepoResult {
return GitRepoResult{
State__: o.State__.DeepCopy(),
Err__: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.Err__),
Ok__: (func(x *GitRepoInfo) *GitRepoInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Ok__),
}
}
type GitRepoInfo struct {
Folder FolderHandle `codec:"folder" json:"folder"`
RepoID RepoID `codec:"repoID" json:"repoID"`
LocalMetadata GitLocalMetadata `codec:"localMetadata" json:"localMetadata"`
ServerMetadata GitServerMetadata `codec:"serverMetadata" json:"serverMetadata"`
RepoUrl string `codec:"repoUrl" json:"repoUrl"`
GlobalUniqueID string `codec:"globalUniqueID" json:"globalUniqueID"`
CanDelete bool `codec:"canDelete" json:"canDelete"`
TeamRepoSettings *GitTeamRepoSettings `codec:"teamRepoSettings,omitempty" json:"teamRepoSettings,omitempty"`
}
func (o GitRepoInfo) DeepCopy() GitRepoInfo {
return GitRepoInfo{
Folder: o.Folder.DeepCopy(),
RepoID: o.RepoID.DeepCopy(),
LocalMetadata: o.LocalMetadata.DeepCopy(),
ServerMetadata: o.ServerMetadata.DeepCopy(),
RepoUrl: o.RepoUrl,
GlobalUniqueID: o.GlobalUniqueID,
CanDelete: o.CanDelete,
TeamRepoSettings: (func(x *GitTeamRepoSettings) *GitTeamRepoSettings {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TeamRepoSettings),
}
}
type GitTeamRepoSettings struct {
ChannelName *string `codec:"channelName,omitempty" json:"channelName,omitempty"`
ChatDisabled bool `codec:"chatDisabled" json:"chatDisabled"`
}
func (o GitTeamRepoSettings) DeepCopy() GitTeamRepoSettings {
return GitTeamRepoSettings{
ChannelName: (func(x *string) *string {
if x == nil {
return nil
}
tmp := (*x)
return &tmp
})(o.ChannelName),
ChatDisabled: o.ChatDisabled,
}
}

View File

@ -0,0 +1,32 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/gpg_common.avdl
package keybase1
type GPGKey struct {
Algorithm string `codec:"algorithm" json:"algorithm"`
KeyID string `codec:"keyID" json:"keyID"`
Creation string `codec:"creation" json:"creation"`
Expiration string `codec:"expiration" json:"expiration"`
Identities []PGPIdentity `codec:"identities" json:"identities"`
}
func (o GPGKey) DeepCopy() GPGKey {
return GPGKey{
Algorithm: o.Algorithm,
KeyID: o.KeyID,
Creation: o.Creation,
Expiration: o.Expiration,
Identities: (func(x []PGPIdentity) []PGPIdentity {
if x == nil {
return nil
}
ret := make([]PGPIdentity, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Identities),
}
}

View File

@ -0,0 +1,16 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/gpg_ui.avdl
package keybase1
type SelectKeyRes struct {
KeyID string `codec:"keyID" json:"keyID"`
DoSecretPush bool `codec:"doSecretPush" json:"doSecretPush"`
}
func (o SelectKeyRes) DeepCopy() SelectKeyRes {
return SelectKeyRes{
KeyID: o.KeyID,
DoSecretPush: o.DoSecretPush,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/gregor.avdl
package keybase1

View File

@ -0,0 +1,37 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/gregor_ui.avdl
package keybase1
import (
"fmt"
)
type PushReason int
const (
PushReason_NONE PushReason = 0
PushReason_RECONNECTED PushReason = 1
PushReason_NEW_DATA PushReason = 2
)
func (o PushReason) DeepCopy() PushReason { return o }
var PushReasonMap = map[string]PushReason{
"NONE": 0,
"RECONNECTED": 1,
"NEW_DATA": 2,
}
var PushReasonRevMap = map[PushReason]string{
0: "NONE",
1: "RECONNECTED",
2: "NEW_DATA",
}
func (e PushReason) String() string {
if v, ok := PushReasonRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}

View File

@ -0,0 +1,884 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/home.avdl
package keybase1
import (
"errors"
"fmt"
)
type HomeScreenItemID string
func (o HomeScreenItemID) DeepCopy() HomeScreenItemID {
return o
}
type HomeScreenItemType int
const (
HomeScreenItemType_TODO HomeScreenItemType = 1
HomeScreenItemType_PEOPLE HomeScreenItemType = 2
HomeScreenItemType_ANNOUNCEMENT HomeScreenItemType = 3
)
func (o HomeScreenItemType) DeepCopy() HomeScreenItemType { return o }
var HomeScreenItemTypeMap = map[string]HomeScreenItemType{
"TODO": 1,
"PEOPLE": 2,
"ANNOUNCEMENT": 3,
}
var HomeScreenItemTypeRevMap = map[HomeScreenItemType]string{
1: "TODO",
2: "PEOPLE",
3: "ANNOUNCEMENT",
}
func (e HomeScreenItemType) String() string {
if v, ok := HomeScreenItemTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type HomeScreenItemData struct {
T__ HomeScreenItemType `codec:"t" json:"t"`
Todo__ *HomeScreenTodo `codec:"todo,omitempty" json:"todo,omitempty"`
People__ *HomeScreenPeopleNotification `codec:"people,omitempty" json:"people,omitempty"`
Announcement__ *HomeScreenAnnouncement `codec:"announcement,omitempty" json:"announcement,omitempty"`
}
func (o *HomeScreenItemData) T() (ret HomeScreenItemType, err error) {
switch o.T__ {
case HomeScreenItemType_TODO:
if o.Todo__ == nil {
err = errors.New("unexpected nil value for Todo__")
return ret, err
}
case HomeScreenItemType_PEOPLE:
if o.People__ == nil {
err = errors.New("unexpected nil value for People__")
return ret, err
}
case HomeScreenItemType_ANNOUNCEMENT:
if o.Announcement__ == nil {
err = errors.New("unexpected nil value for Announcement__")
return ret, err
}
}
return o.T__, nil
}
func (o HomeScreenItemData) Todo() (res HomeScreenTodo) {
if o.T__ != HomeScreenItemType_TODO {
panic("wrong case accessed")
}
if o.Todo__ == nil {
return
}
return *o.Todo__
}
func (o HomeScreenItemData) People() (res HomeScreenPeopleNotification) {
if o.T__ != HomeScreenItemType_PEOPLE {
panic("wrong case accessed")
}
if o.People__ == nil {
return
}
return *o.People__
}
func (o HomeScreenItemData) Announcement() (res HomeScreenAnnouncement) {
if o.T__ != HomeScreenItemType_ANNOUNCEMENT {
panic("wrong case accessed")
}
if o.Announcement__ == nil {
return
}
return *o.Announcement__
}
func NewHomeScreenItemDataWithTodo(v HomeScreenTodo) HomeScreenItemData {
return HomeScreenItemData{
T__: HomeScreenItemType_TODO,
Todo__: &v,
}
}
func NewHomeScreenItemDataWithPeople(v HomeScreenPeopleNotification) HomeScreenItemData {
return HomeScreenItemData{
T__: HomeScreenItemType_PEOPLE,
People__: &v,
}
}
func NewHomeScreenItemDataWithAnnouncement(v HomeScreenAnnouncement) HomeScreenItemData {
return HomeScreenItemData{
T__: HomeScreenItemType_ANNOUNCEMENT,
Announcement__: &v,
}
}
func NewHomeScreenItemDataDefault(t HomeScreenItemType) HomeScreenItemData {
return HomeScreenItemData{
T__: t,
}
}
func (o HomeScreenItemData) DeepCopy() HomeScreenItemData {
return HomeScreenItemData{
T__: o.T__.DeepCopy(),
Todo__: (func(x *HomeScreenTodo) *HomeScreenTodo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Todo__),
People__: (func(x *HomeScreenPeopleNotification) *HomeScreenPeopleNotification {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.People__),
Announcement__: (func(x *HomeScreenAnnouncement) *HomeScreenAnnouncement {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Announcement__),
}
}
type HomeScreenItemDataExt struct {
T__ HomeScreenItemType `codec:"t" json:"t"`
Todo__ *HomeScreenTodoExt `codec:"todo,omitempty" json:"todo,omitempty"`
}
func (o *HomeScreenItemDataExt) T() (ret HomeScreenItemType, err error) {
switch o.T__ {
case HomeScreenItemType_TODO:
if o.Todo__ == nil {
err = errors.New("unexpected nil value for Todo__")
return ret, err
}
}
return o.T__, nil
}
func (o HomeScreenItemDataExt) Todo() (res HomeScreenTodoExt) {
if o.T__ != HomeScreenItemType_TODO {
panic("wrong case accessed")
}
if o.Todo__ == nil {
return
}
return *o.Todo__
}
func NewHomeScreenItemDataExtWithTodo(v HomeScreenTodoExt) HomeScreenItemDataExt {
return HomeScreenItemDataExt{
T__: HomeScreenItemType_TODO,
Todo__: &v,
}
}
func NewHomeScreenItemDataExtDefault(t HomeScreenItemType) HomeScreenItemDataExt {
return HomeScreenItemDataExt{
T__: t,
}
}
func (o HomeScreenItemDataExt) DeepCopy() HomeScreenItemDataExt {
return HomeScreenItemDataExt{
T__: o.T__.DeepCopy(),
Todo__: (func(x *HomeScreenTodoExt) *HomeScreenTodoExt {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Todo__),
}
}
type AppLinkType int
const (
AppLinkType_NONE AppLinkType = 0
AppLinkType_PEOPLE AppLinkType = 1
AppLinkType_CHAT AppLinkType = 2
AppLinkType_FILES AppLinkType = 3
AppLinkType_WALLET AppLinkType = 4
AppLinkType_GIT AppLinkType = 5
AppLinkType_DEVICES AppLinkType = 6
AppLinkType_SETTINGS AppLinkType = 7
AppLinkType_TEAMS AppLinkType = 8
)
func (o AppLinkType) DeepCopy() AppLinkType { return o }
var AppLinkTypeMap = map[string]AppLinkType{
"NONE": 0,
"PEOPLE": 1,
"CHAT": 2,
"FILES": 3,
"WALLET": 4,
"GIT": 5,
"DEVICES": 6,
"SETTINGS": 7,
"TEAMS": 8,
}
var AppLinkTypeRevMap = map[AppLinkType]string{
0: "NONE",
1: "PEOPLE",
2: "CHAT",
3: "FILES",
4: "WALLET",
5: "GIT",
6: "DEVICES",
7: "SETTINGS",
8: "TEAMS",
}
func (e AppLinkType) String() string {
if v, ok := AppLinkTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type HomeScreenAnnouncementID int
func (o HomeScreenAnnouncementID) DeepCopy() HomeScreenAnnouncementID {
return o
}
type HomeScreenAnnouncementVersion int
func (o HomeScreenAnnouncementVersion) DeepCopy() HomeScreenAnnouncementVersion {
return o
}
type HomeScreenAnnouncement struct {
Id HomeScreenAnnouncementID `codec:"id" json:"id"`
Version HomeScreenAnnouncementVersion `codec:"version" json:"version"`
AppLink AppLinkType `codec:"appLink" json:"appLink"`
ConfirmLabel string `codec:"confirmLabel" json:"confirmLabel"`
Dismissable bool `codec:"dismissable" json:"dismissable"`
IconUrl string `codec:"iconUrl" json:"iconUrl"`
Text string `codec:"text" json:"text"`
Url string `codec:"url" json:"url"`
}
func (o HomeScreenAnnouncement) DeepCopy() HomeScreenAnnouncement {
return HomeScreenAnnouncement{
Id: o.Id.DeepCopy(),
Version: o.Version.DeepCopy(),
AppLink: o.AppLink.DeepCopy(),
ConfirmLabel: o.ConfirmLabel,
Dismissable: o.Dismissable,
IconUrl: o.IconUrl,
Text: o.Text,
Url: o.Url,
}
}
type HomeScreenTodoType int
const (
HomeScreenTodoType_NONE HomeScreenTodoType = 0
HomeScreenTodoType_BIO HomeScreenTodoType = 1
HomeScreenTodoType_PROOF HomeScreenTodoType = 2
HomeScreenTodoType_DEVICE HomeScreenTodoType = 3
HomeScreenTodoType_FOLLOW HomeScreenTodoType = 4
HomeScreenTodoType_CHAT HomeScreenTodoType = 5
HomeScreenTodoType_PAPERKEY HomeScreenTodoType = 6
HomeScreenTodoType_TEAM HomeScreenTodoType = 7
HomeScreenTodoType_FOLDER HomeScreenTodoType = 8
HomeScreenTodoType_GIT_REPO HomeScreenTodoType = 9
HomeScreenTodoType_TEAM_SHOWCASE HomeScreenTodoType = 10
HomeScreenTodoType_AVATAR_USER HomeScreenTodoType = 11
HomeScreenTodoType_AVATAR_TEAM HomeScreenTodoType = 12
HomeScreenTodoType_ADD_PHONE_NUMBER HomeScreenTodoType = 18
HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER HomeScreenTodoType = 19
HomeScreenTodoType_VERIFY_ALL_EMAIL HomeScreenTodoType = 20
HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY HomeScreenTodoType = 21
HomeScreenTodoType_ADD_EMAIL HomeScreenTodoType = 22
HomeScreenTodoType_ANNONCEMENT_PLACEHOLDER HomeScreenTodoType = 10000
)
func (o HomeScreenTodoType) DeepCopy() HomeScreenTodoType { return o }
var HomeScreenTodoTypeMap = map[string]HomeScreenTodoType{
"NONE": 0,
"BIO": 1,
"PROOF": 2,
"DEVICE": 3,
"FOLLOW": 4,
"CHAT": 5,
"PAPERKEY": 6,
"TEAM": 7,
"FOLDER": 8,
"GIT_REPO": 9,
"TEAM_SHOWCASE": 10,
"AVATAR_USER": 11,
"AVATAR_TEAM": 12,
"ADD_PHONE_NUMBER": 18,
"VERIFY_ALL_PHONE_NUMBER": 19,
"VERIFY_ALL_EMAIL": 20,
"LEGACY_EMAIL_VISIBILITY": 21,
"ADD_EMAIL": 22,
"ANNONCEMENT_PLACEHOLDER": 10000,
}
var HomeScreenTodoTypeRevMap = map[HomeScreenTodoType]string{
0: "NONE",
1: "BIO",
2: "PROOF",
3: "DEVICE",
4: "FOLLOW",
5: "CHAT",
6: "PAPERKEY",
7: "TEAM",
8: "FOLDER",
9: "GIT_REPO",
10: "TEAM_SHOWCASE",
11: "AVATAR_USER",
12: "AVATAR_TEAM",
18: "ADD_PHONE_NUMBER",
19: "VERIFY_ALL_PHONE_NUMBER",
20: "VERIFY_ALL_EMAIL",
21: "LEGACY_EMAIL_VISIBILITY",
22: "ADD_EMAIL",
10000: "ANNONCEMENT_PLACEHOLDER",
}
func (e HomeScreenTodoType) String() string {
if v, ok := HomeScreenTodoTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
// Most of TODO items do not carry additional data, but some do. e.g. TODO
// item to tell user to verify their email address will carry that email
// address.
//
// All new TODO data bundle types should be records rather than single fields
// to support adding new data to existing TODOs. If a legacy TODO (such as
// VERIFY_ALL_EMAIL) uses a single field, the "TodoExt" field should be used to
// introduce more data to the payload.
type HomeScreenTodo struct {
T__ HomeScreenTodoType `codec:"t" json:"t"`
VerifyAllPhoneNumber__ *PhoneNumber `codec:"verifyAllPhoneNumber,omitempty" json:"verifyAllPhoneNumber,omitempty"`
VerifyAllEmail__ *EmailAddress `codec:"verifyAllEmail,omitempty" json:"verifyAllEmail,omitempty"`
LegacyEmailVisibility__ *EmailAddress `codec:"legacyEmailVisibility,omitempty" json:"legacyEmailVisibility,omitempty"`
}
func (o *HomeScreenTodo) T() (ret HomeScreenTodoType, err error) {
switch o.T__ {
case HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER:
if o.VerifyAllPhoneNumber__ == nil {
err = errors.New("unexpected nil value for VerifyAllPhoneNumber__")
return ret, err
}
case HomeScreenTodoType_VERIFY_ALL_EMAIL:
if o.VerifyAllEmail__ == nil {
err = errors.New("unexpected nil value for VerifyAllEmail__")
return ret, err
}
case HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY:
if o.LegacyEmailVisibility__ == nil {
err = errors.New("unexpected nil value for LegacyEmailVisibility__")
return ret, err
}
}
return o.T__, nil
}
func (o HomeScreenTodo) VerifyAllPhoneNumber() (res PhoneNumber) {
if o.T__ != HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER {
panic("wrong case accessed")
}
if o.VerifyAllPhoneNumber__ == nil {
return
}
return *o.VerifyAllPhoneNumber__
}
func (o HomeScreenTodo) VerifyAllEmail() (res EmailAddress) {
if o.T__ != HomeScreenTodoType_VERIFY_ALL_EMAIL {
panic("wrong case accessed")
}
if o.VerifyAllEmail__ == nil {
return
}
return *o.VerifyAllEmail__
}
func (o HomeScreenTodo) LegacyEmailVisibility() (res EmailAddress) {
if o.T__ != HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY {
panic("wrong case accessed")
}
if o.LegacyEmailVisibility__ == nil {
return
}
return *o.LegacyEmailVisibility__
}
func NewHomeScreenTodoWithVerifyAllPhoneNumber(v PhoneNumber) HomeScreenTodo {
return HomeScreenTodo{
T__: HomeScreenTodoType_VERIFY_ALL_PHONE_NUMBER,
VerifyAllPhoneNumber__: &v,
}
}
func NewHomeScreenTodoWithVerifyAllEmail(v EmailAddress) HomeScreenTodo {
return HomeScreenTodo{
T__: HomeScreenTodoType_VERIFY_ALL_EMAIL,
VerifyAllEmail__: &v,
}
}
func NewHomeScreenTodoWithLegacyEmailVisibility(v EmailAddress) HomeScreenTodo {
return HomeScreenTodo{
T__: HomeScreenTodoType_LEGACY_EMAIL_VISIBILITY,
LegacyEmailVisibility__: &v,
}
}
func NewHomeScreenTodoDefault(t HomeScreenTodoType) HomeScreenTodo {
return HomeScreenTodo{
T__: t,
}
}
func (o HomeScreenTodo) DeepCopy() HomeScreenTodo {
return HomeScreenTodo{
T__: o.T__.DeepCopy(),
VerifyAllPhoneNumber__: (func(x *PhoneNumber) *PhoneNumber {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.VerifyAllPhoneNumber__),
VerifyAllEmail__: (func(x *EmailAddress) *EmailAddress {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.VerifyAllEmail__),
LegacyEmailVisibility__: (func(x *EmailAddress) *EmailAddress {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.LegacyEmailVisibility__),
}
}
type HomeScreenTodoExt struct {
T__ HomeScreenTodoType `codec:"t" json:"t"`
VerifyAllEmail__ *VerifyAllEmailTodoExt `codec:"verifyAllEmail,omitempty" json:"verifyAllEmail,omitempty"`
}
func (o *HomeScreenTodoExt) T() (ret HomeScreenTodoType, err error) {
switch o.T__ {
case HomeScreenTodoType_VERIFY_ALL_EMAIL:
if o.VerifyAllEmail__ == nil {
err = errors.New("unexpected nil value for VerifyAllEmail__")
return ret, err
}
}
return o.T__, nil
}
func (o HomeScreenTodoExt) VerifyAllEmail() (res VerifyAllEmailTodoExt) {
if o.T__ != HomeScreenTodoType_VERIFY_ALL_EMAIL {
panic("wrong case accessed")
}
if o.VerifyAllEmail__ == nil {
return
}
return *o.VerifyAllEmail__
}
func NewHomeScreenTodoExtWithVerifyAllEmail(v VerifyAllEmailTodoExt) HomeScreenTodoExt {
return HomeScreenTodoExt{
T__: HomeScreenTodoType_VERIFY_ALL_EMAIL,
VerifyAllEmail__: &v,
}
}
func NewHomeScreenTodoExtDefault(t HomeScreenTodoType) HomeScreenTodoExt {
return HomeScreenTodoExt{
T__: t,
}
}
func (o HomeScreenTodoExt) DeepCopy() HomeScreenTodoExt {
return HomeScreenTodoExt{
T__: o.T__.DeepCopy(),
VerifyAllEmail__: (func(x *VerifyAllEmailTodoExt) *VerifyAllEmailTodoExt {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.VerifyAllEmail__),
}
}
type VerifyAllEmailTodoExt struct {
LastVerifyEmailDate UnixTime `codec:"lastVerifyEmailDate" json:"lastVerifyEmailDate"`
}
func (o VerifyAllEmailTodoExt) DeepCopy() VerifyAllEmailTodoExt {
return VerifyAllEmailTodoExt{
LastVerifyEmailDate: o.LastVerifyEmailDate.DeepCopy(),
}
}
type HomeScreenPeopleNotificationType int
const (
HomeScreenPeopleNotificationType_FOLLOWED HomeScreenPeopleNotificationType = 1
HomeScreenPeopleNotificationType_FOLLOWED_MULTI HomeScreenPeopleNotificationType = 2
HomeScreenPeopleNotificationType_CONTACT HomeScreenPeopleNotificationType = 3
HomeScreenPeopleNotificationType_CONTACT_MULTI HomeScreenPeopleNotificationType = 4
)
func (o HomeScreenPeopleNotificationType) DeepCopy() HomeScreenPeopleNotificationType { return o }
var HomeScreenPeopleNotificationTypeMap = map[string]HomeScreenPeopleNotificationType{
"FOLLOWED": 1,
"FOLLOWED_MULTI": 2,
"CONTACT": 3,
"CONTACT_MULTI": 4,
}
var HomeScreenPeopleNotificationTypeRevMap = map[HomeScreenPeopleNotificationType]string{
1: "FOLLOWED",
2: "FOLLOWED_MULTI",
3: "CONTACT",
4: "CONTACT_MULTI",
}
func (e HomeScreenPeopleNotificationType) String() string {
if v, ok := HomeScreenPeopleNotificationTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type HomeScreenPeopleNotificationFollowed struct {
FollowTime Time `codec:"followTime" json:"followTime"`
FollowedBack bool `codec:"followedBack" json:"followedBack"`
User UserSummary `codec:"user" json:"user"`
}
func (o HomeScreenPeopleNotificationFollowed) DeepCopy() HomeScreenPeopleNotificationFollowed {
return HomeScreenPeopleNotificationFollowed{
FollowTime: o.FollowTime.DeepCopy(),
FollowedBack: o.FollowedBack,
User: o.User.DeepCopy(),
}
}
type HomeScreenPeopleNotificationFollowedMulti struct {
Followers []HomeScreenPeopleNotificationFollowed `codec:"followers" json:"followers"`
NumOthers int `codec:"numOthers" json:"numOthers"`
}
func (o HomeScreenPeopleNotificationFollowedMulti) DeepCopy() HomeScreenPeopleNotificationFollowedMulti {
return HomeScreenPeopleNotificationFollowedMulti{
Followers: (func(x []HomeScreenPeopleNotificationFollowed) []HomeScreenPeopleNotificationFollowed {
if x == nil {
return nil
}
ret := make([]HomeScreenPeopleNotificationFollowed, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Followers),
NumOthers: o.NumOthers,
}
}
type HomeScreenPeopleNotificationContact struct {
ResolveTime Time `codec:"resolveTime" json:"resolveTime"`
Username string `codec:"username" json:"username"`
Description string `codec:"description" json:"description"`
ResolvedContactBlob string `codec:"resolvedContactBlob" json:"resolvedContactBlob"`
}
func (o HomeScreenPeopleNotificationContact) DeepCopy() HomeScreenPeopleNotificationContact {
return HomeScreenPeopleNotificationContact{
ResolveTime: o.ResolveTime.DeepCopy(),
Username: o.Username,
Description: o.Description,
ResolvedContactBlob: o.ResolvedContactBlob,
}
}
type HomeScreenPeopleNotificationContactMulti struct {
Contacts []HomeScreenPeopleNotificationContact `codec:"contacts" json:"contacts"`
NumOthers int `codec:"numOthers" json:"numOthers"`
}
func (o HomeScreenPeopleNotificationContactMulti) DeepCopy() HomeScreenPeopleNotificationContactMulti {
return HomeScreenPeopleNotificationContactMulti{
Contacts: (func(x []HomeScreenPeopleNotificationContact) []HomeScreenPeopleNotificationContact {
if x == nil {
return nil
}
ret := make([]HomeScreenPeopleNotificationContact, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Contacts),
NumOthers: o.NumOthers,
}
}
type HomeScreenPeopleNotification struct {
T__ HomeScreenPeopleNotificationType `codec:"t" json:"t"`
Followed__ *HomeScreenPeopleNotificationFollowed `codec:"followed,omitempty" json:"followed,omitempty"`
FollowedMulti__ *HomeScreenPeopleNotificationFollowedMulti `codec:"followedMulti,omitempty" json:"followedMulti,omitempty"`
Contact__ *HomeScreenPeopleNotificationContact `codec:"contact,omitempty" json:"contact,omitempty"`
ContactMulti__ *HomeScreenPeopleNotificationContactMulti `codec:"contactMulti,omitempty" json:"contactMulti,omitempty"`
}
func (o *HomeScreenPeopleNotification) T() (ret HomeScreenPeopleNotificationType, err error) {
switch o.T__ {
case HomeScreenPeopleNotificationType_FOLLOWED:
if o.Followed__ == nil {
err = errors.New("unexpected nil value for Followed__")
return ret, err
}
case HomeScreenPeopleNotificationType_FOLLOWED_MULTI:
if o.FollowedMulti__ == nil {
err = errors.New("unexpected nil value for FollowedMulti__")
return ret, err
}
case HomeScreenPeopleNotificationType_CONTACT:
if o.Contact__ == nil {
err = errors.New("unexpected nil value for Contact__")
return ret, err
}
case HomeScreenPeopleNotificationType_CONTACT_MULTI:
if o.ContactMulti__ == nil {
err = errors.New("unexpected nil value for ContactMulti__")
return ret, err
}
}
return o.T__, nil
}
func (o HomeScreenPeopleNotification) Followed() (res HomeScreenPeopleNotificationFollowed) {
if o.T__ != HomeScreenPeopleNotificationType_FOLLOWED {
panic("wrong case accessed")
}
if o.Followed__ == nil {
return
}
return *o.Followed__
}
func (o HomeScreenPeopleNotification) FollowedMulti() (res HomeScreenPeopleNotificationFollowedMulti) {
if o.T__ != HomeScreenPeopleNotificationType_FOLLOWED_MULTI {
panic("wrong case accessed")
}
if o.FollowedMulti__ == nil {
return
}
return *o.FollowedMulti__
}
func (o HomeScreenPeopleNotification) Contact() (res HomeScreenPeopleNotificationContact) {
if o.T__ != HomeScreenPeopleNotificationType_CONTACT {
panic("wrong case accessed")
}
if o.Contact__ == nil {
return
}
return *o.Contact__
}
func (o HomeScreenPeopleNotification) ContactMulti() (res HomeScreenPeopleNotificationContactMulti) {
if o.T__ != HomeScreenPeopleNotificationType_CONTACT_MULTI {
panic("wrong case accessed")
}
if o.ContactMulti__ == nil {
return
}
return *o.ContactMulti__
}
func NewHomeScreenPeopleNotificationWithFollowed(v HomeScreenPeopleNotificationFollowed) HomeScreenPeopleNotification {
return HomeScreenPeopleNotification{
T__: HomeScreenPeopleNotificationType_FOLLOWED,
Followed__: &v,
}
}
func NewHomeScreenPeopleNotificationWithFollowedMulti(v HomeScreenPeopleNotificationFollowedMulti) HomeScreenPeopleNotification {
return HomeScreenPeopleNotification{
T__: HomeScreenPeopleNotificationType_FOLLOWED_MULTI,
FollowedMulti__: &v,
}
}
func NewHomeScreenPeopleNotificationWithContact(v HomeScreenPeopleNotificationContact) HomeScreenPeopleNotification {
return HomeScreenPeopleNotification{
T__: HomeScreenPeopleNotificationType_CONTACT,
Contact__: &v,
}
}
func NewHomeScreenPeopleNotificationWithContactMulti(v HomeScreenPeopleNotificationContactMulti) HomeScreenPeopleNotification {
return HomeScreenPeopleNotification{
T__: HomeScreenPeopleNotificationType_CONTACT_MULTI,
ContactMulti__: &v,
}
}
func (o HomeScreenPeopleNotification) DeepCopy() HomeScreenPeopleNotification {
return HomeScreenPeopleNotification{
T__: o.T__.DeepCopy(),
Followed__: (func(x *HomeScreenPeopleNotificationFollowed) *HomeScreenPeopleNotificationFollowed {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Followed__),
FollowedMulti__: (func(x *HomeScreenPeopleNotificationFollowedMulti) *HomeScreenPeopleNotificationFollowedMulti {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.FollowedMulti__),
Contact__: (func(x *HomeScreenPeopleNotificationContact) *HomeScreenPeopleNotificationContact {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Contact__),
ContactMulti__: (func(x *HomeScreenPeopleNotificationContactMulti) *HomeScreenPeopleNotificationContactMulti {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.ContactMulti__),
}
}
type HomeScreenItem struct {
Badged bool `codec:"badged" json:"badged"`
Data HomeScreenItemData `codec:"data" json:"data"`
DataExt HomeScreenItemDataExt `codec:"dataExt" json:"dataExt"`
}
func (o HomeScreenItem) DeepCopy() HomeScreenItem {
return HomeScreenItem{
Badged: o.Badged,
Data: o.Data.DeepCopy(),
DataExt: o.DataExt.DeepCopy(),
}
}
type Pics struct {
Square40 string `codec:"square40" json:"square_40"`
Square200 string `codec:"square200" json:"square_200"`
Square360 string `codec:"square360" json:"square_360"`
}
func (o Pics) DeepCopy() Pics {
return Pics{
Square40: o.Square40,
Square200: o.Square200,
Square360: o.Square360,
}
}
type HomeUserSummary struct {
Uid UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`
Bio string `codec:"bio" json:"bio"`
FullName string `codec:"fullName" json:"full_name"`
Pics *Pics `codec:"pics,omitempty" json:"pics,omitempty"`
}
func (o HomeUserSummary) DeepCopy() HomeUserSummary {
return HomeUserSummary{
Uid: o.Uid.DeepCopy(),
Username: o.Username,
Bio: o.Bio,
FullName: o.FullName,
Pics: (func(x *Pics) *Pics {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Pics),
}
}
type HomeScreen struct {
LastViewed Time `codec:"lastViewed" json:"lastViewed"`
Version int `codec:"version" json:"version"`
Visits int `codec:"visits" json:"visits"`
Items []HomeScreenItem `codec:"items" json:"items"`
FollowSuggestions []HomeUserSummary `codec:"followSuggestions" json:"followSuggestions"`
AnnouncementsVersion int `codec:"announcementsVersion" json:"announcementsVersion"`
}
func (o HomeScreen) DeepCopy() HomeScreen {
return HomeScreen{
LastViewed: o.LastViewed.DeepCopy(),
Version: o.Version,
Visits: o.Visits,
Items: (func(x []HomeScreenItem) []HomeScreenItem {
if x == nil {
return nil
}
ret := make([]HomeScreenItem, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Items),
FollowSuggestions: (func(x []HomeUserSummary) []HomeUserSummary {
if x == nil {
return nil
}
ret := make([]HomeUserSummary, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.FollowSuggestions),
AnnouncementsVersion: o.AnnouncementsVersion,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/home_ui.avdl
package keybase1

View File

@ -0,0 +1,145 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/identify.avdl
package keybase1
type IdentifyProofBreak struct {
RemoteProof RemoteProof `codec:"remoteProof" json:"remoteProof"`
Lcr LinkCheckResult `codec:"lcr" json:"lcr"`
}
func (o IdentifyProofBreak) DeepCopy() IdentifyProofBreak {
return IdentifyProofBreak{
RemoteProof: o.RemoteProof.DeepCopy(),
Lcr: o.Lcr.DeepCopy(),
}
}
type IdentifyTrackBreaks struct {
Keys []IdentifyKey `codec:"keys" json:"keys"`
Proofs []IdentifyProofBreak `codec:"proofs" json:"proofs"`
}
func (o IdentifyTrackBreaks) DeepCopy() IdentifyTrackBreaks {
return IdentifyTrackBreaks{
Keys: (func(x []IdentifyKey) []IdentifyKey {
if x == nil {
return nil
}
ret := make([]IdentifyKey, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Keys),
Proofs: (func(x []IdentifyProofBreak) []IdentifyProofBreak {
if x == nil {
return nil
}
ret := make([]IdentifyProofBreak, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Proofs),
}
}
type Identify2Res struct {
Upk UserPlusKeys `codec:"upk" json:"upk"`
IdentifiedAt Time `codec:"identifiedAt" json:"identifiedAt"`
TrackBreaks *IdentifyTrackBreaks `codec:"trackBreaks,omitempty" json:"trackBreaks,omitempty"`
}
func (o Identify2Res) DeepCopy() Identify2Res {
return Identify2Res{
Upk: o.Upk.DeepCopy(),
IdentifiedAt: o.IdentifiedAt.DeepCopy(),
TrackBreaks: (func(x *IdentifyTrackBreaks) *IdentifyTrackBreaks {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TrackBreaks),
}
}
type Identify2ResUPK2 struct {
Upk UserPlusKeysV2AllIncarnations `codec:"upk" json:"upk"`
IdentifiedAt Time `codec:"identifiedAt" json:"identifiedAt"`
TrackBreaks *IdentifyTrackBreaks `codec:"trackBreaks,omitempty" json:"trackBreaks,omitempty"`
}
func (o Identify2ResUPK2) DeepCopy() Identify2ResUPK2 {
return Identify2ResUPK2{
Upk: o.Upk.DeepCopy(),
IdentifiedAt: o.IdentifiedAt.DeepCopy(),
TrackBreaks: (func(x *IdentifyTrackBreaks) *IdentifyTrackBreaks {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TrackBreaks),
}
}
type IdentifyLiteRes struct {
Ul UserOrTeamLite `codec:"ul" json:"ul"`
TrackBreaks *IdentifyTrackBreaks `codec:"trackBreaks,omitempty" json:"trackBreaks,omitempty"`
}
func (o IdentifyLiteRes) DeepCopy() IdentifyLiteRes {
return IdentifyLiteRes{
Ul: o.Ul.DeepCopy(),
TrackBreaks: (func(x *IdentifyTrackBreaks) *IdentifyTrackBreaks {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TrackBreaks),
}
}
type ResolveIdentifyImplicitTeamRes struct {
DisplayName string `codec:"displayName" json:"displayName"`
TeamID TeamID `codec:"teamID" json:"teamID"`
Writers []UserVersion `codec:"writers" json:"writers"`
TrackBreaks map[UserVersion]IdentifyTrackBreaks `codec:"trackBreaks" json:"trackBreaks"`
FolderID TLFID `codec:"folderID" json:"folderID"`
}
func (o ResolveIdentifyImplicitTeamRes) DeepCopy() ResolveIdentifyImplicitTeamRes {
return ResolveIdentifyImplicitTeamRes{
DisplayName: o.DisplayName,
TeamID: o.TeamID.DeepCopy(),
Writers: (func(x []UserVersion) []UserVersion {
if x == nil {
return nil
}
ret := make([]UserVersion, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Writers),
TrackBreaks: (func(x map[UserVersion]IdentifyTrackBreaks) map[UserVersion]IdentifyTrackBreaks {
if x == nil {
return nil
}
ret := make(map[UserVersion]IdentifyTrackBreaks, len(x))
for k, v := range x {
kCopy := k.DeepCopy()
vCopy := v.DeepCopy()
ret[kCopy] = vCopy
}
return ret
})(o.TrackBreaks),
FolderID: o.FolderID.DeepCopy(),
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/identify3.avdl
package keybase1

View File

@ -0,0 +1,16 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/identify3_common.avdl
package keybase1
type Identify3Assertion string
func (o Identify3Assertion) DeepCopy() Identify3Assertion {
return o
}
type Identify3GUIID string
func (o Identify3GUIID) DeepCopy() Identify3GUIID {
return o
}

View File

@ -0,0 +1,212 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/identify3_ui.avdl
package keybase1
import (
"fmt"
)
type Identify3RowState int
const (
Identify3RowState_CHECKING Identify3RowState = 1
Identify3RowState_VALID Identify3RowState = 2
Identify3RowState_ERROR Identify3RowState = 3
Identify3RowState_WARNING Identify3RowState = 4
Identify3RowState_REVOKED Identify3RowState = 5
)
func (o Identify3RowState) DeepCopy() Identify3RowState { return o }
var Identify3RowStateMap = map[string]Identify3RowState{
"CHECKING": 1,
"VALID": 2,
"ERROR": 3,
"WARNING": 4,
"REVOKED": 5,
}
var Identify3RowStateRevMap = map[Identify3RowState]string{
1: "CHECKING",
2: "VALID",
3: "ERROR",
4: "WARNING",
5: "REVOKED",
}
func (e Identify3RowState) String() string {
if v, ok := Identify3RowStateRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type Identify3RowColor int
const (
Identify3RowColor_BLUE Identify3RowColor = 1
Identify3RowColor_RED Identify3RowColor = 2
Identify3RowColor_BLACK Identify3RowColor = 3
Identify3RowColor_GREEN Identify3RowColor = 4
Identify3RowColor_GRAY Identify3RowColor = 5
Identify3RowColor_YELLOW Identify3RowColor = 6
Identify3RowColor_ORANGE Identify3RowColor = 7
)
func (o Identify3RowColor) DeepCopy() Identify3RowColor { return o }
var Identify3RowColorMap = map[string]Identify3RowColor{
"BLUE": 1,
"RED": 2,
"BLACK": 3,
"GREEN": 4,
"GRAY": 5,
"YELLOW": 6,
"ORANGE": 7,
}
var Identify3RowColorRevMap = map[Identify3RowColor]string{
1: "BLUE",
2: "RED",
3: "BLACK",
4: "GREEN",
5: "GRAY",
6: "YELLOW",
7: "ORANGE",
}
func (e Identify3RowColor) String() string {
if v, ok := Identify3RowColorRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type Identify3ResultType int
const (
Identify3ResultType_OK Identify3ResultType = 0
Identify3ResultType_BROKEN Identify3ResultType = 1
Identify3ResultType_NEEDS_UPGRADE Identify3ResultType = 2
Identify3ResultType_CANCELED Identify3ResultType = 3
)
func (o Identify3ResultType) DeepCopy() Identify3ResultType { return o }
var Identify3ResultTypeMap = map[string]Identify3ResultType{
"OK": 0,
"BROKEN": 1,
"NEEDS_UPGRADE": 2,
"CANCELED": 3,
}
var Identify3ResultTypeRevMap = map[Identify3ResultType]string{
0: "OK",
1: "BROKEN",
2: "NEEDS_UPGRADE",
3: "CANCELED",
}
func (e Identify3ResultType) String() string {
if v, ok := Identify3ResultTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type Identify3RowMeta struct {
Color Identify3RowColor `codec:"color" json:"color"`
Label string `codec:"label" json:"label"`
}
func (o Identify3RowMeta) DeepCopy() Identify3RowMeta {
return Identify3RowMeta{
Color: o.Color.DeepCopy(),
Label: o.Label,
}
}
type Identify3Row struct {
GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
Key string `codec:"key" json:"key"`
Value string `codec:"value" json:"value"`
Priority int `codec:"priority" json:"priority"`
SiteURL string `codec:"siteURL" json:"siteURL"`
SiteIcon []SizedImage `codec:"siteIcon" json:"siteIcon"`
SiteIconFull []SizedImage `codec:"siteIconFull" json:"siteIconFull"`
SiteIconWhite []SizedImage `codec:"siteIconWhite" json:"siteIconWhite"`
ProofURL string `codec:"proofURL" json:"proofURL"`
SigID SigID `codec:"sigID" json:"sigID"`
Ctime Time `codec:"ctime" json:"ctime"`
State Identify3RowState `codec:"state" json:"state"`
Metas []Identify3RowMeta `codec:"metas" json:"metas"`
Color Identify3RowColor `codec:"color" json:"color"`
Kid *KID `codec:"kid,omitempty" json:"kid,omitempty"`
}
func (o Identify3Row) DeepCopy() Identify3Row {
return Identify3Row{
GuiID: o.GuiID.DeepCopy(),
Key: o.Key,
Value: o.Value,
Priority: o.Priority,
SiteURL: o.SiteURL,
SiteIcon: (func(x []SizedImage) []SizedImage {
if x == nil {
return nil
}
ret := make([]SizedImage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.SiteIcon),
SiteIconFull: (func(x []SizedImage) []SizedImage {
if x == nil {
return nil
}
ret := make([]SizedImage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.SiteIconFull),
SiteIconWhite: (func(x []SizedImage) []SizedImage {
if x == nil {
return nil
}
ret := make([]SizedImage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.SiteIconWhite),
ProofURL: o.ProofURL,
SigID: o.SigID.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
State: o.State.DeepCopy(),
Metas: (func(x []Identify3RowMeta) []Identify3RowMeta {
if x == nil {
return nil
}
ret := make([]Identify3RowMeta, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Metas),
Color: o.Color.DeepCopy(),
Kid: (func(x *KID) *KID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Kid),
}
}

View File

@ -0,0 +1,322 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/identify_common.avdl
package keybase1
import (
"fmt"
)
type TrackToken string
func (o TrackToken) DeepCopy() TrackToken {
return o
}
type SigVersion int
func (o SigVersion) DeepCopy() SigVersion {
return o
}
type TrackDiffType int
const (
TrackDiffType_NONE TrackDiffType = 0
TrackDiffType_ERROR TrackDiffType = 1
TrackDiffType_CLASH TrackDiffType = 2
TrackDiffType_REVOKED TrackDiffType = 3
TrackDiffType_UPGRADED TrackDiffType = 4
TrackDiffType_NEW TrackDiffType = 5
TrackDiffType_REMOTE_FAIL TrackDiffType = 6
TrackDiffType_REMOTE_WORKING TrackDiffType = 7
TrackDiffType_REMOTE_CHANGED TrackDiffType = 8
TrackDiffType_NEW_ELDEST TrackDiffType = 9
TrackDiffType_NONE_VIA_TEMPORARY TrackDiffType = 10
)
func (o TrackDiffType) DeepCopy() TrackDiffType { return o }
var TrackDiffTypeMap = map[string]TrackDiffType{
"NONE": 0,
"ERROR": 1,
"CLASH": 2,
"REVOKED": 3,
"UPGRADED": 4,
"NEW": 5,
"REMOTE_FAIL": 6,
"REMOTE_WORKING": 7,
"REMOTE_CHANGED": 8,
"NEW_ELDEST": 9,
"NONE_VIA_TEMPORARY": 10,
}
var TrackDiffTypeRevMap = map[TrackDiffType]string{
0: "NONE",
1: "ERROR",
2: "CLASH",
3: "REVOKED",
4: "UPGRADED",
5: "NEW",
6: "REMOTE_FAIL",
7: "REMOTE_WORKING",
8: "REMOTE_CHANGED",
9: "NEW_ELDEST",
10: "NONE_VIA_TEMPORARY",
}
func (e TrackDiffType) String() string {
if v, ok := TrackDiffTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type TrackDiff struct {
Type TrackDiffType `codec:"type" json:"type"`
DisplayMarkup string `codec:"displayMarkup" json:"displayMarkup"`
}
func (o TrackDiff) DeepCopy() TrackDiff {
return TrackDiff{
Type: o.Type.DeepCopy(),
DisplayMarkup: o.DisplayMarkup,
}
}
type TrackSummary struct {
Username string `codec:"username" json:"username"`
Time Time `codec:"time" json:"time"`
IsRemote bool `codec:"isRemote" json:"isRemote"`
}
func (o TrackSummary) DeepCopy() TrackSummary {
return TrackSummary{
Username: o.Username,
Time: o.Time.DeepCopy(),
IsRemote: o.IsRemote,
}
}
// TrackStatus is a summary of this track before the track is approved by the
// user.
// NEW_*: New tracks
// UPDATE_*: Update to an existing track
// NEW_OK: Everything ok
// NEW_ZERO_PROOFS: User being tracked has no proofs
// NEW_FAIL_PROOFS: User being tracked has some failed proofs
// UPDATE_BROKEN: Previous tracking statement broken, this one will fix it.
// UPDATE_NEW_PROOFS: Previous tracking statement ok, but there are new proofs since previous tracking statement generated
// UPDATE_OK: No changes to previous tracking statement
type TrackStatus int
const (
TrackStatus_NEW_OK TrackStatus = 1
TrackStatus_NEW_ZERO_PROOFS TrackStatus = 2
TrackStatus_NEW_FAIL_PROOFS TrackStatus = 3
TrackStatus_UPDATE_BROKEN_FAILED_PROOFS TrackStatus = 4
TrackStatus_UPDATE_NEW_PROOFS TrackStatus = 5
TrackStatus_UPDATE_OK TrackStatus = 6
TrackStatus_UPDATE_BROKEN_REVOKED TrackStatus = 7
)
func (o TrackStatus) DeepCopy() TrackStatus { return o }
var TrackStatusMap = map[string]TrackStatus{
"NEW_OK": 1,
"NEW_ZERO_PROOFS": 2,
"NEW_FAIL_PROOFS": 3,
"UPDATE_BROKEN_FAILED_PROOFS": 4,
"UPDATE_NEW_PROOFS": 5,
"UPDATE_OK": 6,
"UPDATE_BROKEN_REVOKED": 7,
}
var TrackStatusRevMap = map[TrackStatus]string{
1: "NEW_OK",
2: "NEW_ZERO_PROOFS",
3: "NEW_FAIL_PROOFS",
4: "UPDATE_BROKEN_FAILED_PROOFS",
5: "UPDATE_NEW_PROOFS",
6: "UPDATE_OK",
7: "UPDATE_BROKEN_REVOKED",
}
func (e TrackStatus) String() string {
if v, ok := TrackStatusRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type TrackOptions struct {
LocalOnly bool `codec:"localOnly" json:"localOnly"`
BypassConfirm bool `codec:"bypassConfirm" json:"bypassConfirm"`
ForceRetrack bool `codec:"forceRetrack" json:"forceRetrack"`
ExpiringLocal bool `codec:"expiringLocal" json:"expiringLocal"`
ForPGPPull bool `codec:"forPGPPull" json:"forPGPPull"`
SigVersion *SigVersion `codec:"sigVersion,omitempty" json:"sigVersion,omitempty"`
}
func (o TrackOptions) DeepCopy() TrackOptions {
return TrackOptions{
LocalOnly: o.LocalOnly,
BypassConfirm: o.BypassConfirm,
ForceRetrack: o.ForceRetrack,
ExpiringLocal: o.ExpiringLocal,
ForPGPPull: o.ForPGPPull,
SigVersion: (func(x *SigVersion) *SigVersion {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.SigVersion),
}
}
type IdentifyReasonType int
const (
IdentifyReasonType_NONE IdentifyReasonType = 0
IdentifyReasonType_ID IdentifyReasonType = 1
IdentifyReasonType_TRACK IdentifyReasonType = 2
IdentifyReasonType_ENCRYPT IdentifyReasonType = 3
IdentifyReasonType_DECRYPT IdentifyReasonType = 4
IdentifyReasonType_VERIFY IdentifyReasonType = 5
IdentifyReasonType_RESOURCE IdentifyReasonType = 6
IdentifyReasonType_BACKGROUND IdentifyReasonType = 7
)
func (o IdentifyReasonType) DeepCopy() IdentifyReasonType { return o }
var IdentifyReasonTypeMap = map[string]IdentifyReasonType{
"NONE": 0,
"ID": 1,
"TRACK": 2,
"ENCRYPT": 3,
"DECRYPT": 4,
"VERIFY": 5,
"RESOURCE": 6,
"BACKGROUND": 7,
}
var IdentifyReasonTypeRevMap = map[IdentifyReasonType]string{
0: "NONE",
1: "ID",
2: "TRACK",
3: "ENCRYPT",
4: "DECRYPT",
5: "VERIFY",
6: "RESOURCE",
7: "BACKGROUND",
}
func (e IdentifyReasonType) String() string {
if v, ok := IdentifyReasonTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type IdentifyReason struct {
Type IdentifyReasonType `codec:"type" json:"type"`
Reason string `codec:"reason" json:"reason"`
Resource string `codec:"resource" json:"resource"`
}
func (o IdentifyReason) DeepCopy() IdentifyReason {
return IdentifyReason{
Type: o.Type.DeepCopy(),
Reason: o.Reason,
Resource: o.Resource,
}
}
type IdentifyOutcome struct {
Username string `codec:"username" json:"username"`
Status *Status `codec:"status,omitempty" json:"status,omitempty"`
Warnings []string `codec:"warnings" json:"warnings"`
TrackUsed *TrackSummary `codec:"trackUsed,omitempty" json:"trackUsed,omitempty"`
TrackStatus TrackStatus `codec:"trackStatus" json:"trackStatus"`
NumTrackFailures int `codec:"numTrackFailures" json:"numTrackFailures"`
NumTrackChanges int `codec:"numTrackChanges" json:"numTrackChanges"`
NumProofFailures int `codec:"numProofFailures" json:"numProofFailures"`
NumRevoked int `codec:"numRevoked" json:"numRevoked"`
NumProofSuccesses int `codec:"numProofSuccesses" json:"numProofSuccesses"`
Revoked []TrackDiff `codec:"revoked" json:"revoked"`
TrackOptions TrackOptions `codec:"trackOptions" json:"trackOptions"`
ForPGPPull bool `codec:"forPGPPull" json:"forPGPPull"`
Reason IdentifyReason `codec:"reason" json:"reason"`
}
func (o IdentifyOutcome) DeepCopy() IdentifyOutcome {
return IdentifyOutcome{
Username: o.Username,
Status: (func(x *Status) *Status {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Status),
Warnings: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.Warnings),
TrackUsed: (func(x *TrackSummary) *TrackSummary {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TrackUsed),
TrackStatus: o.TrackStatus.DeepCopy(),
NumTrackFailures: o.NumTrackFailures,
NumTrackChanges: o.NumTrackChanges,
NumProofFailures: o.NumProofFailures,
NumRevoked: o.NumRevoked,
NumProofSuccesses: o.NumProofSuccesses,
Revoked: (func(x []TrackDiff) []TrackDiff {
if x == nil {
return nil
}
ret := make([]TrackDiff, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Revoked),
TrackOptions: o.TrackOptions.DeepCopy(),
ForPGPPull: o.ForPGPPull,
Reason: o.Reason.DeepCopy(),
}
}
type RemoteProof struct {
ProofType ProofType `codec:"proofType" json:"proofType"`
Key string `codec:"key" json:"key"`
Value string `codec:"value" json:"value"`
DisplayMarkup string `codec:"displayMarkup" json:"displayMarkup"`
SigID SigID `codec:"sigID" json:"sigID"`
MTime Time `codec:"mTime" json:"mTime"`
}
func (o RemoteProof) DeepCopy() RemoteProof {
return RemoteProof{
ProofType: o.ProofType.DeepCopy(),
Key: o.Key,
Value: o.Value,
DisplayMarkup: o.DisplayMarkup,
SigID: o.SigID.DeepCopy(),
MTime: o.MTime.DeepCopy(),
}
}

View File

@ -0,0 +1,443 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/identify_ui.avdl
package keybase1
import (
"fmt"
)
type ProofResult struct {
State ProofState `codec:"state" json:"state"`
Status ProofStatus `codec:"status" json:"status"`
Desc string `codec:"desc" json:"desc"`
}
func (o ProofResult) DeepCopy() ProofResult {
return ProofResult{
State: o.State.DeepCopy(),
Status: o.Status.DeepCopy(),
Desc: o.Desc,
}
}
type IdentifyRow struct {
RowId int `codec:"rowId" json:"rowId"`
Proof RemoteProof `codec:"proof" json:"proof"`
TrackDiff *TrackDiff `codec:"trackDiff,omitempty" json:"trackDiff,omitempty"`
}
func (o IdentifyRow) DeepCopy() IdentifyRow {
return IdentifyRow{
RowId: o.RowId,
Proof: o.Proof.DeepCopy(),
TrackDiff: (func(x *TrackDiff) *TrackDiff {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TrackDiff),
}
}
type IdentifyKey struct {
PGPFingerprint []byte `codec:"pgpFingerprint" json:"pgpFingerprint"`
KID KID `codec:"KID" json:"KID"`
TrackDiff *TrackDiff `codec:"trackDiff,omitempty" json:"trackDiff,omitempty"`
BreaksTracking bool `codec:"breaksTracking" json:"breaksTracking"`
SigID SigID `codec:"sigID" json:"sigID"`
}
func (o IdentifyKey) DeepCopy() IdentifyKey {
return IdentifyKey{
PGPFingerprint: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.PGPFingerprint),
KID: o.KID.DeepCopy(),
TrackDiff: (func(x *TrackDiff) *TrackDiff {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.TrackDiff),
BreaksTracking: o.BreaksTracking,
SigID: o.SigID.DeepCopy(),
}
}
type Cryptocurrency struct {
RowId int `codec:"rowId" json:"rowId"`
Pkhash []byte `codec:"pkhash" json:"pkhash"`
Address string `codec:"address" json:"address"`
SigID SigID `codec:"sigID" json:"sigID"`
Type string `codec:"type" json:"type"`
Family string `codec:"family" json:"family"`
}
func (o Cryptocurrency) DeepCopy() Cryptocurrency {
return Cryptocurrency{
RowId: o.RowId,
Pkhash: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Pkhash),
Address: o.Address,
SigID: o.SigID.DeepCopy(),
Type: o.Type,
Family: o.Family,
}
}
type StellarAccount struct {
AccountID string `codec:"accountID" json:"accountID"`
FederationAddress string `codec:"federationAddress" json:"federationAddress"`
SigID SigID `codec:"sigID" json:"sigID"`
Hidden bool `codec:"hidden" json:"hidden"`
}
func (o StellarAccount) DeepCopy() StellarAccount {
return StellarAccount{
AccountID: o.AccountID,
FederationAddress: o.FederationAddress,
SigID: o.SigID.DeepCopy(),
Hidden: o.Hidden,
}
}
type RevokedProof struct {
Proof RemoteProof `codec:"proof" json:"proof"`
Diff TrackDiff `codec:"diff" json:"diff"`
Snoozed bool `codec:"snoozed" json:"snoozed"`
}
func (o RevokedProof) DeepCopy() RevokedProof {
return RevokedProof{
Proof: o.Proof.DeepCopy(),
Diff: o.Diff.DeepCopy(),
Snoozed: o.Snoozed,
}
}
type Identity struct {
Status *Status `codec:"status,omitempty" json:"status,omitempty"`
WhenLastTracked Time `codec:"whenLastTracked" json:"whenLastTracked"`
Proofs []IdentifyRow `codec:"proofs" json:"proofs"`
Cryptocurrency []Cryptocurrency `codec:"cryptocurrency" json:"cryptocurrency"`
Revoked []TrackDiff `codec:"revoked" json:"revoked"`
RevokedDetails []RevokedProof `codec:"revokedDetails" json:"revokedDetails"`
BreaksTracking bool `codec:"breaksTracking" json:"breaksTracking"`
}
func (o Identity) DeepCopy() Identity {
return Identity{
Status: (func(x *Status) *Status {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Status),
WhenLastTracked: o.WhenLastTracked.DeepCopy(),
Proofs: (func(x []IdentifyRow) []IdentifyRow {
if x == nil {
return nil
}
ret := make([]IdentifyRow, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Proofs),
Cryptocurrency: (func(x []Cryptocurrency) []Cryptocurrency {
if x == nil {
return nil
}
ret := make([]Cryptocurrency, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Cryptocurrency),
Revoked: (func(x []TrackDiff) []TrackDiff {
if x == nil {
return nil
}
ret := make([]TrackDiff, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Revoked),
RevokedDetails: (func(x []RevokedProof) []RevokedProof {
if x == nil {
return nil
}
ret := make([]RevokedProof, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RevokedDetails),
BreaksTracking: o.BreaksTracking,
}
}
type SigHint struct {
RemoteId string `codec:"remoteId" json:"remoteId"`
HumanUrl string `codec:"humanUrl" json:"humanUrl"`
ApiUrl string `codec:"apiUrl" json:"apiUrl"`
CheckText string `codec:"checkText" json:"checkText"`
}
func (o SigHint) DeepCopy() SigHint {
return SigHint{
RemoteId: o.RemoteId,
HumanUrl: o.HumanUrl,
ApiUrl: o.ApiUrl,
CheckText: o.CheckText,
}
}
type CheckResultFreshness int
const (
CheckResultFreshness_FRESH CheckResultFreshness = 0
CheckResultFreshness_AGED CheckResultFreshness = 1
CheckResultFreshness_RANCID CheckResultFreshness = 2
)
func (o CheckResultFreshness) DeepCopy() CheckResultFreshness { return o }
var CheckResultFreshnessMap = map[string]CheckResultFreshness{
"FRESH": 0,
"AGED": 1,
"RANCID": 2,
}
var CheckResultFreshnessRevMap = map[CheckResultFreshness]string{
0: "FRESH",
1: "AGED",
2: "RANCID",
}
func (e CheckResultFreshness) String() string {
if v, ok := CheckResultFreshnessRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type CheckResult struct {
ProofResult ProofResult `codec:"proofResult" json:"proofResult"`
Time Time `codec:"time" json:"time"`
Freshness CheckResultFreshness `codec:"freshness" json:"freshness"`
}
func (o CheckResult) DeepCopy() CheckResult {
return CheckResult{
ProofResult: o.ProofResult.DeepCopy(),
Time: o.Time.DeepCopy(),
Freshness: o.Freshness.DeepCopy(),
}
}
type LinkCheckResult struct {
ProofId int `codec:"proofId" json:"proofId"`
ProofResult ProofResult `codec:"proofResult" json:"proofResult"`
SnoozedResult ProofResult `codec:"snoozedResult" json:"snoozedResult"`
TorWarning bool `codec:"torWarning" json:"torWarning"`
TmpTrackExpireTime Time `codec:"tmpTrackExpireTime" json:"tmpTrackExpireTime"`
Cached *CheckResult `codec:"cached,omitempty" json:"cached,omitempty"`
Diff *TrackDiff `codec:"diff,omitempty" json:"diff,omitempty"`
RemoteDiff *TrackDiff `codec:"remoteDiff,omitempty" json:"remoteDiff,omitempty"`
Hint *SigHint `codec:"hint,omitempty" json:"hint,omitempty"`
BreaksTracking bool `codec:"breaksTracking" json:"breaksTracking"`
}
func (o LinkCheckResult) DeepCopy() LinkCheckResult {
return LinkCheckResult{
ProofId: o.ProofId,
ProofResult: o.ProofResult.DeepCopy(),
SnoozedResult: o.SnoozedResult.DeepCopy(),
TorWarning: o.TorWarning,
TmpTrackExpireTime: o.TmpTrackExpireTime.DeepCopy(),
Cached: (func(x *CheckResult) *CheckResult {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Cached),
Diff: (func(x *TrackDiff) *TrackDiff {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Diff),
RemoteDiff: (func(x *TrackDiff) *TrackDiff {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.RemoteDiff),
Hint: (func(x *SigHint) *SigHint {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Hint),
BreaksTracking: o.BreaksTracking,
}
}
type UserTeamShowcase struct {
FqName string `codec:"fqName" json:"fq_name"`
Open bool `codec:"open" json:"open"`
TeamIsShowcased bool `codec:"teamIsShowcased" json:"team_is_showcased"`
Description string `codec:"description" json:"description"`
Role TeamRole `codec:"role" json:"role"`
PublicAdmins []string `codec:"publicAdmins" json:"public_admins"`
NumMembers int `codec:"numMembers" json:"num_members"`
}
func (o UserTeamShowcase) DeepCopy() UserTeamShowcase {
return UserTeamShowcase{
FqName: o.FqName,
Open: o.Open,
TeamIsShowcased: o.TeamIsShowcased,
Description: o.Description,
Role: o.Role.DeepCopy(),
PublicAdmins: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.PublicAdmins),
NumMembers: o.NumMembers,
}
}
type UserCard struct {
Following int `codec:"following" json:"following"`
Followers int `codec:"followers" json:"followers"`
Uid UID `codec:"uid" json:"uid"`
FullName string `codec:"fullName" json:"fullName"`
Location string `codec:"location" json:"location"`
Bio string `codec:"bio" json:"bio"`
BioDecorated string `codec:"bioDecorated" json:"bioDecorated"`
Website string `codec:"website" json:"website"`
Twitter string `codec:"twitter" json:"twitter"`
YouFollowThem bool `codec:"youFollowThem" json:"youFollowThem"`
TheyFollowYou bool `codec:"theyFollowYou" json:"theyFollowYou"`
TeamShowcase []UserTeamShowcase `codec:"teamShowcase" json:"teamShowcase"`
RegisteredForAirdrop bool `codec:"registeredForAirdrop" json:"registeredForAirdrop"`
StellarHidden bool `codec:"stellarHidden" json:"stellarHidden"`
Blocked bool `codec:"blocked" json:"blocked"`
HidFromFollowers bool `codec:"hidFromFollowers" json:"hidFromFollowers"`
}
func (o UserCard) DeepCopy() UserCard {
return UserCard{
Following: o.Following,
Followers: o.Followers,
Uid: o.Uid.DeepCopy(),
FullName: o.FullName,
Location: o.Location,
Bio: o.Bio,
BioDecorated: o.BioDecorated,
Website: o.Website,
Twitter: o.Twitter,
YouFollowThem: o.YouFollowThem,
TheyFollowYou: o.TheyFollowYou,
TeamShowcase: (func(x []UserTeamShowcase) []UserTeamShowcase {
if x == nil {
return nil
}
ret := make([]UserTeamShowcase, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.TeamShowcase),
RegisteredForAirdrop: o.RegisteredForAirdrop,
StellarHidden: o.StellarHidden,
Blocked: o.Blocked,
HidFromFollowers: o.HidFromFollowers,
}
}
type ConfirmResult struct {
IdentityConfirmed bool `codec:"identityConfirmed" json:"identityConfirmed"`
RemoteConfirmed bool `codec:"remoteConfirmed" json:"remoteConfirmed"`
ExpiringLocal bool `codec:"expiringLocal" json:"expiringLocal"`
AutoConfirmed bool `codec:"autoConfirmed" json:"autoConfirmed"`
}
func (o ConfirmResult) DeepCopy() ConfirmResult {
return ConfirmResult{
IdentityConfirmed: o.IdentityConfirmed,
RemoteConfirmed: o.RemoteConfirmed,
ExpiringLocal: o.ExpiringLocal,
AutoConfirmed: o.AutoConfirmed,
}
}
type DismissReasonType int
const (
DismissReasonType_NONE DismissReasonType = 0
DismissReasonType_HANDLED_ELSEWHERE DismissReasonType = 1
)
func (o DismissReasonType) DeepCopy() DismissReasonType { return o }
var DismissReasonTypeMap = map[string]DismissReasonType{
"NONE": 0,
"HANDLED_ELSEWHERE": 1,
}
var DismissReasonTypeRevMap = map[DismissReasonType]string{
0: "NONE",
1: "HANDLED_ELSEWHERE",
}
func (e DismissReasonType) String() string {
if v, ok := DismissReasonTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type DismissReason struct {
Type DismissReasonType `codec:"type" json:"type"`
Reason string `codec:"reason" json:"reason"`
Resource string `codec:"resource" json:"resource"`
}
func (o DismissReason) DeepCopy() DismissReason {
return DismissReason{
Type: o.Type.DeepCopy(),
Reason: o.Reason,
Resource: o.Resource,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/implicit_team_migration.avdl
package keybase1

View File

@ -0,0 +1,236 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/install.avdl
package keybase1
// Install status describes state of install for a component or service.
type InstallStatus int
const (
InstallStatus_UNKNOWN InstallStatus = 0
InstallStatus_ERROR InstallStatus = 1
InstallStatus_NOT_INSTALLED InstallStatus = 2
InstallStatus_INSTALLED InstallStatus = 4
)
func (o InstallStatus) DeepCopy() InstallStatus { return o }
var InstallStatusMap = map[string]InstallStatus{
"UNKNOWN": 0,
"ERROR": 1,
"NOT_INSTALLED": 2,
"INSTALLED": 4,
}
var InstallStatusRevMap = map[InstallStatus]string{
0: "UNKNOWN",
1: "ERROR",
2: "NOT_INSTALLED",
4: "INSTALLED",
}
type InstallAction int
const (
InstallAction_UNKNOWN InstallAction = 0
InstallAction_NONE InstallAction = 1
InstallAction_UPGRADE InstallAction = 2
InstallAction_REINSTALL InstallAction = 3
InstallAction_INSTALL InstallAction = 4
)
func (o InstallAction) DeepCopy() InstallAction { return o }
var InstallActionMap = map[string]InstallAction{
"UNKNOWN": 0,
"NONE": 1,
"UPGRADE": 2,
"REINSTALL": 3,
"INSTALL": 4,
}
var InstallActionRevMap = map[InstallAction]string{
0: "UNKNOWN",
1: "NONE",
2: "UPGRADE",
3: "REINSTALL",
4: "INSTALL",
}
type ServiceStatus struct {
Version string `codec:"version" json:"version"`
Label string `codec:"label" json:"label"`
Pid string `codec:"pid" json:"pid"`
LastExitStatus string `codec:"lastExitStatus" json:"lastExitStatus"`
BundleVersion string `codec:"bundleVersion" json:"bundleVersion"`
InstallStatus InstallStatus `codec:"installStatus" json:"installStatus"`
InstallAction InstallAction `codec:"installAction" json:"installAction"`
Status Status `codec:"status" json:"status"`
}
func (o ServiceStatus) DeepCopy() ServiceStatus {
return ServiceStatus{
Version: o.Version,
Label: o.Label,
Pid: o.Pid,
LastExitStatus: o.LastExitStatus,
BundleVersion: o.BundleVersion,
InstallStatus: o.InstallStatus.DeepCopy(),
InstallAction: o.InstallAction.DeepCopy(),
Status: o.Status.DeepCopy(),
}
}
type ServicesStatus struct {
Service []ServiceStatus `codec:"service" json:"service"`
Kbfs []ServiceStatus `codec:"kbfs" json:"kbfs"`
Updater []ServiceStatus `codec:"updater" json:"updater"`
}
func (o ServicesStatus) DeepCopy() ServicesStatus {
return ServicesStatus{
Service: (func(x []ServiceStatus) []ServiceStatus {
if x == nil {
return nil
}
ret := make([]ServiceStatus, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Service),
Kbfs: (func(x []ServiceStatus) []ServiceStatus {
if x == nil {
return nil
}
ret := make([]ServiceStatus, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Kbfs),
Updater: (func(x []ServiceStatus) []ServiceStatus {
if x == nil {
return nil
}
ret := make([]ServiceStatus, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Updater),
}
}
type FuseMountInfo struct {
Path string `codec:"path" json:"path"`
Fstype string `codec:"fstype" json:"fstype"`
Output string `codec:"output" json:"output"`
}
func (o FuseMountInfo) DeepCopy() FuseMountInfo {
return FuseMountInfo{
Path: o.Path,
Fstype: o.Fstype,
Output: o.Output,
}
}
type FuseStatus struct {
Version string `codec:"version" json:"version"`
BundleVersion string `codec:"bundleVersion" json:"bundleVersion"`
KextID string `codec:"kextID" json:"kextID"`
Path string `codec:"path" json:"path"`
KextStarted bool `codec:"kextStarted" json:"kextStarted"`
InstallStatus InstallStatus `codec:"installStatus" json:"installStatus"`
InstallAction InstallAction `codec:"installAction" json:"installAction"`
MountInfos []FuseMountInfo `codec:"mountInfos" json:"mountInfos"`
Status Status `codec:"status" json:"status"`
}
func (o FuseStatus) DeepCopy() FuseStatus {
return FuseStatus{
Version: o.Version,
BundleVersion: o.BundleVersion,
KextID: o.KextID,
Path: o.Path,
KextStarted: o.KextStarted,
InstallStatus: o.InstallStatus.DeepCopy(),
InstallAction: o.InstallAction.DeepCopy(),
MountInfos: (func(x []FuseMountInfo) []FuseMountInfo {
if x == nil {
return nil
}
ret := make([]FuseMountInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.MountInfos),
Status: o.Status.DeepCopy(),
}
}
type ComponentResult struct {
Name string `codec:"name" json:"name"`
Status Status `codec:"status" json:"status"`
ExitCode int `codec:"exitCode" json:"exitCode"`
}
func (o ComponentResult) DeepCopy() ComponentResult {
return ComponentResult{
Name: o.Name,
Status: o.Status.DeepCopy(),
ExitCode: o.ExitCode,
}
}
type InstallResult struct {
ComponentResults []ComponentResult `codec:"componentResults" json:"componentResults"`
Status Status `codec:"status" json:"status"`
Fatal bool `codec:"fatal" json:"fatal"`
}
func (o InstallResult) DeepCopy() InstallResult {
return InstallResult{
ComponentResults: (func(x []ComponentResult) []ComponentResult {
if x == nil {
return nil
}
ret := make([]ComponentResult, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ComponentResults),
Status: o.Status.DeepCopy(),
Fatal: o.Fatal,
}
}
type UninstallResult struct {
ComponentResults []ComponentResult `codec:"componentResults" json:"componentResults"`
Status Status `codec:"status" json:"status"`
}
func (o UninstallResult) DeepCopy() UninstallResult {
return UninstallResult{
ComponentResults: (func(x []ComponentResult) []ComponentResult {
if x == nil {
return nil
}
ret := make([]ComponentResult, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.ComponentResults),
Status: o.Status.DeepCopy(),
}
}

View File

@ -0,0 +1,14 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kbfs.avdl
package keybase1
type KBFSTeamSettings struct {
TlfID TLFID `codec:"tlfID" json:"tlfID"`
}
func (o KBFSTeamSettings) DeepCopy() KBFSTeamSettings {
return KBFSTeamSettings{
TlfID: o.TlfID.DeepCopy(),
}
}

View File

@ -0,0 +1,366 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kbfs_common.avdl
package keybase1
import (
"fmt"
)
type FSStatusCode int
const (
FSStatusCode_START FSStatusCode = 0
FSStatusCode_FINISH FSStatusCode = 1
FSStatusCode_ERROR FSStatusCode = 2
)
func (o FSStatusCode) DeepCopy() FSStatusCode { return o }
var FSStatusCodeMap = map[string]FSStatusCode{
"START": 0,
"FINISH": 1,
"ERROR": 2,
}
var FSStatusCodeRevMap = map[FSStatusCode]string{
0: "START",
1: "FINISH",
2: "ERROR",
}
func (e FSStatusCode) String() string {
if v, ok := FSStatusCodeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type FSNotificationType int
const (
FSNotificationType_ENCRYPTING FSNotificationType = 0
FSNotificationType_DECRYPTING FSNotificationType = 1
FSNotificationType_SIGNING FSNotificationType = 2
FSNotificationType_VERIFYING FSNotificationType = 3
FSNotificationType_REKEYING FSNotificationType = 4
FSNotificationType_CONNECTION FSNotificationType = 5
FSNotificationType_MD_READ_SUCCESS FSNotificationType = 6
FSNotificationType_FILE_CREATED FSNotificationType = 7
FSNotificationType_FILE_MODIFIED FSNotificationType = 8
FSNotificationType_FILE_DELETED FSNotificationType = 9
FSNotificationType_FILE_RENAMED FSNotificationType = 10
FSNotificationType_INITIALIZED FSNotificationType = 11
FSNotificationType_SYNC_CONFIG_CHANGED FSNotificationType = 12
)
func (o FSNotificationType) DeepCopy() FSNotificationType { return o }
var FSNotificationTypeMap = map[string]FSNotificationType{
"ENCRYPTING": 0,
"DECRYPTING": 1,
"SIGNING": 2,
"VERIFYING": 3,
"REKEYING": 4,
"CONNECTION": 5,
"MD_READ_SUCCESS": 6,
"FILE_CREATED": 7,
"FILE_MODIFIED": 8,
"FILE_DELETED": 9,
"FILE_RENAMED": 10,
"INITIALIZED": 11,
"SYNC_CONFIG_CHANGED": 12,
}
var FSNotificationTypeRevMap = map[FSNotificationType]string{
0: "ENCRYPTING",
1: "DECRYPTING",
2: "SIGNING",
3: "VERIFYING",
4: "REKEYING",
5: "CONNECTION",
6: "MD_READ_SUCCESS",
7: "FILE_CREATED",
8: "FILE_MODIFIED",
9: "FILE_DELETED",
10: "FILE_RENAMED",
11: "INITIALIZED",
12: "SYNC_CONFIG_CHANGED",
}
func (e FSNotificationType) String() string {
if v, ok := FSNotificationTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type FSErrorType int
const (
FSErrorType_ACCESS_DENIED FSErrorType = 0
FSErrorType_USER_NOT_FOUND FSErrorType = 1
FSErrorType_REVOKED_DATA_DETECTED FSErrorType = 2
FSErrorType_NOT_LOGGED_IN FSErrorType = 3
FSErrorType_TIMEOUT FSErrorType = 4
FSErrorType_REKEY_NEEDED FSErrorType = 5
FSErrorType_BAD_FOLDER FSErrorType = 6
FSErrorType_NOT_IMPLEMENTED FSErrorType = 7
FSErrorType_OLD_VERSION FSErrorType = 8
FSErrorType_OVER_QUOTA FSErrorType = 9
FSErrorType_NO_SIG_CHAIN FSErrorType = 10
FSErrorType_TOO_MANY_FOLDERS FSErrorType = 11
FSErrorType_EXDEV_NOT_SUPPORTED FSErrorType = 12
FSErrorType_DISK_LIMIT_REACHED FSErrorType = 13
FSErrorType_DISK_CACHE_ERROR_LOG_SEND FSErrorType = 14
FSErrorType_OFFLINE_ARCHIVED FSErrorType = 15
FSErrorType_OFFLINE_UNSYNCED FSErrorType = 16
)
func (o FSErrorType) DeepCopy() FSErrorType { return o }
var FSErrorTypeMap = map[string]FSErrorType{
"ACCESS_DENIED": 0,
"USER_NOT_FOUND": 1,
"REVOKED_DATA_DETECTED": 2,
"NOT_LOGGED_IN": 3,
"TIMEOUT": 4,
"REKEY_NEEDED": 5,
"BAD_FOLDER": 6,
"NOT_IMPLEMENTED": 7,
"OLD_VERSION": 8,
"OVER_QUOTA": 9,
"NO_SIG_CHAIN": 10,
"TOO_MANY_FOLDERS": 11,
"EXDEV_NOT_SUPPORTED": 12,
"DISK_LIMIT_REACHED": 13,
"DISK_CACHE_ERROR_LOG_SEND": 14,
"OFFLINE_ARCHIVED": 15,
"OFFLINE_UNSYNCED": 16,
}
var FSErrorTypeRevMap = map[FSErrorType]string{
0: "ACCESS_DENIED",
1: "USER_NOT_FOUND",
2: "REVOKED_DATA_DETECTED",
3: "NOT_LOGGED_IN",
4: "TIMEOUT",
5: "REKEY_NEEDED",
6: "BAD_FOLDER",
7: "NOT_IMPLEMENTED",
8: "OLD_VERSION",
9: "OVER_QUOTA",
10: "NO_SIG_CHAIN",
11: "TOO_MANY_FOLDERS",
12: "EXDEV_NOT_SUPPORTED",
13: "DISK_LIMIT_REACHED",
14: "DISK_CACHE_ERROR_LOG_SEND",
15: "OFFLINE_ARCHIVED",
16: "OFFLINE_UNSYNCED",
}
func (e FSErrorType) String() string {
if v, ok := FSErrorTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type FSNotification struct {
Filename string `codec:"filename" json:"filename"`
Status string `codec:"status" json:"status"`
StatusCode FSStatusCode `codec:"statusCode" json:"statusCode"`
NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"`
ErrorType FSErrorType `codec:"errorType" json:"errorType"`
Params map[string]string `codec:"params" json:"params"`
WriterUid UID `codec:"writerUid" json:"writerUid"`
LocalTime Time `codec:"localTime" json:"localTime"`
FolderType FolderType `codec:"folderType" json:"folderType"`
}
func (o FSNotification) DeepCopy() FSNotification {
return FSNotification{
Filename: o.Filename,
Status: o.Status,
StatusCode: o.StatusCode.DeepCopy(),
NotificationType: o.NotificationType.DeepCopy(),
ErrorType: o.ErrorType.DeepCopy(),
Params: (func(x map[string]string) map[string]string {
if x == nil {
return nil
}
ret := make(map[string]string, len(x))
for k, v := range x {
kCopy := k
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.Params),
WriterUid: o.WriterUid.DeepCopy(),
LocalTime: o.LocalTime.DeepCopy(),
FolderType: o.FolderType.DeepCopy(),
}
}
type FSEditListRequest struct {
Folder Folder `codec:"folder" json:"folder"`
RequestID int `codec:"requestID" json:"requestID"`
}
func (o FSEditListRequest) DeepCopy() FSEditListRequest {
return FSEditListRequest{
Folder: o.Folder.DeepCopy(),
RequestID: o.RequestID,
}
}
type FSFolderWriterEdit struct {
Filename string `codec:"filename" json:"filename"`
NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"`
ServerTime Time `codec:"serverTime" json:"serverTime"`
}
func (o FSFolderWriterEdit) DeepCopy() FSFolderWriterEdit {
return FSFolderWriterEdit{
Filename: o.Filename,
NotificationType: o.NotificationType.DeepCopy(),
ServerTime: o.ServerTime.DeepCopy(),
}
}
type FSFolderWriterEditHistory struct {
WriterName string `codec:"writerName" json:"writerName"`
Edits []FSFolderWriterEdit `codec:"edits" json:"edits"`
Deletes []FSFolderWriterEdit `codec:"deletes" json:"deletes"`
}
func (o FSFolderWriterEditHistory) DeepCopy() FSFolderWriterEditHistory {
return FSFolderWriterEditHistory{
WriterName: o.WriterName,
Edits: (func(x []FSFolderWriterEdit) []FSFolderWriterEdit {
if x == nil {
return nil
}
ret := make([]FSFolderWriterEdit, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Edits),
Deletes: (func(x []FSFolderWriterEdit) []FSFolderWriterEdit {
if x == nil {
return nil
}
ret := make([]FSFolderWriterEdit, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Deletes),
}
}
type FSFolderEditHistory struct {
Folder Folder `codec:"folder" json:"folder"`
ServerTime Time `codec:"serverTime" json:"serverTime"`
History []FSFolderWriterEditHistory `codec:"history" json:"history"`
}
func (o FSFolderEditHistory) DeepCopy() FSFolderEditHistory {
return FSFolderEditHistory{
Folder: o.Folder.DeepCopy(),
ServerTime: o.ServerTime.DeepCopy(),
History: (func(x []FSFolderWriterEditHistory) []FSFolderWriterEditHistory {
if x == nil {
return nil
}
ret := make([]FSFolderWriterEditHistory, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.History),
}
}
type FSSyncStatusRequest struct {
RequestID int `codec:"requestID" json:"requestID"`
}
func (o FSSyncStatusRequest) DeepCopy() FSSyncStatusRequest {
return FSSyncStatusRequest{
RequestID: o.RequestID,
}
}
type FSPathSyncStatus struct {
FolderType FolderType `codec:"folderType" json:"folderType"`
Path string `codec:"path" json:"path"`
SyncingBytes int64 `codec:"syncingBytes" json:"syncingBytes"`
SyncingOps int64 `codec:"syncingOps" json:"syncingOps"`
SyncedBytes int64 `codec:"syncedBytes" json:"syncedBytes"`
}
func (o FSPathSyncStatus) DeepCopy() FSPathSyncStatus {
return FSPathSyncStatus{
FolderType: o.FolderType.DeepCopy(),
Path: o.Path,
SyncingBytes: o.SyncingBytes,
SyncingOps: o.SyncingOps,
SyncedBytes: o.SyncedBytes,
}
}
type FSSyncStatus struct {
TotalSyncingBytes int64 `codec:"totalSyncingBytes" json:"totalSyncingBytes"`
SyncingPaths []string `codec:"syncingPaths" json:"syncingPaths"`
EndEstimate *Time `codec:"endEstimate,omitempty" json:"endEstimate,omitempty"`
}
func (o FSSyncStatus) DeepCopy() FSSyncStatus {
return FSSyncStatus{
TotalSyncingBytes: o.TotalSyncingBytes,
SyncingPaths: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.SyncingPaths),
EndEstimate: (func(x *Time) *Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.EndEstimate),
}
}
type FolderSyncStatus struct {
LocalDiskBytesAvailable int64 `codec:"localDiskBytesAvailable" json:"localDiskBytesAvailable"`
LocalDiskBytesTotal int64 `codec:"localDiskBytesTotal" json:"localDiskBytesTotal"`
PrefetchStatus PrefetchStatus `codec:"prefetchStatus" json:"prefetchStatus"`
PrefetchProgress PrefetchProgress `codec:"prefetchProgress" json:"prefetchProgress"`
StoredBytesTotal int64 `codec:"storedBytesTotal" json:"storedBytesTotal"`
OutOfSyncSpace bool `codec:"outOfSyncSpace" json:"outOfSyncSpace"`
}
func (o FolderSyncStatus) DeepCopy() FolderSyncStatus {
return FolderSyncStatus{
LocalDiskBytesAvailable: o.LocalDiskBytesAvailable,
LocalDiskBytesTotal: o.LocalDiskBytesTotal,
PrefetchStatus: o.PrefetchStatus.DeepCopy(),
PrefetchProgress: o.PrefetchProgress.DeepCopy(),
StoredBytesTotal: o.StoredBytesTotal,
OutOfSyncSpace: o.OutOfSyncSpace,
}
}

View File

@ -0,0 +1,20 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kbfs_git.avdl
package keybase1
type GcOptions struct {
MaxLooseRefs int `codec:"maxLooseRefs" json:"maxLooseRefs"`
PruneMinLooseObjects int `codec:"pruneMinLooseObjects" json:"pruneMinLooseObjects"`
PruneExpireTime Time `codec:"pruneExpireTime" json:"pruneExpireTime"`
MaxObjectPacks int `codec:"maxObjectPacks" json:"maxObjectPacks"`
}
func (o GcOptions) DeepCopy() GcOptions {
return GcOptions{
MaxLooseRefs: o.MaxLooseRefs,
PruneMinLooseObjects: o.PruneMinLooseObjects,
PruneExpireTime: o.PruneExpireTime.DeepCopy(),
MaxObjectPacks: o.MaxObjectPacks,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kbfsmount.avdl
package keybase1

View File

@ -0,0 +1,39 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kex2provisionee.avdl
package keybase1
type PassphraseStream struct {
PassphraseStream []byte `codec:"passphraseStream" json:"passphraseStream"`
Generation int `codec:"generation" json:"generation"`
}
func (o PassphraseStream) DeepCopy() PassphraseStream {
return PassphraseStream{
PassphraseStream: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.PassphraseStream),
Generation: o.Generation,
}
}
type SessionToken string
func (o SessionToken) DeepCopy() SessionToken {
return o
}
type CsrfToken string
func (o CsrfToken) DeepCopy() CsrfToken {
return o
}
type HelloRes string
func (o HelloRes) DeepCopy() HelloRes {
return o
}

View File

@ -0,0 +1,32 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kex2provisionee2.avdl
package keybase1
type Hello2Res struct {
EncryptionKey KID `codec:"encryptionKey" json:"encryptionKey"`
SigPayload HelloRes `codec:"sigPayload" json:"sigPayload"`
DeviceEkKID KID `codec:"deviceEkKID" json:"deviceEkKID"`
}
func (o Hello2Res) DeepCopy() Hello2Res {
return Hello2Res{
EncryptionKey: o.EncryptionKey.DeepCopy(),
SigPayload: o.SigPayload.DeepCopy(),
DeviceEkKID: o.DeviceEkKID.DeepCopy(),
}
}
type PerUserKeyBox struct {
Generation PerUserKeyGeneration `codec:"generation" json:"generation"`
Box string `codec:"box" json:"box"`
ReceiverKID KID `codec:"receiverKID" json:"receiver_kid"`
}
func (o PerUserKeyBox) DeepCopy() PerUserKeyBox {
return PerUserKeyBox{
Generation: o.Generation.DeepCopy(),
Box: o.Box,
ReceiverKID: o.ReceiverKID.DeepCopy(),
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kex2provisioner.avdl
package keybase1

View File

@ -0,0 +1,150 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/kvstore.avdl
package keybase1
type KVGetResult struct {
TeamName string `codec:"teamName" json:"teamName"`
Namespace string `codec:"namespace" json:"namespace"`
EntryKey string `codec:"entryKey" json:"entryKey"`
EntryValue string `codec:"entryValue" json:"entryValue"`
Revision int `codec:"revision" json:"revision"`
}
func (o KVGetResult) DeepCopy() KVGetResult {
return KVGetResult{
TeamName: o.TeamName,
Namespace: o.Namespace,
EntryKey: o.EntryKey,
EntryValue: o.EntryValue,
Revision: o.Revision,
}
}
type KVPutResult struct {
TeamName string `codec:"teamName" json:"teamName"`
Namespace string `codec:"namespace" json:"namespace"`
EntryKey string `codec:"entryKey" json:"entryKey"`
Revision int `codec:"revision" json:"revision"`
}
func (o KVPutResult) DeepCopy() KVPutResult {
return KVPutResult{
TeamName: o.TeamName,
Namespace: o.Namespace,
EntryKey: o.EntryKey,
Revision: o.Revision,
}
}
type KVEntryID struct {
TeamID TeamID `codec:"teamID" json:"teamID"`
Namespace string `codec:"namespace" json:"namespace"`
EntryKey string `codec:"entryKey" json:"entryKey"`
}
func (o KVEntryID) DeepCopy() KVEntryID {
return KVEntryID{
TeamID: o.TeamID.DeepCopy(),
Namespace: o.Namespace,
EntryKey: o.EntryKey,
}
}
type EncryptedKVEntry struct {
V int `codec:"v" json:"v"`
E []byte `codec:"e" json:"e"`
N []byte `codec:"n" json:"n"`
}
func (o EncryptedKVEntry) DeepCopy() EncryptedKVEntry {
return EncryptedKVEntry{
V: o.V,
E: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.E),
N: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.N),
}
}
type KVListNamespaceResult struct {
TeamName string `codec:"teamName" json:"teamName"`
Namespaces []string `codec:"namespaces" json:"namespaces"`
}
func (o KVListNamespaceResult) DeepCopy() KVListNamespaceResult {
return KVListNamespaceResult{
TeamName: o.TeamName,
Namespaces: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.Namespaces),
}
}
type KVListEntryKey struct {
EntryKey string `codec:"entryKey" json:"entryKey"`
Revision int `codec:"revision" json:"revision"`
}
func (o KVListEntryKey) DeepCopy() KVListEntryKey {
return KVListEntryKey{
EntryKey: o.EntryKey,
Revision: o.Revision,
}
}
type KVListEntryResult struct {
TeamName string `codec:"teamName" json:"teamName"`
Namespace string `codec:"namespace" json:"namespace"`
EntryKeys []KVListEntryKey `codec:"entryKeys" json:"entryKeys"`
}
func (o KVListEntryResult) DeepCopy() KVListEntryResult {
return KVListEntryResult{
TeamName: o.TeamName,
Namespace: o.Namespace,
EntryKeys: (func(x []KVListEntryKey) []KVListEntryKey {
if x == nil {
return nil
}
ret := make([]KVListEntryKey, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.EntryKeys),
}
}
type KVDeleteEntryResult struct {
TeamName string `codec:"teamName" json:"teamName"`
Namespace string `codec:"namespace" json:"namespace"`
EntryKey string `codec:"entryKey" json:"entryKey"`
Revision int `codec:"revision" json:"revision"`
}
func (o KVDeleteEntryResult) DeepCopy() KVDeleteEntryResult {
return KVDeleteEntryResult{
TeamName: o.TeamName,
Namespace: o.Namespace,
EntryKey: o.EntryKey,
Revision: o.Revision,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/log.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/log_ui.avdl
package keybase1

View File

@ -0,0 +1,20 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/login.avdl
package keybase1
type ConfiguredAccount struct {
Username string `codec:"username" json:"username"`
Fullname FullName `codec:"fullname" json:"fullname"`
HasStoredSecret bool `codec:"hasStoredSecret" json:"hasStoredSecret"`
IsCurrent bool `codec:"isCurrent" json:"isCurrent"`
}
func (o ConfiguredAccount) DeepCopy() ConfiguredAccount {
return ConfiguredAccount{
Username: o.Username,
Fullname: o.Fullname.DeepCopy(),
HasStoredSecret: o.HasStoredSecret,
IsCurrent: o.IsCurrent,
}
}

View File

@ -0,0 +1,196 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/login_ui.avdl
package keybase1
import (
"errors"
"fmt"
)
type ResetPromptType int
const (
ResetPromptType_COMPLETE ResetPromptType = 0
ResetPromptType_ENTER_NO_DEVICES ResetPromptType = 1
ResetPromptType_ENTER_FORGOT_PW ResetPromptType = 2
ResetPromptType_ENTER_RESET_PW ResetPromptType = 3
)
func (o ResetPromptType) DeepCopy() ResetPromptType { return o }
var ResetPromptTypeMap = map[string]ResetPromptType{
"COMPLETE": 0,
"ENTER_NO_DEVICES": 1,
"ENTER_FORGOT_PW": 2,
"ENTER_RESET_PW": 3,
}
var ResetPromptTypeRevMap = map[ResetPromptType]string{
0: "COMPLETE",
1: "ENTER_NO_DEVICES",
2: "ENTER_FORGOT_PW",
3: "ENTER_RESET_PW",
}
func (e ResetPromptType) String() string {
if v, ok := ResetPromptTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ResetPromptInfo struct {
HasWallet bool `codec:"hasWallet" json:"hasWallet"`
}
func (o ResetPromptInfo) DeepCopy() ResetPromptInfo {
return ResetPromptInfo{
HasWallet: o.HasWallet,
}
}
type ResetPrompt struct {
T__ ResetPromptType `codec:"t" json:"t"`
Complete__ *ResetPromptInfo `codec:"complete,omitempty" json:"complete,omitempty"`
}
func (o *ResetPrompt) T() (ret ResetPromptType, err error) {
switch o.T__ {
case ResetPromptType_COMPLETE:
if o.Complete__ == nil {
err = errors.New("unexpected nil value for Complete__")
return ret, err
}
}
return o.T__, nil
}
func (o ResetPrompt) Complete() (res ResetPromptInfo) {
if o.T__ != ResetPromptType_COMPLETE {
panic("wrong case accessed")
}
if o.Complete__ == nil {
return
}
return *o.Complete__
}
func NewResetPromptWithComplete(v ResetPromptInfo) ResetPrompt {
return ResetPrompt{
T__: ResetPromptType_COMPLETE,
Complete__: &v,
}
}
func NewResetPromptDefault(t ResetPromptType) ResetPrompt {
return ResetPrompt{
T__: t,
}
}
func (o ResetPrompt) DeepCopy() ResetPrompt {
return ResetPrompt{
T__: o.T__.DeepCopy(),
Complete__: (func(x *ResetPromptInfo) *ResetPromptInfo {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Complete__),
}
}
type ResetPromptResponse int
const (
ResetPromptResponse_NOTHING ResetPromptResponse = 0
ResetPromptResponse_CANCEL_RESET ResetPromptResponse = 1
ResetPromptResponse_CONFIRM_RESET ResetPromptResponse = 2
)
func (o ResetPromptResponse) DeepCopy() ResetPromptResponse { return o }
var ResetPromptResponseMap = map[string]ResetPromptResponse{
"NOTHING": 0,
"CANCEL_RESET": 1,
"CONFIRM_RESET": 2,
}
var ResetPromptResponseRevMap = map[ResetPromptResponse]string{
0: "NOTHING",
1: "CANCEL_RESET",
2: "CONFIRM_RESET",
}
func (e ResetPromptResponse) String() string {
if v, ok := ResetPromptResponseRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type PassphraseRecoveryPromptType int
const (
PassphraseRecoveryPromptType_ENCRYPTED_PGP_KEYS PassphraseRecoveryPromptType = 0
)
func (o PassphraseRecoveryPromptType) DeepCopy() PassphraseRecoveryPromptType { return o }
var PassphraseRecoveryPromptTypeMap = map[string]PassphraseRecoveryPromptType{
"ENCRYPTED_PGP_KEYS": 0,
}
var PassphraseRecoveryPromptTypeRevMap = map[PassphraseRecoveryPromptType]string{
0: "ENCRYPTED_PGP_KEYS",
}
func (e PassphraseRecoveryPromptType) String() string {
if v, ok := PassphraseRecoveryPromptTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ResetMessage int
const (
ResetMessage_ENTERED_VERIFIED ResetMessage = 0
ResetMessage_ENTERED_PASSWORDLESS ResetMessage = 1
ResetMessage_REQUEST_VERIFIED ResetMessage = 2
ResetMessage_NOT_COMPLETED ResetMessage = 3
ResetMessage_CANCELED ResetMessage = 4
ResetMessage_COMPLETED ResetMessage = 5
ResetMessage_RESET_LINK_SENT ResetMessage = 6
)
func (o ResetMessage) DeepCopy() ResetMessage { return o }
var ResetMessageMap = map[string]ResetMessage{
"ENTERED_VERIFIED": 0,
"ENTERED_PASSWORDLESS": 1,
"REQUEST_VERIFIED": 2,
"NOT_COMPLETED": 3,
"CANCELED": 4,
"COMPLETED": 5,
"RESET_LINK_SENT": 6,
}
var ResetMessageRevMap = map[ResetMessage]string{
0: "ENTERED_VERIFIED",
1: "ENTERED_PASSWORDLESS",
2: "REQUEST_VERIFIED",
3: "NOT_COMPLETED",
4: "CANCELED",
5: "COMPLETED",
6: "RESET_LINK_SENT",
}
func (e ResetMessage) String() string {
if v, ok := ResetMessageRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/logsend.avdl
package keybase1

View File

@ -0,0 +1,41 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/merkle.avdl
package keybase1
type MerkleRootAndTime struct {
Root MerkleRootV2 `codec:"root" json:"root"`
UpdateTime Time `codec:"updateTime" json:"updateTime"`
FetchTime Time `codec:"fetchTime" json:"fetchTime"`
}
func (o MerkleRootAndTime) DeepCopy() MerkleRootAndTime {
return MerkleRootAndTime{
Root: o.Root.DeepCopy(),
UpdateTime: o.UpdateTime.DeepCopy(),
FetchTime: o.FetchTime.DeepCopy(),
}
}
type KBFSRootHash []byte
func (o KBFSRootHash) DeepCopy() KBFSRootHash {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type KBFSRoot struct {
TreeID MerkleTreeID `codec:"treeID" json:"treeID"`
Root KBFSRootHash `codec:"root" json:"root"`
}
func (o KBFSRoot) DeepCopy() KBFSRoot {
return KBFSRoot{
TreeID: o.TreeID.DeepCopy(),
Root: o.Root.DeepCopy(),
}
}

View File

@ -0,0 +1,40 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/merkle_store.avdl
package keybase1
type MerkleStoreSupportedVersion int
func (o MerkleStoreSupportedVersion) DeepCopy() MerkleStoreSupportedVersion {
return o
}
type MerkleStoreKitHash string
func (o MerkleStoreKitHash) DeepCopy() MerkleStoreKitHash {
return o
}
type MerkleStoreKit string
func (o MerkleStoreKit) DeepCopy() MerkleStoreKit {
return o
}
type MerkleStoreEntryString string
func (o MerkleStoreEntryString) DeepCopy() MerkleStoreEntryString {
return o
}
type MerkleStoreEntry struct {
Hash MerkleStoreKitHash `codec:"hash" json:"hash"`
Entry MerkleStoreEntryString `codec:"entry" json:"entry"`
}
func (o MerkleStoreEntry) DeepCopy() MerkleStoreEntry {
return MerkleStoreEntry{
Hash: o.Hash.DeepCopy(),
Entry: o.Entry.DeepCopy(),
}
}

View File

@ -0,0 +1,175 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/metadata.avdl
package keybase1
type KeyHalf struct {
User UID `codec:"user" json:"user"`
DeviceKID KID `codec:"deviceKID" json:"deviceKID"`
Key []byte `codec:"key" json:"key"`
}
func (o KeyHalf) DeepCopy() KeyHalf {
return KeyHalf{
User: o.User.DeepCopy(),
DeviceKID: o.DeviceKID.DeepCopy(),
Key: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Key),
}
}
type MDBlock struct {
Version int `codec:"version" json:"version"`
Timestamp Time `codec:"timestamp" json:"timestamp"`
Block []byte `codec:"block" json:"block"`
}
func (o MDBlock) DeepCopy() MDBlock {
return MDBlock{
Version: o.Version,
Timestamp: o.Timestamp.DeepCopy(),
Block: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Block),
}
}
type KeyBundle struct {
Version int `codec:"version" json:"version"`
Bundle []byte `codec:"bundle" json:"bundle"`
}
func (o KeyBundle) DeepCopy() KeyBundle {
return KeyBundle{
Version: o.Version,
Bundle: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Bundle),
}
}
type MetadataResponse struct {
FolderID string `codec:"folderID" json:"folderID"`
MdBlocks []MDBlock `codec:"mdBlocks" json:"mdBlocks"`
}
func (o MetadataResponse) DeepCopy() MetadataResponse {
return MetadataResponse{
FolderID: o.FolderID,
MdBlocks: (func(x []MDBlock) []MDBlock {
if x == nil {
return nil
}
ret := make([]MDBlock, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.MdBlocks),
}
}
type MerkleRoot struct {
Version int `codec:"version" json:"version"`
Root []byte `codec:"root" json:"root"`
}
func (o MerkleRoot) DeepCopy() MerkleRoot {
return MerkleRoot{
Version: o.Version,
Root: (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o.Root),
}
}
type PingResponse struct {
Timestamp Time `codec:"timestamp" json:"timestamp"`
}
func (o PingResponse) DeepCopy() PingResponse {
return PingResponse{
Timestamp: o.Timestamp.DeepCopy(),
}
}
type KeyBundleResponse struct {
WriterBundle KeyBundle `codec:"WriterBundle" json:"WriterBundle"`
ReaderBundle KeyBundle `codec:"ReaderBundle" json:"ReaderBundle"`
}
func (o KeyBundleResponse) DeepCopy() KeyBundleResponse {
return KeyBundleResponse{
WriterBundle: o.WriterBundle.DeepCopy(),
ReaderBundle: o.ReaderBundle.DeepCopy(),
}
}
type LockID int64
func (o LockID) DeepCopy() LockID {
return o
}
type MDPriority int
func (o MDPriority) DeepCopy() MDPriority {
return o
}
type LockContext struct {
RequireLockID LockID `codec:"requireLockID" json:"requireLockID"`
ReleaseAfterSuccess bool `codec:"releaseAfterSuccess" json:"releaseAfterSuccess"`
}
func (o LockContext) DeepCopy() LockContext {
return LockContext{
RequireLockID: o.RequireLockID.DeepCopy(),
ReleaseAfterSuccess: o.ReleaseAfterSuccess,
}
}
type FindNextMDResponse struct {
KbfsRoot MerkleRoot `codec:"kbfsRoot" json:"kbfsRoot"`
MerkleNodes [][]byte `codec:"merkleNodes" json:"merkleNodes"`
RootSeqno Seqno `codec:"rootSeqno" json:"rootSeqno"`
RootHash HashMeta `codec:"rootHash" json:"rootHash"`
}
func (o FindNextMDResponse) DeepCopy() FindNextMDResponse {
return FindNextMDResponse{
KbfsRoot: o.KbfsRoot.DeepCopy(),
MerkleNodes: (func(x [][]byte) [][]byte {
if x == nil {
return nil
}
ret := make([][]byte, len(x))
for i, v := range x {
vCopy := (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(v)
ret[i] = vCopy
}
return ret
})(o.MerkleNodes),
RootSeqno: o.RootSeqno.DeepCopy(),
RootHash: o.RootHash.DeepCopy(),
}
}

View File

@ -0,0 +1,16 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/metadata_update.avdl
package keybase1
type RekeyRequest struct {
FolderID string `codec:"folderID" json:"folderID"`
Revision int64 `codec:"revision" json:"revision"`
}
func (o RekeyRequest) DeepCopy() RekeyRequest {
return RekeyRequest{
FolderID: o.FolderID,
Revision: o.Revision,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_app.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_audit.avdl
package keybase1

View File

@ -0,0 +1,232 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_badges.avdl
package keybase1
import (
gregor1 "github.com/keybase/go-keybase-chat-bot/kbchat/types/gregor1"
)
type ChatConversationID []byte
func (o ChatConversationID) DeepCopy() ChatConversationID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type TeamMemberOutReset struct {
TeamID TeamID `codec:"teamID" json:"teamID"`
Teamname string `codec:"teamname" json:"teamname"`
Username string `codec:"username" json:"username"`
Uid UID `codec:"uid" json:"uid"`
Id gregor1.MsgID `codec:"id" json:"id"`
}
func (o TeamMemberOutReset) DeepCopy() TeamMemberOutReset {
return TeamMemberOutReset{
TeamID: o.TeamID.DeepCopy(),
Teamname: o.Teamname,
Username: o.Username,
Uid: o.Uid.DeepCopy(),
Id: o.Id.DeepCopy(),
}
}
type DeletedTeamInfo struct {
TeamName string `codec:"teamName" json:"teamName"`
DeletedBy string `codec:"deletedBy" json:"deletedBy"`
Id gregor1.MsgID `codec:"id" json:"id"`
}
func (o DeletedTeamInfo) DeepCopy() DeletedTeamInfo {
return DeletedTeamInfo{
TeamName: o.TeamName,
DeletedBy: o.DeletedBy,
Id: o.Id.DeepCopy(),
}
}
type WalletAccountInfo struct {
AccountID string `codec:"accountID" json:"accountID"`
NumUnread int `codec:"numUnread" json:"numUnread"`
}
func (o WalletAccountInfo) DeepCopy() WalletAccountInfo {
return WalletAccountInfo{
AccountID: o.AccountID,
NumUnread: o.NumUnread,
}
}
type ResetState struct {
EndTime Time `codec:"endTime" json:"end_time"`
Active bool `codec:"active" json:"active"`
}
func (o ResetState) DeepCopy() ResetState {
return ResetState{
EndTime: o.EndTime.DeepCopy(),
Active: o.Active,
}
}
type BadgeState struct {
NewTlfs int `codec:"newTlfs" json:"newTlfs"`
RekeysNeeded int `codec:"rekeysNeeded" json:"rekeysNeeded"`
NewFollowers int `codec:"newFollowers" json:"newFollowers"`
InboxVers int `codec:"inboxVers" json:"inboxVers"`
HomeTodoItems int `codec:"homeTodoItems" json:"homeTodoItems"`
UnverifiedEmails int `codec:"unverifiedEmails" json:"unverifiedEmails"`
UnverifiedPhones int `codec:"unverifiedPhones" json:"unverifiedPhones"`
NewDevices []DeviceID `codec:"newDevices" json:"newDevices"`
RevokedDevices []DeviceID `codec:"revokedDevices" json:"revokedDevices"`
Conversations []BadgeConversationInfo `codec:"conversations" json:"conversations"`
NewGitRepoGlobalUniqueIDs []string `codec:"newGitRepoGlobalUniqueIDs" json:"newGitRepoGlobalUniqueIDs"`
NewTeams []TeamID `codec:"newTeams" json:"newTeams"`
DeletedTeams []DeletedTeamInfo `codec:"deletedTeams" json:"deletedTeams"`
NewTeamAccessRequests []TeamID `codec:"newTeamAccessRequests" json:"newTeamAccessRequests"`
TeamsWithResetUsers []TeamMemberOutReset `codec:"teamsWithResetUsers" json:"teamsWithResetUsers"`
UnreadWalletAccounts []WalletAccountInfo `codec:"unreadWalletAccounts" json:"unreadWalletAccounts"`
ResetState ResetState `codec:"resetState" json:"resetState"`
}
func (o BadgeState) DeepCopy() BadgeState {
return BadgeState{
NewTlfs: o.NewTlfs,
RekeysNeeded: o.RekeysNeeded,
NewFollowers: o.NewFollowers,
InboxVers: o.InboxVers,
HomeTodoItems: o.HomeTodoItems,
UnverifiedEmails: o.UnverifiedEmails,
UnverifiedPhones: o.UnverifiedPhones,
NewDevices: (func(x []DeviceID) []DeviceID {
if x == nil {
return nil
}
ret := make([]DeviceID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.NewDevices),
RevokedDevices: (func(x []DeviceID) []DeviceID {
if x == nil {
return nil
}
ret := make([]DeviceID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RevokedDevices),
Conversations: (func(x []BadgeConversationInfo) []BadgeConversationInfo {
if x == nil {
return nil
}
ret := make([]BadgeConversationInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Conversations),
NewGitRepoGlobalUniqueIDs: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.NewGitRepoGlobalUniqueIDs),
NewTeams: (func(x []TeamID) []TeamID {
if x == nil {
return nil
}
ret := make([]TeamID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.NewTeams),
DeletedTeams: (func(x []DeletedTeamInfo) []DeletedTeamInfo {
if x == nil {
return nil
}
ret := make([]DeletedTeamInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.DeletedTeams),
NewTeamAccessRequests: (func(x []TeamID) []TeamID {
if x == nil {
return nil
}
ret := make([]TeamID, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.NewTeamAccessRequests),
TeamsWithResetUsers: (func(x []TeamMemberOutReset) []TeamMemberOutReset {
if x == nil {
return nil
}
ret := make([]TeamMemberOutReset, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.TeamsWithResetUsers),
UnreadWalletAccounts: (func(x []WalletAccountInfo) []WalletAccountInfo {
if x == nil {
return nil
}
ret := make([]WalletAccountInfo, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.UnreadWalletAccounts),
ResetState: o.ResetState.DeepCopy(),
}
}
type BadgeConversationInfo struct {
ConvID ChatConversationID `codec:"convID" json:"convID"`
BadgeCounts map[DeviceType]int `codec:"badgeCounts" json:"badgeCounts"`
UnreadMessages int `codec:"unreadMessages" json:"unreadMessages"`
}
func (o BadgeConversationInfo) DeepCopy() BadgeConversationInfo {
return BadgeConversationInfo{
ConvID: o.ConvID.DeepCopy(),
BadgeCounts: (func(x map[DeviceType]int) map[DeviceType]int {
if x == nil {
return nil
}
ret := make(map[DeviceType]int, len(x))
for k, v := range x {
kCopy := k.DeepCopy()
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.BadgeCounts),
UnreadMessages: o.UnreadMessages,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_can_user_perform.avdl
package keybase1

View File

@ -0,0 +1,70 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_ctl.avdl
package keybase1
type NotificationChannels struct {
Session bool `codec:"session" json:"session"`
Users bool `codec:"users" json:"users"`
Kbfs bool `codec:"kbfs" json:"kbfs"`
Kbfsdesktop bool `codec:"kbfsdesktop" json:"kbfsdesktop"`
Kbfslegacy bool `codec:"kbfslegacy" json:"kbfslegacy"`
Kbfssubscription bool `codec:"kbfssubscription" json:"kbfssubscription"`
Tracking bool `codec:"tracking" json:"tracking"`
Favorites bool `codec:"favorites" json:"favorites"`
Paperkeys bool `codec:"paperkeys" json:"paperkeys"`
Keyfamily bool `codec:"keyfamily" json:"keyfamily"`
Service bool `codec:"service" json:"service"`
App bool `codec:"app" json:"app"`
Chat bool `codec:"chat" json:"chat"`
PGP bool `codec:"pgp" json:"pgp"`
Kbfsrequest bool `codec:"kbfsrequest" json:"kbfsrequest"`
Badges bool `codec:"badges" json:"badges"`
Reachability bool `codec:"reachability" json:"reachability"`
Team bool `codec:"team" json:"team"`
Ephemeral bool `codec:"ephemeral" json:"ephemeral"`
Teambot bool `codec:"teambot" json:"teambot"`
Chatkbfsedits bool `codec:"chatkbfsedits" json:"chatkbfsedits"`
Chatdev bool `codec:"chatdev" json:"chatdev"`
Deviceclone bool `codec:"deviceclone" json:"deviceclone"`
Chatattachments bool `codec:"chatattachments" json:"chatattachments"`
Wallet bool `codec:"wallet" json:"wallet"`
Audit bool `codec:"audit" json:"audit"`
Runtimestats bool `codec:"runtimestats" json:"runtimestats"`
FeaturedBots bool `codec:"featuredBots" json:"featuredBots"`
Saltpack bool `codec:"saltpack" json:"saltpack"`
}
func (o NotificationChannels) DeepCopy() NotificationChannels {
return NotificationChannels{
Session: o.Session,
Users: o.Users,
Kbfs: o.Kbfs,
Kbfsdesktop: o.Kbfsdesktop,
Kbfslegacy: o.Kbfslegacy,
Kbfssubscription: o.Kbfssubscription,
Tracking: o.Tracking,
Favorites: o.Favorites,
Paperkeys: o.Paperkeys,
Keyfamily: o.Keyfamily,
Service: o.Service,
App: o.App,
Chat: o.Chat,
PGP: o.PGP,
Kbfsrequest: o.Kbfsrequest,
Badges: o.Badges,
Reachability: o.Reachability,
Team: o.Team,
Ephemeral: o.Ephemeral,
Teambot: o.Teambot,
Chatkbfsedits: o.Chatkbfsedits,
Chatdev: o.Chatdev,
Deviceclone: o.Deviceclone,
Chatattachments: o.Chatattachments,
Wallet: o.Wallet,
Audit: o.Audit,
Runtimestats: o.Runtimestats,
FeaturedBots: o.FeaturedBots,
Saltpack: o.Saltpack,
}
}

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_device_clone.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_email.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_ephemeral.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_favorites.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_featuredbots.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_fs.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_fs_request.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_keyfamily.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_paperkey.avdl
package keybase1

View File

@ -0,0 +1,4 @@
// Auto-generated to Go types using avdl-compiler v1.4.6 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/notify_pgp.avdl
package keybase1

Some files were not shown because too many files have changed in this diff Show More