Documentation ¶
Index ¶
- Variables
- func RegisterRossbyServer(s *grpc.Server, srv RossbyServer)
- type AuthorizeReply
- func (*AuthorizeReply) Descriptor() ([]byte, []int)
- func (m *AuthorizeReply) GetErrors() *MultiError
- func (m *AuthorizeReply) GetInbox() string
- func (m *AuthorizeReply) GetSuccess() bool
- func (m *AuthorizeReply) GetToken() string
- func (*AuthorizeReply) ProtoMessage()
- func (m *AuthorizeReply) Reset()
- func (m *AuthorizeReply) String() string
- func (m *AuthorizeReply) XXX_DiscardUnknown()
- func (m *AuthorizeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AuthorizeReply) XXX_Merge(src proto.Message)
- func (m *AuthorizeReply) XXX_Size() int
- func (m *AuthorizeReply) XXX_Unmarshal(b []byte) error
- type AuthorizeRequest
- func (*AuthorizeRequest) Descriptor() ([]byte, []int)
- func (m *AuthorizeRequest) GetAuthorization() string
- func (m *AuthorizeRequest) GetDevice() string
- func (*AuthorizeRequest) ProtoMessage()
- func (m *AuthorizeRequest) Reset()
- func (m *AuthorizeRequest) String() string
- func (m *AuthorizeRequest) XXX_DiscardUnknown()
- func (m *AuthorizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AuthorizeRequest) XXX_Merge(src proto.Message)
- func (m *AuthorizeRequest) XXX_Size() int
- func (m *AuthorizeRequest) XXX_Unmarshal(b []byte) error
- type Contact
- func (*Contact) Descriptor() ([]byte, []int)
- func (m *Contact) GetContact() string
- func (m *Contact) GetType() ContactType
- func (m *Contact) GetVerified() bool
- func (*Contact) ProtoMessage()
- func (m *Contact) Reset()
- func (m *Contact) String() string
- func (c *Contact) Validate() (err error)
- func (m *Contact) XXX_DiscardUnknown()
- func (m *Contact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Contact) XXX_Merge(src proto.Message)
- func (m *Contact) XXX_Size() int
- func (m *Contact) XXX_Unmarshal(b []byte) error
- type ContactReply
- func (*ContactReply) Descriptor() ([]byte, []int)
- func (m *ContactReply) GetErrors() *MultiError
- func (m *ContactReply) GetPubkey() string
- func (m *ContactReply) GetSuccess() bool
- func (*ContactReply) ProtoMessage()
- func (m *ContactReply) Reset()
- func (m *ContactReply) String() string
- func (m *ContactReply) XXX_DiscardUnknown()
- func (m *ContactReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ContactReply) XXX_Merge(src proto.Message)
- func (m *ContactReply) XXX_Size() int
- func (m *ContactReply) XXX_Unmarshal(b []byte) error
- type ContactRequest
- func (*ContactRequest) Descriptor() ([]byte, []int)
- func (m *ContactRequest) GetContacts() []*Contact
- func (*ContactRequest) ProtoMessage()
- func (m *ContactRequest) Reset()
- func (m *ContactRequest) String() string
- func (m *ContactRequest) XXX_DiscardUnknown()
- func (m *ContactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ContactRequest) XXX_Merge(src proto.Message)
- func (m *ContactRequest) XXX_Size() int
- func (m *ContactRequest) XXX_Unmarshal(b []byte) error
- type ContactType
- type DeliverResponse
- func (*DeliverResponse) Descriptor() ([]byte, []int)
- func (m *DeliverResponse) GetDeliveries() uint32
- func (m *DeliverResponse) GetErrors() *MultiError
- func (m *DeliverResponse) GetSuccess() bool
- func (*DeliverResponse) ProtoMessage()
- func (m *DeliverResponse) Reset()
- func (m *DeliverResponse) String() string
- func (m *DeliverResponse) XXX_DiscardUnknown()
- func (m *DeliverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DeliverResponse) XXX_Merge(src proto.Message)
- func (m *DeliverResponse) XXX_Size() int
- func (m *DeliverResponse) XXX_Unmarshal(b []byte) error
- type Device
- func (*Device) Descriptor() ([]byte, []int)
- func (m *Device) GetAuthorized() bool
- func (m *Device) GetCreated() *timestamp.Timestamp
- func (m *Device) GetCursor() uint64
- func (m *Device) GetId() string
- func (m *Device) GetLastAuth() *timestamp.Timestamp
- func (m *Device) GetLastSync() *timestamp.Timestamp
- func (m *Device) GetToken() string
- func (*Device) ProtoMessage()
- func (m *Device) Reset()
- func (m *Device) String() string
- func (m *Device) XXX_DiscardUnknown()
- func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Device) XXX_Merge(src proto.Message)
- func (m *Device) XXX_Size() int
- func (m *Device) XXX_Unmarshal(b []byte) error
- type Error
- func (*Error) Descriptor() ([]byte, []int)
- func (e *Error) Error() string
- func (m *Error) GetCode() uint32
- func (m *Error) GetMessage() string
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) String() string
- func (m *Error) XXX_DiscardUnknown()
- func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Error) XXX_Merge(src proto.Message)
- func (m *Error) XXX_Size() int
- func (m *Error) XXX_Unmarshal(b []byte) error
- type Errors
- type FetchRequest
- func (*FetchRequest) Descriptor() ([]byte, []int)
- func (m *FetchRequest) GetDevice() string
- func (m *FetchRequest) GetInbox() string
- func (*FetchRequest) ProtoMessage()
- func (m *FetchRequest) Reset()
- func (m *FetchRequest) String() string
- func (m *FetchRequest) XXX_DiscardUnknown()
- func (m *FetchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FetchRequest) XXX_Merge(src proto.Message)
- func (m *FetchRequest) XXX_Size() int
- func (m *FetchRequest) XXX_Unmarshal(b []byte) error
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetBody() []byte
- func (m *Message) GetFrom() string
- func (m *Message) GetTimestamp() *timestamp.Timestamp
- func (m *Message) GetTo() string
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) String() string
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type Messages
- func (*Messages) Descriptor() ([]byte, []int)
- func (m *Messages) GetMessages() []*Message
- func (m *Messages) GetStatus() *Status
- func (*Messages) ProtoMessage()
- func (m *Messages) Reset()
- func (m *Messages) String() string
- func (m *Messages) XXX_DiscardUnknown()
- func (m *Messages) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Messages) XXX_Merge(src proto.Message)
- func (m *Messages) XXX_Size() int
- func (m *Messages) XXX_Unmarshal(b []byte) error
- type MultiError
- func (*MultiError) Descriptor() ([]byte, []int)
- func (e *MultiError) Error() string
- func (m *MultiError) GetErrors() []*Error
- func (*MultiError) ProtoMessage()
- func (m *MultiError) Reset()
- func (m *MultiError) String() string
- func (m *MultiError) XXX_DiscardUnknown()
- func (m *MultiError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MultiError) XXX_Merge(src proto.Message)
- func (m *MultiError) XXX_Size() int
- func (m *MultiError) XXX_Unmarshal(b []byte) error
- type Profile
- func (*Profile) Descriptor() ([]byte, []int)
- func (m *Profile) GetContacts() []*Contact
- func (m *Profile) GetDevices() []*Device
- func (m *Profile) GetId() string
- func (m *Profile) GetJoined() *timestamp.Timestamp
- func (m *Profile) GetLastSeen() *timestamp.Timestamp
- func (*Profile) ProtoMessage()
- func (m *Profile) Reset()
- func (m *Profile) String() string
- func (m *Profile) XXX_DiscardUnknown()
- func (m *Profile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Profile) XXX_Merge(src proto.Message)
- func (m *Profile) XXX_Size() int
- func (m *Profile) XXX_Unmarshal(b []byte) error
- type RegisterReply
- func (*RegisterReply) Descriptor() ([]byte, []int)
- func (m *RegisterReply) GetAuthorizations() uint32
- func (m *RegisterReply) GetErrors() *MultiError
- func (m *RegisterReply) GetSuccess() bool
- func (*RegisterReply) ProtoMessage()
- func (m *RegisterReply) Reset()
- func (m *RegisterReply) String() string
- func (m *RegisterReply) XXX_DiscardUnknown()
- func (m *RegisterReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RegisterReply) XXX_Merge(src proto.Message)
- func (m *RegisterReply) XXX_Size() int
- func (m *RegisterReply) XXX_Unmarshal(b []byte) error
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)
- func (m *RegisterRequest) GetContacts() []*Contact
- func (m *RegisterRequest) GetDevice() string
- func (m *RegisterRequest) GetPubkey() []byte
- func (*RegisterRequest) ProtoMessage()
- func (m *RegisterRequest) Reset()
- func (m *RegisterRequest) String() string
- func (m *RegisterRequest) XXX_DiscardUnknown()
- func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RegisterRequest) XXX_Merge(src proto.Message)
- func (m *RegisterRequest) XXX_Size() int
- func (m *RegisterRequest) XXX_Unmarshal(b []byte) error
- type RossbyClient
- type RossbyServer
- type Rossby_ChatClient
- type Rossby_ChatServer
- type Status
- func (*Status) Descriptor() ([]byte, []int)
- func (*Status) ProtoMessage()
- func (m *Status) Reset()
- func (m *Status) String() string
- func (m *Status) XXX_DiscardUnknown()
- func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Status) XXX_Merge(src proto.Message)
- func (m *Status) XXX_Size() int
- func (m *Status) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ContactType_name = map[int32]string{
0: "PHONE",
1: "EMAIL",
}
var ContactType_value = map[string]int32{
"PHONE": 0,
"EMAIL": 1,
}
Functions ¶
func RegisterRossbyServer ¶
func RegisterRossbyServer(s *grpc.Server, srv RossbyServer)
Types ¶
type AuthorizeReply ¶
type AuthorizeReply struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` Inbox string `protobuf:"bytes,3,opt,name=inbox,proto3" json:"inbox,omitempty"` Errors *MultiError `protobuf:"bytes,4,opt,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AuthorizeReply) Descriptor ¶
func (*AuthorizeReply) Descriptor() ([]byte, []int)
func (*AuthorizeReply) GetErrors ¶
func (m *AuthorizeReply) GetErrors() *MultiError
func (*AuthorizeReply) GetInbox ¶
func (m *AuthorizeReply) GetInbox() string
func (*AuthorizeReply) GetSuccess ¶
func (m *AuthorizeReply) GetSuccess() bool
func (*AuthorizeReply) GetToken ¶
func (m *AuthorizeReply) GetToken() string
func (*AuthorizeReply) ProtoMessage ¶
func (*AuthorizeReply) ProtoMessage()
func (*AuthorizeReply) Reset ¶
func (m *AuthorizeReply) Reset()
func (*AuthorizeReply) String ¶
func (m *AuthorizeReply) String() string
func (*AuthorizeReply) XXX_DiscardUnknown ¶
func (m *AuthorizeReply) XXX_DiscardUnknown()
func (*AuthorizeReply) XXX_Marshal ¶
func (m *AuthorizeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AuthorizeReply) XXX_Merge ¶
func (m *AuthorizeReply) XXX_Merge(src proto.Message)
func (*AuthorizeReply) XXX_Size ¶
func (m *AuthorizeReply) XXX_Size() int
func (*AuthorizeReply) XXX_Unmarshal ¶
func (m *AuthorizeReply) XXX_Unmarshal(b []byte) error
type AuthorizeRequest ¶
type AuthorizeRequest struct { Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` Authorization string `protobuf:"bytes,2,opt,name=authorization,proto3" json:"authorization,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Authorization: a unary RPC that is a response to a side channel. On registration, Rossby sends an authorization code to the phone or email address associated with the account. The user sends this code back in the authorization RPC and gets a unique token that they can use to authenticate messages to the server with.
func (*AuthorizeRequest) Descriptor ¶
func (*AuthorizeRequest) Descriptor() ([]byte, []int)
func (*AuthorizeRequest) GetAuthorization ¶
func (m *AuthorizeRequest) GetAuthorization() string
func (*AuthorizeRequest) GetDevice ¶
func (m *AuthorizeRequest) GetDevice() string
func (*AuthorizeRequest) ProtoMessage ¶
func (*AuthorizeRequest) ProtoMessage()
func (*AuthorizeRequest) Reset ¶
func (m *AuthorizeRequest) Reset()
func (*AuthorizeRequest) String ¶
func (m *AuthorizeRequest) String() string
func (*AuthorizeRequest) XXX_DiscardUnknown ¶
func (m *AuthorizeRequest) XXX_DiscardUnknown()
func (*AuthorizeRequest) XXX_Marshal ¶
func (m *AuthorizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AuthorizeRequest) XXX_Merge ¶
func (m *AuthorizeRequest) XXX_Merge(src proto.Message)
func (*AuthorizeRequest) XXX_Size ¶
func (m *AuthorizeRequest) XXX_Size() int
func (*AuthorizeRequest) XXX_Unmarshal ¶
func (m *AuthorizeRequest) XXX_Unmarshal(b []byte) error
type Contact ¶
type Contact struct { Type ContactType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.ContactType" json:"type,omitempty"` Contact string `protobuf:"bytes,2,opt,name=contact,proto3" json:"contact,omitempty"` Verified bool `protobuf:"varint,3,opt,name=verified,proto3" json:"verified,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Contains the raw contact information along with parsing hints
func (*Contact) Descriptor ¶
func (*Contact) GetContact ¶
func (*Contact) GetType ¶
func (m *Contact) GetType() ContactType
func (*Contact) GetVerified ¶
func (*Contact) ProtoMessage ¶
func (*Contact) ProtoMessage()
func (*Contact) Validate ¶
Validate ensures that the contact identifier is a valid E.164 phone number or an email address and returns an error if it is not. Note that this is a fairly lightweight approach to validation and is prone to false positives. Error handling on send or receive messages is essential.
See also: https://www.twilio.com/docs/glossary/what-e164 See also: https://tools.ietf.org/rfc/rfc5322.txt
func (*Contact) XXX_DiscardUnknown ¶
func (m *Contact) XXX_DiscardUnknown()
func (*Contact) XXX_Marshal ¶
func (*Contact) XXX_Unmarshal ¶
type ContactReply ¶
type ContactReply struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Pubkey string `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"` Errors *MultiError `protobuf:"bytes,3,opt,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
TODO: also respond with contact profile
func (*ContactReply) Descriptor ¶
func (*ContactReply) Descriptor() ([]byte, []int)
func (*ContactReply) GetErrors ¶
func (m *ContactReply) GetErrors() *MultiError
func (*ContactReply) GetPubkey ¶
func (m *ContactReply) GetPubkey() string
func (*ContactReply) GetSuccess ¶
func (m *ContactReply) GetSuccess() bool
func (*ContactReply) ProtoMessage ¶
func (*ContactReply) ProtoMessage()
func (*ContactReply) Reset ¶
func (m *ContactReply) Reset()
func (*ContactReply) String ¶
func (m *ContactReply) String() string
func (*ContactReply) XXX_DiscardUnknown ¶
func (m *ContactReply) XXX_DiscardUnknown()
func (*ContactReply) XXX_Marshal ¶
func (m *ContactReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ContactReply) XXX_Merge ¶
func (m *ContactReply) XXX_Merge(src proto.Message)
func (*ContactReply) XXX_Size ¶
func (m *ContactReply) XXX_Size() int
func (*ContactReply) XXX_Unmarshal ¶
func (m *ContactReply) XXX_Unmarshal(b []byte) error
type ContactRequest ¶
type ContactRequest struct { Contacts []*Contact `protobuf:"bytes,2,rep,name=contacts,proto3" json:"contacts,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Add Contacts: this RPC is designed to fetch the public key of another user when the client supplies an authorized phone number or email. This can be a bit tricky, and the server has to manage whether or not users are allowed to be discovered automatically or not.
func (*ContactRequest) Descriptor ¶
func (*ContactRequest) Descriptor() ([]byte, []int)
func (*ContactRequest) GetContacts ¶
func (m *ContactRequest) GetContacts() []*Contact
func (*ContactRequest) ProtoMessage ¶
func (*ContactRequest) ProtoMessage()
func (*ContactRequest) Reset ¶
func (m *ContactRequest) Reset()
func (*ContactRequest) String ¶
func (m *ContactRequest) String() string
func (*ContactRequest) XXX_DiscardUnknown ¶
func (m *ContactRequest) XXX_DiscardUnknown()
func (*ContactRequest) XXX_Marshal ¶
func (m *ContactRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ContactRequest) XXX_Merge ¶
func (m *ContactRequest) XXX_Merge(src proto.Message)
func (*ContactRequest) XXX_Size ¶
func (m *ContactRequest) XXX_Size() int
func (*ContactRequest) XXX_Unmarshal ¶
func (m *ContactRequest) XXX_Unmarshal(b []byte) error
type ContactType ¶
type ContactType int32
Specifies how to parse contacts
const ( ContactType_PHONE ContactType = 0 ContactType_EMAIL ContactType = 1 )
func (ContactType) EnumDescriptor ¶
func (ContactType) EnumDescriptor() ([]byte, []int)
func (ContactType) String ¶
func (x ContactType) String() string
type DeliverResponse ¶
type DeliverResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Deliveries uint32 `protobuf:"varint,2,opt,name=deliveries,proto3" json:"deliveries,omitempty"` Errors *MultiError `protobuf:"bytes,3,opt,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Deliver Messages: this RPC is a one-off request to deliver a set of messages. This RPC is used in an asynchronous fashion when a Chat streaming RPC pipe does not exist.
func (*DeliverResponse) Descriptor ¶
func (*DeliverResponse) Descriptor() ([]byte, []int)
func (*DeliverResponse) GetDeliveries ¶
func (m *DeliverResponse) GetDeliveries() uint32
func (*DeliverResponse) GetErrors ¶
func (m *DeliverResponse) GetErrors() *MultiError
func (*DeliverResponse) GetSuccess ¶
func (m *DeliverResponse) GetSuccess() bool
func (*DeliverResponse) ProtoMessage ¶
func (*DeliverResponse) ProtoMessage()
func (*DeliverResponse) Reset ¶
func (m *DeliverResponse) Reset()
func (*DeliverResponse) String ¶
func (m *DeliverResponse) String() string
func (*DeliverResponse) XXX_DiscardUnknown ¶
func (m *DeliverResponse) XXX_DiscardUnknown()
func (*DeliverResponse) XXX_Marshal ¶
func (m *DeliverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DeliverResponse) XXX_Merge ¶
func (m *DeliverResponse) XXX_Merge(src proto.Message)
func (*DeliverResponse) XXX_Size ¶
func (m *DeliverResponse) XXX_Size() int
func (*DeliverResponse) XXX_Unmarshal ¶
func (m *DeliverResponse) XXX_Unmarshal(b []byte) error
type Device ¶
type Device struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Authorized bool `protobuf:"varint,2,opt,name=authorized,proto3" json:"authorized,omitempty"` Cursor uint64 `protobuf:"varint,3,opt,name=cursor,proto3" json:"cursor,omitempty"` Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` Created *timestamp.Timestamp `protobuf:"bytes,13,opt,name=created,proto3" json:"created,omitempty"` LastAuth *timestamp.Timestamp `protobuf:"bytes,14,opt,name=last_auth,json=lastAuth,proto3" json:"last_auth,omitempty"` LastSync *timestamp.Timestamp `protobuf:"bytes,15,opt,name=last_sync,json=lastSync,proto3" json:"last_sync,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Users can send and receive messages from multiple devices (e.g. their phone or their laptop). Devices are authorized to send and receive messages by the application and per-device tokens are the primary form of authentication. Devices can also be "deauthorized" so that they can no longer send or receive messages on behalf of a user, but without canceling that user's entire account.
func (*Device) Descriptor ¶
func (*Device) GetAuthorized ¶
func (*Device) GetCreated ¶
func (*Device) GetLastAuth ¶
func (*Device) GetLastSync ¶
func (*Device) ProtoMessage ¶
func (*Device) ProtoMessage()
func (*Device) XXX_DiscardUnknown ¶
func (m *Device) XXX_DiscardUnknown()
func (*Device) XXX_Marshal ¶
func (*Device) XXX_Unmarshal ¶
type Error ¶
type Error struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Errors are coded in Rossby to easily identify what has gone wrong TODO: create error code enumerations for quick testing of error types
func (*Error) Descriptor ¶
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) XXX_DiscardUnknown ¶
func (m *Error) XXX_DiscardUnknown()
func (*Error) XXX_Marshal ¶
func (*Error) XXX_Unmarshal ¶
type Errors ¶
type Errors []*Error
Errors exposes a mechanism for quickly creating MultiError objects.
func (Errors) Serialize ¶
func (e Errors) Serialize() *MultiError
Serialize a list of errors into a multi-error.
type FetchRequest ¶
type FetchRequest struct { Device string `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"` Inbox string `protobuf:"bytes,3,opt,name=inbox,proto3" json:"inbox,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Fetch Messages: this RPC is a one-off request to fetch all the messages corresponding to the device. This RPC is used in a periodic fashion, whereas the Chat streaming RPC is used to deliver messages to users who are currently online.
func (*FetchRequest) Descriptor ¶
func (*FetchRequest) Descriptor() ([]byte, []int)
func (*FetchRequest) GetDevice ¶
func (m *FetchRequest) GetDevice() string
func (*FetchRequest) GetInbox ¶
func (m *FetchRequest) GetInbox() string
func (*FetchRequest) ProtoMessage ¶
func (*FetchRequest) ProtoMessage()
func (*FetchRequest) Reset ¶
func (m *FetchRequest) Reset()
func (*FetchRequest) String ¶
func (m *FetchRequest) String() string
func (*FetchRequest) XXX_DiscardUnknown ¶
func (m *FetchRequest) XXX_DiscardUnknown()
func (*FetchRequest) XXX_Marshal ¶
func (m *FetchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FetchRequest) XXX_Merge ¶
func (m *FetchRequest) XXX_Merge(src proto.Message)
func (*FetchRequest) XXX_Size ¶
func (m *FetchRequest) XXX_Size() int
func (*FetchRequest) XXX_Unmarshal ¶
func (m *FetchRequest) XXX_Unmarshal(b []byte) error
type Message ¶
type Message struct { From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Body []byte `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Message objects represent a single, encrypted message sent from one inbox to another.
func (*Message) Descriptor ¶
func (*Message) GetTimestamp ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
type Messages ¶
type Messages struct { Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` Messages []*Message `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Messages are the primary serialization format for sending multiple message objects between Rossby replicas and to and from clients. They are simply a wrapper for one or more messages and status meta information.
func (*Messages) Descriptor ¶
func (*Messages) GetMessages ¶
func (*Messages) ProtoMessage ¶
func (*Messages) ProtoMessage()
func (*Messages) XXX_DiscardUnknown ¶
func (m *Messages) XXX_DiscardUnknown()
func (*Messages) XXX_Marshal ¶
func (*Messages) XXX_Unmarshal ¶
type MultiError ¶
type MultiError struct { Errors []*Error `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Multi-errors store more than one error but can be treated like a regular error Normally we'd implement this as a type []*Error but this format allows it to be easily serialized in RPC requests and responses.
func (*MultiError) Descriptor ¶
func (*MultiError) Descriptor() ([]byte, []int)
func (*MultiError) Error ¶
func (e *MultiError) Error() string
Error ensures that pb.MultiError implements error
func (*MultiError) GetErrors ¶
func (m *MultiError) GetErrors() []*Error
func (*MultiError) ProtoMessage ¶
func (*MultiError) ProtoMessage()
func (*MultiError) Reset ¶
func (m *MultiError) Reset()
func (*MultiError) String ¶
func (m *MultiError) String() string
func (*MultiError) XXX_DiscardUnknown ¶
func (m *MultiError) XXX_DiscardUnknown()
func (*MultiError) XXX_Marshal ¶
func (m *MultiError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MultiError) XXX_Merge ¶
func (m *MultiError) XXX_Merge(src proto.Message)
func (*MultiError) XXX_Size ¶
func (m *MultiError) XXX_Size() int
func (*MultiError) XXX_Unmarshal ¶
func (m *MultiError) XXX_Unmarshal(b []byte) error
type Profile ¶
type Profile struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Contacts []*Contact `protobuf:"bytes,2,rep,name=contacts,proto3" json:"contacts,omitempty"` Devices []*Device `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"` Joined *timestamp.Timestamp `protobuf:"bytes,14,opt,name=joined,proto3" json:"joined,omitempty"` LastSeen *timestamp.Timestamp `protobuf:"bytes,15,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Profile objects store information about the state of a single inbox (e.g. user) and is the primary data object that is read and written to in most API calls. Although the profile is not generally sent over the network, it is serialized using protocol buffers to store in the database.
func (*Profile) Descriptor ¶
func (*Profile) GetContacts ¶
func (*Profile) GetDevices ¶
func (*Profile) GetLastSeen ¶
func (*Profile) ProtoMessage ¶
func (*Profile) ProtoMessage()
func (*Profile) XXX_DiscardUnknown ¶
func (m *Profile) XXX_DiscardUnknown()
func (*Profile) XXX_Marshal ¶
func (*Profile) XXX_Unmarshal ¶
type RegisterReply ¶
type RegisterReply struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Authorizations uint32 `protobuf:"varint,2,opt,name=authorizations,proto3" json:"authorizations,omitempty"` Errors *MultiError `protobuf:"bytes,3,opt,name=errors,proto3" json:"errors,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RegisterReply) Descriptor ¶
func (*RegisterReply) Descriptor() ([]byte, []int)
func (*RegisterReply) GetAuthorizations ¶
func (m *RegisterReply) GetAuthorizations() uint32
func (*RegisterReply) GetErrors ¶
func (m *RegisterReply) GetErrors() *MultiError
func (*RegisterReply) GetSuccess ¶
func (m *RegisterReply) GetSuccess() bool
func (*RegisterReply) ProtoMessage ¶
func (*RegisterReply) ProtoMessage()
func (*RegisterReply) Reset ¶
func (m *RegisterReply) Reset()
func (*RegisterReply) String ¶
func (m *RegisterReply) String() string
func (*RegisterReply) XXX_DiscardUnknown ¶
func (m *RegisterReply) XXX_DiscardUnknown()
func (*RegisterReply) XXX_Marshal ¶
func (m *RegisterReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RegisterReply) XXX_Merge ¶
func (m *RegisterReply) XXX_Merge(src proto.Message)
func (*RegisterReply) XXX_Size ¶
func (m *RegisterReply) XXX_Size() int
func (*RegisterReply) XXX_Unmarshal ¶
func (m *RegisterReply) XXX_Unmarshal(b []byte) error
type RegisterRequest ¶
type RegisterRequest struct { Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` Contacts []*Contact `protobuf:"bytes,2,rep,name=contacts,proto3" json:"contacts,omitempty"` Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Registration: a unary RPC to add a device, add a contact email or phone number, link a device to an account, or change the public key of an account. Followed by authorization.
func (*RegisterRequest) Descriptor ¶
func (*RegisterRequest) Descriptor() ([]byte, []int)
func (*RegisterRequest) GetContacts ¶
func (m *RegisterRequest) GetContacts() []*Contact
func (*RegisterRequest) GetDevice ¶
func (m *RegisterRequest) GetDevice() string
func (*RegisterRequest) GetPubkey ¶
func (m *RegisterRequest) GetPubkey() []byte
func (*RegisterRequest) ProtoMessage ¶
func (*RegisterRequest) ProtoMessage()
func (*RegisterRequest) Reset ¶
func (m *RegisterRequest) Reset()
func (*RegisterRequest) String ¶
func (m *RegisterRequest) String() string
func (*RegisterRequest) XXX_DiscardUnknown ¶
func (m *RegisterRequest) XXX_DiscardUnknown()
func (*RegisterRequest) XXX_Marshal ¶
func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RegisterRequest) XXX_Merge ¶
func (m *RegisterRequest) XXX_Merge(src proto.Message)
func (*RegisterRequest) XXX_Size ¶
func (m *RegisterRequest) XXX_Size() int
func (*RegisterRequest) XXX_Unmarshal ¶
func (m *RegisterRequest) XXX_Unmarshal(b []byte) error
type RossbyClient ¶
type RossbyClient interface { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterReply, error) Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*AuthorizeReply, error) Contact(ctx context.Context, in *ContactRequest, opts ...grpc.CallOption) (*ContactReply, error) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*Messages, error) Deliver(ctx context.Context, in *Messages, opts ...grpc.CallOption) (*DeliverResponse, error) // TODO: is this a single bidirectional stream or two unidirectional streams? Chat(ctx context.Context, opts ...grpc.CallOption) (Rossby_ChatClient, error) }
RossbyClient is the client API for Rossby service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewRossbyClient ¶
func NewRossbyClient(cc *grpc.ClientConn) RossbyClient
type RossbyServer ¶
type RossbyServer interface { Register(context.Context, *RegisterRequest) (*RegisterReply, error) Authorize(context.Context, *AuthorizeRequest) (*AuthorizeReply, error) Contact(context.Context, *ContactRequest) (*ContactReply, error) Fetch(context.Context, *FetchRequest) (*Messages, error) Deliver(context.Context, *Messages) (*DeliverResponse, error) // TODO: is this a single bidirectional stream or two unidirectional streams? Chat(Rossby_ChatServer) error }
RossbyServer is the server API for Rossby service.
type Rossby_ChatClient ¶
type Rossby_ChatServer ¶
type Status ¶
type Status struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Status messages send generic meta information about the state of the inbox. TODO: determine how best to structure status messages
func (*Status) Descriptor ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) XXX_DiscardUnknown ¶
func (m *Status) XXX_DiscardUnknown()