package api
import (
"github.com/keys-pub/keys"
"github.com/keys-pub/keys/api"
)
type Channel struct {
ID keys.ID `json:"id" msgpack:"id"`
Index int64 `json:"idx,omitempty" msgpack:"idx,omitempty"`
Timestamp int64 `json:"ts,omitempty" msgpack:"ts,omitempty"`
Token string `json:"token,omitempty" msgpack:"token,omitempty"`
}
type ChannelCreateRequest struct {
Message []byte `json:"msg,omitempty" msgpack:"msg,omitempty"`
}
type ChannelCreateResponse struct {
Channel *Channel `json:"channel,omitempty" msgpack:"channel,omitempty"`
}
type ChannelStatus struct {
ID keys.ID `json:"id" msgpack:"id"`
Index int64 `json:"idx" msgpack:"idx"`
Timestamp int64 `json:"ts" msgpack:"ts"`
}
type ChannelToken struct {
Channel keys.ID
Token string
}
type ChannelsStatusRequest struct {
Channels map[keys.ID]string `json:"channels,omitempty" msgpack:"channels,omitempty"`
}
type ChannelsStatusResponse struct {
Channels []*ChannelStatus `json:"channels,omitempty" msgpack:"channels,omitempty"`
}
type ChannelInfo struct {
Name string `json:"name,omitempty" msgpack:"name,omitempty"`
Description string `json:"desc,omitempty" msgpack:"desc,omitempty"`
}
type ChannelJoin struct {
User keys.ID `json:"user" msgpack:"user"`
}
type ChannelLeave struct {
User keys.ID `json:"user" msgpack:"user"`
}
type ChannelInvite struct {
Channel keys.ID `json:"channel" msgpack:"channel"`
Recipient keys.ID `json:"recipient" msgpack:"recipient"`
Sender keys.ID `json:"sender" msgpack:"sender"`
Key *api.Key `json:"key" msgpack:"key"`
Token string `json:"token" msgpack:"token"`
Info *ChannelInfo `json:"info,omitempty" msgpack:"info,omitempty"`
}