Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterMatterServer(s *grpc.Server, srv MatterServer)
- func SetLogger(l Logger)
- type Channel
- func (*Channel) Descriptor() ([]byte, []int)deprecated
- func (x *Channel) GetCreateAt() int64
- func (x *Channel) GetDeleteAt() int64
- func (x *Channel) GetDisplayName() string
- func (x *Channel) GetID() string
- func (x *Channel) GetName() string
- func (x *Channel) GetTeamID() string
- func (x *Channel) GetType() string
- func (x *Channel) GetUpdateAt() int64
- func (*Channel) ProtoMessage()
- func (x *Channel) ProtoReflect() protoreflect.Message
- func (x *Channel) Reset()
- func (x *Channel) String() string
- type ChannelsForUserRequest
- func (*ChannelsForUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ChannelsForUserRequest) GetTeamID() string
- func (x *ChannelsForUserRequest) GetUserID() string
- func (*ChannelsForUserRequest) ProtoMessage()
- func (x *ChannelsForUserRequest) ProtoReflect() protoreflect.Message
- func (x *ChannelsForUserRequest) Reset()
- func (x *ChannelsForUserRequest) String() string
- type ChannelsForUserResponse
- func (*ChannelsForUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ChannelsForUserResponse) GetChannels() []*Channel
- func (*ChannelsForUserResponse) ProtoMessage()
- func (x *ChannelsForUserResponse) ProtoReflect() protoreflect.Message
- func (x *ChannelsForUserResponse) Reset()
- func (x *ChannelsForUserResponse) String() string
- type Client
- func (c *Client) AddUserToChannel(ctx context.Context, userID string, channelID string) error
- func (c *Client) AddUserToTeam(ctx context.Context, userID string, teamID string) error
- func (c *Client) Channel(ctx context.Context, teamID string, id string) (*Channel, error)
- func (c *Client) ChannelByName(ctx context.Context, teamID string, name string) (*Channel, error)
- func (c *Client) ChannelsForUser(ctx context.Context, userID string, teamID string) ([]*Channel, error)
- func (c *Client) CreateChannel(ctx context.Context, name string, teamID string) (*Channel, error)
- func (c *Client) CreatePost(ctx context.Context, channelID string, message string) (*Post, error)
- func (c *Client) CreateTeam(ctx context.Context, name string, displayName string, typ string) (*Team, error)
- func (c *Client) CreateUser(ctx context.Context, user *User) (*User, error)
- func (c *Client) CreateUserWithKey(ctx context.Context, key *keys.EdX25519Key) (*User, error)
- func (c *Client) Delete(ctx context.Context, path string, params url.Values) (*http.Response, error)
- func (c *Client) Get(ctx context.Context, path string, params url.Values) (*http.Response, error)
- func (c *Client) Head(ctx context.Context, path string, params url.Values) (*http.Response, error)
- func (c *Client) LoginWithKey(ctx context.Context, key *keys.EdX25519Key) (*User, error)
- func (c *Client) LoginWithPassword(ctx context.Context, username string, password string) (*User, error)
- func (c *Client) Logout()
- func (c *Client) NewWebSocketClient() (*WebSocketClient, error)
- func (c *Client) Post(ctx context.Context, path string, params url.Values, reader io.Reader) (*http.Response, error)
- func (c *Client) PostWithKey(ctx context.Context, path string, params url.Values, reader io.Reader, ...) (*http.Response, error)
- func (c *Client) PostsForChannel(ctx context.Context, channelID string) (*PostList, error)
- func (c *Client) Put(ctx context.Context, path string, params url.Values, reader io.Reader) (*http.Response, error)
- func (c *Client) SetClock(clock tsutil.Clock)
- func (c *Client) SetHTTPClient(httpClient *http.Client)
- func (c *Client) TeamByName(ctx context.Context, name string) (*Team, error)
- func (c *Client) Teams(ctx context.Context) ([]*Team, error)
- func (c *Client) TeamsForUser(ctx context.Context, userID string) ([]*Team, error)
- func (c *Client) URL() *url.URL
- type ContextLogger
- type CreateChannelRequest
- func (*CreateChannelRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateChannelRequest) GetName() string
- func (x *CreateChannelRequest) GetTeamID() string
- func (*CreateChannelRequest) ProtoMessage()
- func (x *CreateChannelRequest) ProtoReflect() protoreflect.Message
- func (x *CreateChannelRequest) Reset()
- func (x *CreateChannelRequest) String() string
- type CreateChannelResponse
- func (*CreateChannelResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateChannelResponse) GetChannel() *Channel
- func (*CreateChannelResponse) ProtoMessage()
- func (x *CreateChannelResponse) ProtoReflect() protoreflect.Message
- func (x *CreateChannelResponse) Reset()
- func (x *CreateChannelResponse) String() string
- type Error
- type Keyring
- type ListenEvent
- type ListenRequest
- type LogLevel
- type Logger
- type LoginRequest
- type LoginResponse
- type MatterClient
- type MatterServer
- type Matter_ListenClient
- type Matter_ListenServer
- type Post
- func (*Post) Descriptor() ([]byte, []int)deprecated
- func (x *Post) GetChannelID() string
- func (x *Post) GetCreateAt() int64
- func (x *Post) GetDeleteAt() int64
- func (x *Post) GetEditAt() int64
- func (x *Post) GetID() string
- func (x *Post) GetMessage() string
- func (x *Post) GetType() string
- func (x *Post) GetUpdateAt() int64
- func (x *Post) GetUserID() string
- func (*Post) ProtoMessage()
- func (x *Post) ProtoReflect() protoreflect.Message
- func (x *Post) Reset()
- func (x *Post) String() string
- type PostList
- func (*PostList) Descriptor() ([]byte, []int)deprecated
- func (x *PostList) GetNextPostID() string
- func (x *PostList) GetOrder() []string
- func (x *PostList) GetPosts() map[string]*Post
- func (x *PostList) GetPrevPostID() string
- func (*PostList) ProtoMessage()
- func (x *PostList) ProtoReflect() protoreflect.Message
- func (x *PostList) Reset()
- func (x *PostList) String() string
- type Team
- func (*Team) Descriptor() ([]byte, []int)deprecated
- func (x *Team) GetAllowOpenInvite() bool
- func (x *Team) GetCreateAt() int64
- func (x *Team) GetDeleteAt() int64
- func (x *Team) GetDisplayName() string
- func (x *Team) GetID() string
- func (x *Team) GetName() string
- func (x *Team) GetType() string
- func (x *Team) GetUpdateAt() int64
- func (*Team) ProtoMessage()
- func (x *Team) ProtoReflect() protoreflect.Message
- func (x *Team) Reset()
- func (x *Team) String() string
- type TeamPatch
- func (*TeamPatch) Descriptor() ([]byte, []int)deprecated
- func (x *TeamPatch) GetAllowOpenInvite() bool
- func (x *TeamPatch) GetAllowedDomains() string
- func (x *TeamPatch) GetCompanyName() string
- func (x *TeamPatch) GetDescription() string
- func (x *TeamPatch) GetDisplayName() string
- func (x *TeamPatch) GetGroupConstrained() bool
- func (*TeamPatch) ProtoMessage()
- func (x *TeamPatch) ProtoReflect() protoreflect.Message
- func (x *TeamPatch) Reset()
- func (x *TeamPatch) String() string
- type TeamsForUserRequest
- func (*TeamsForUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TeamsForUserRequest) GetUserID() string
- func (*TeamsForUserRequest) ProtoMessage()
- func (x *TeamsForUserRequest) ProtoReflect() protoreflect.Message
- func (x *TeamsForUserRequest) Reset()
- func (x *TeamsForUserRequest) String() string
- type TeamsForUserResponse
- func (*TeamsForUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TeamsForUserResponse) GetTeams() []*Team
- func (*TeamsForUserResponse) ProtoMessage()
- func (x *TeamsForUserResponse) ProtoReflect() protoreflect.Message
- func (x *TeamsForUserResponse) Reset()
- func (x *TeamsForUserResponse) String() string
- type UnimplementedMatterServer
- func (*UnimplementedMatterServer) ChannelsForUser(context.Context, *ChannelsForUserRequest) (*ChannelsForUserResponse, error)
- func (*UnimplementedMatterServer) CreateChannel(context.Context, *CreateChannelRequest) (*CreateChannelResponse, error)
- func (*UnimplementedMatterServer) Listen(Matter_ListenServer) error
- func (*UnimplementedMatterServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
- func (*UnimplementedMatterServer) TeamsForUser(context.Context, *TeamsForUserRequest) (*TeamsForUserResponse, error)
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreateAt() int64
- func (x *User) GetDeleteAt() int64
- func (x *User) GetEmail() string
- func (x *User) GetEmailVerified() bool
- func (x *User) GetFirstName() string
- func (x *User) GetID() string
- func (x *User) GetLastName() string
- func (x *User) GetNickname() string
- func (x *User) GetPassword() string
- func (x *User) GetPosition() string
- func (x *User) GetRoles() string
- func (x *User) GetUpdateAt() int64
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type WebSocketClient
- func (wsc *WebSocketClient) Close()
- func (wsc *WebSocketClient) Connect() error
- func (wsc *WebSocketClient) ConnectWithDialer(dialer *websocket.Dialer) error
- func (wsc *WebSocketClient) GetStatuses()
- func (wsc *WebSocketClient) GetStatusesByIds(userIds []string)
- func (wsc *WebSocketClient) Listen()
- func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{})
- func (wsc *WebSocketClient) UserTyping(channelID, parentID string)
- type WebSocketEvent
- type WebSocketRequest
- type WebSocketResponse
- type WebsocketBroadcast
Constants ¶
const ( ChannelOpen = "O" ChannelPrivate = "P" ChannelDirect = "D" ChannelGroup = "G" // CHANNEL_GROUP_MAX_USERS = 8 // CHANNEL_GROUP_MIN_USERS = 3 DefaultChannel = "town-square" )
Channel constants.
const ( PostSystemMessagePrefix = "system_" PostDefault = "" )
Post constants.
const ( TeamOpen string = "O" TeamInvite string = "I" )
Team constants.
const ( SocketMaxMessageSize = 8 * 1024 // 8KB PingTimeoutBufferSeconds = 5 // WEBSOCKET_EVENT_TYPING = "typing" // WEBSOCKET_EVENT_POSTED = "posted" // WEBSOCKET_EVENT_POST_EDITED = "post_edited" // WEBSOCKET_EVENT_POST_DELETED = "post_deleted" // WEBSOCKET_EVENT_POST_UNREAD = "post_unread" // WEBSOCKET_EVENT_CHANNEL_CONVERTED = "channel_converted" // WEBSOCKET_EVENT_CHANNEL_CREATED = "channel_created" // WEBSOCKET_EVENT_CHANNEL_DELETED = "channel_deleted" // WEBSOCKET_EVENT_CHANNEL_RESTORED = "channel_restored" // WEBSOCKET_EVENT_CHANNEL_UPDATED = "channel_updated" // WEBSOCKET_EVENT_CHANNEL_MEMBER_UPDATED = "channel_member_updated" // WEBSOCKET_EVENT_CHANNEL_SCHEME_UPDATED = "channel_scheme_updated" // WEBSOCKET_EVENT_DIRECT_ADDED = "direct_added" // WEBSOCKET_EVENT_GROUP_ADDED = "group_added" // WEBSOCKET_EVENT_NEW_USER = "new_user" // WEBSOCKET_EVENT_ADDED_TO_TEAM = "added_to_team" // WEBSOCKET_EVENT_LEAVE_TEAM = "leave_team" // WEBSOCKET_EVENT_UPDATE_TEAM = "update_team" // WEBSOCKET_EVENT_DELETE_TEAM = "delete_team" // WEBSOCKET_EVENT_RESTORE_TEAM = "restore_team" // WEBSOCKET_EVENT_UPDATE_TEAM_SCHEME = "update_team_scheme" // WEBSOCKET_EVENT_USER_ADDED = "user_added" // WEBSOCKET_EVENT_USER_UPDATED = "user_updated" // WEBSOCKET_EVENT_USER_ROLE_UPDATED = "user_role_updated" // WEBSOCKET_EVENT_MEMBERROLE_UPDATED = "memberrole_updated" // WEBSOCKET_EVENT_USER_REMOVED = "user_removed" // WEBSOCKET_EVENT_PREFERENCE_CHANGED = "preference_changed" // WEBSOCKET_EVENT_PREFERENCES_CHANGED = "preferences_changed" // WEBSOCKET_EVENT_PREFERENCES_DELETED = "preferences_deleted" // WEBSOCKET_EVENT_EPHEMERAL_MESSAGE = "ephemeral_message" // WEBSOCKET_EVENT_STATUS_CHANGE = "status_change" // WEBSOCKET_EVENT_HELLO = "hello" WebsocketAuthenticationChallenge = "authentication_challenge" )
Websocket constants.
Variables ¶
var File_matter_proto protoreflect.FileDescriptor
Functions ¶
func RegisterMatterServer ¶
func RegisterMatterServer(s *grpc.Server, srv MatterServer)
Types ¶
type Channel ¶
type Channel struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"` UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty"` DeleteAt int64 `protobuf:"varint,4,opt,name=delete_at,json=deleteAt,proto3" json:"delete_at,omitempty"` TeamID string `protobuf:"bytes,5,opt,name=team_id,json=teamId,proto3" json:"team_id,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` DisplayName string `protobuf:"bytes,7,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` Name string `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Channel) Descriptor
deprecated
func (*Channel) GetCreateAt ¶
func (*Channel) GetDeleteAt ¶
func (*Channel) GetDisplayName ¶
func (*Channel) GetUpdateAt ¶
func (*Channel) ProtoMessage ¶
func (*Channel) ProtoMessage()
func (*Channel) ProtoReflect ¶
func (x *Channel) ProtoReflect() protoreflect.Message
type ChannelsForUserRequest ¶
type ChannelsForUserRequest struct { UserID string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` TeamID string `protobuf:"bytes,2,opt,name=teamId,proto3" json:"teamId,omitempty"` // contains filtered or unexported fields }
func (*ChannelsForUserRequest) Descriptor
deprecated
func (*ChannelsForUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use ChannelsForUserRequest.ProtoReflect.Descriptor instead.
func (*ChannelsForUserRequest) GetTeamID ¶
func (x *ChannelsForUserRequest) GetTeamID() string
func (*ChannelsForUserRequest) GetUserID ¶
func (x *ChannelsForUserRequest) GetUserID() string
func (*ChannelsForUserRequest) ProtoMessage ¶
func (*ChannelsForUserRequest) ProtoMessage()
func (*ChannelsForUserRequest) ProtoReflect ¶
func (x *ChannelsForUserRequest) ProtoReflect() protoreflect.Message
func (*ChannelsForUserRequest) Reset ¶
func (x *ChannelsForUserRequest) Reset()
func (*ChannelsForUserRequest) String ¶
func (x *ChannelsForUserRequest) String() string
type ChannelsForUserResponse ¶
type ChannelsForUserResponse struct { Channels []*Channel `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"` // contains filtered or unexported fields }
func (*ChannelsForUserResponse) Descriptor
deprecated
func (*ChannelsForUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use ChannelsForUserResponse.ProtoReflect.Descriptor instead.
func (*ChannelsForUserResponse) GetChannels ¶
func (x *ChannelsForUserResponse) GetChannels() []*Channel
func (*ChannelsForUserResponse) ProtoMessage ¶
func (*ChannelsForUserResponse) ProtoMessage()
func (*ChannelsForUserResponse) ProtoReflect ¶
func (x *ChannelsForUserResponse) ProtoReflect() protoreflect.Message
func (*ChannelsForUserResponse) Reset ¶
func (x *ChannelsForUserResponse) Reset()
func (*ChannelsForUserResponse) String ¶
func (x *ChannelsForUserResponse) String() string
type Client ¶
Client ...
func (*Client) AddUserToChannel ¶
AddUserToChannel adds a user to a channel.
func (*Client) AddUserToTeam ¶
AddUserToTeam adds a user to a team.
func (*Client) ChannelByName ¶
ChannelByName finds channel by name.
func (*Client) ChannelsForUser ¶
func (c *Client) ChannelsForUser(ctx context.Context, userID string, teamID string) ([]*Channel, error)
ChannelsForUser list channels for logged in user. If userID is "", logged in user (me) is used.
func (*Client) CreateChannel ¶
CreateChannel creates a channel.
func (*Client) CreatePost ¶
CreatePost creates a post.
func (*Client) CreateTeam ¶
func (c *Client) CreateTeam(ctx context.Context, name string, displayName string, typ string) (*Team, error)
CreateTeam creates a team.
func (*Client) CreateUser ¶
CreateUser creates a user.
func (*Client) CreateUserWithKey ¶
CreateUserWithKey creates a user with a key.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, path string, params url.Values) (*http.Response, error)
Delete request.
func (*Client) LoginWithKey ¶
LoginWithKey logs a user in using an EdX25519 key.
func (*Client) LoginWithPassword ¶
func (c *Client) LoginWithPassword(ctx context.Context, username string, password string) (*User, error)
LoginWithPassword logs a user in with a password.
func (*Client) NewWebSocketClient ¶
func (c *Client) NewWebSocketClient() (*WebSocketClient, error)
NewWebSocketClient returns new WebSocketClient.
func (*Client) Post ¶
func (c *Client) Post(ctx context.Context, path string, params url.Values, reader io.Reader) (*http.Response, error)
Post request.
func (*Client) PostWithKey ¶
func (c *Client) PostWithKey(ctx context.Context, path string, params url.Values, reader io.Reader, key *keys.EdX25519Key, contentHash string) (*http.Response, error)
PostWithKey request.
func (*Client) PostsForChannel ¶
PostsForChannel returns posts for channel.
func (*Client) Put ¶
func (c *Client) Put(ctx context.Context, path string, params url.Values, reader io.Reader) (*http.Response, error)
Put request.
func (*Client) SetHTTPClient ¶
SetHTTPClient sets the http.Client to use.
func (*Client) TeamByName ¶
TeamByName finds team.
func (*Client) TeamsForUser ¶
TeamsForUser lists teams for user. If userID is "", logged in user (me) is used.
type ContextLogger ¶
type ContextLogger interface { Debugf(ctx context.Context, format string, args ...interface{}) Infof(ctx context.Context, format string, args ...interface{}) Warningf(ctx context.Context, format string, args ...interface{}) Errorf(ctx context.Context, format string, args ...interface{}) }
ContextLogger interface used in this package with request context.
type CreateChannelRequest ¶
type CreateChannelRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` TeamID string `protobuf:"bytes,2,opt,name=teamId,proto3" json:"teamId,omitempty"` // contains filtered or unexported fields }
func (*CreateChannelRequest) Descriptor
deprecated
func (*CreateChannelRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateChannelRequest.ProtoReflect.Descriptor instead.
func (*CreateChannelRequest) GetName ¶
func (x *CreateChannelRequest) GetName() string
func (*CreateChannelRequest) GetTeamID ¶
func (x *CreateChannelRequest) GetTeamID() string
func (*CreateChannelRequest) ProtoMessage ¶
func (*CreateChannelRequest) ProtoMessage()
func (*CreateChannelRequest) ProtoReflect ¶
func (x *CreateChannelRequest) ProtoReflect() protoreflect.Message
func (*CreateChannelRequest) Reset ¶
func (x *CreateChannelRequest) Reset()
func (*CreateChannelRequest) String ¶
func (x *CreateChannelRequest) String() string
type CreateChannelResponse ¶
type CreateChannelResponse struct { Channel *Channel `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` // contains filtered or unexported fields }
func (*CreateChannelResponse) Descriptor
deprecated
func (*CreateChannelResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateChannelResponse.ProtoReflect.Descriptor instead.
func (*CreateChannelResponse) GetChannel ¶
func (x *CreateChannelResponse) GetChannel() *Channel
func (*CreateChannelResponse) ProtoMessage ¶
func (*CreateChannelResponse) ProtoMessage()
func (*CreateChannelResponse) ProtoReflect ¶
func (x *CreateChannelResponse) ProtoReflect() protoreflect.Message
func (*CreateChannelResponse) Reset ¶
func (x *CreateChannelResponse) Reset()
func (*CreateChannelResponse) String ¶
func (x *CreateChannelResponse) String() string
type Error ¶
type Error struct { StatusCode int `json:"status_code,omitempty"` Message string `json:"message,omitempty"` URL *url.URL `json:"-"` ID string `json:"id,omitempty"` RequestID string `json:"request_id,omitempty"` }
Error ...
type Keyring ¶
type Keyring interface {
EdX25519Key(kid keys.ID) (*keys.EdX25519Key, error)
}
Keyring for service.
type ListenEvent ¶
type ListenEvent struct { Post *Post `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"` // contains filtered or unexported fields }
func (*ListenEvent) Descriptor
deprecated
func (*ListenEvent) Descriptor() ([]byte, []int)
Deprecated: Use ListenEvent.ProtoReflect.Descriptor instead.
func (*ListenEvent) GetPost ¶
func (x *ListenEvent) GetPost() *Post
func (*ListenEvent) ProtoMessage ¶
func (*ListenEvent) ProtoMessage()
func (*ListenEvent) ProtoReflect ¶
func (x *ListenEvent) ProtoReflect() protoreflect.Message
func (*ListenEvent) Reset ¶
func (x *ListenEvent) Reset()
func (*ListenEvent) String ¶
func (x *ListenEvent) String() string
type ListenRequest ¶
type ListenRequest struct {
// contains filtered or unexported fields
}
func (*ListenRequest) Descriptor
deprecated
func (*ListenRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListenRequest.ProtoReflect.Descriptor instead.
func (*ListenRequest) ProtoMessage ¶
func (*ListenRequest) ProtoMessage()
func (*ListenRequest) ProtoReflect ¶
func (x *ListenRequest) ProtoReflect() protoreflect.Message
func (*ListenRequest) Reset ¶
func (x *ListenRequest) Reset()
func (*ListenRequest) String ¶
func (x *ListenRequest) String() string
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warningf(format string, args ...interface{}) Errorf(format string, args ...interface{}) }
Logger interface used in this package.
type LoginRequest ¶
type LoginRequest struct { KID string `protobuf:"bytes,1,opt,name=kid,proto3" json:"kid,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetKID ¶
func (x *LoginRequest) GetKID() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type LoginResponse ¶
type LoginResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetUser ¶
func (x *LoginResponse) GetUser() *User
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
type MatterClient ¶
type MatterClient interface { Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) TeamsForUser(ctx context.Context, in *TeamsForUserRequest, opts ...grpc.CallOption) (*TeamsForUserResponse, error) ChannelsForUser(ctx context.Context, in *ChannelsForUserRequest, opts ...grpc.CallOption) (*ChannelsForUserResponse, error) CreateChannel(ctx context.Context, in *CreateChannelRequest, opts ...grpc.CallOption) (*CreateChannelResponse, error) Listen(ctx context.Context, opts ...grpc.CallOption) (Matter_ListenClient, error) }
MatterClient is the client API for Matter service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewMatterClient ¶
func NewMatterClient(cc grpc.ClientConnInterface) MatterClient
type MatterServer ¶
type MatterServer interface { Login(context.Context, *LoginRequest) (*LoginResponse, error) TeamsForUser(context.Context, *TeamsForUserRequest) (*TeamsForUserResponse, error) ChannelsForUser(context.Context, *ChannelsForUserRequest) (*ChannelsForUserResponse, error) CreateChannel(context.Context, *CreateChannelRequest) (*CreateChannelResponse, error) Listen(Matter_ListenServer) error // contains filtered or unexported methods }
MatterServer is the server API for Matter service. All implementations must embed UnimplementedMatterServer for forward compatibility
func NewService ¶
func NewService(client *Client, kr Keyring) MatterServer
NewService is a service for Matter.
type Matter_ListenClient ¶
type Matter_ListenClient interface { Send(*ListenRequest) error Recv() (*ListenEvent, error) grpc.ClientStream }
type Matter_ListenServer ¶
type Matter_ListenServer interface { Send(*ListenEvent) error Recv() (*ListenRequest, error) grpc.ServerStream }
type Post ¶
type Post struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"` UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty"` EditAt int64 `protobuf:"varint,4,opt,name=edit_at,json=editAt,proto3" json:"edit_at,omitempty"` DeleteAt int64 `protobuf:"varint,5,opt,name=delete_at,json=deleteAt,proto3" json:"delete_at,omitempty"` UserID string `protobuf:"bytes,7,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` ChannelID string `protobuf:"bytes,8,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` Message string `protobuf:"bytes,12,opt,name=message,proto3" json:"message,omitempty"` Type string `protobuf:"bytes,14,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Post) Descriptor
deprecated
func (*Post) GetChannelID ¶
func (*Post) GetCreateAt ¶
func (*Post) GetDeleteAt ¶
func (*Post) GetMessage ¶
func (*Post) GetUpdateAt ¶
func (*Post) ProtoMessage ¶
func (*Post) ProtoMessage()
func (*Post) ProtoReflect ¶
func (x *Post) ProtoReflect() protoreflect.Message
type PostList ¶
type PostList struct { Order []string `protobuf:"bytes,1,rep,name=order,proto3" json:"order,omitempty"` Posts map[string]*Post `` /* 151-byte string literal not displayed */ NextPostID string `protobuf:"bytes,3,opt,name=next_post_id,json=nextPostId,proto3" json:"next_post_id,omitempty"` PrevPostID string `protobuf:"bytes,4,opt,name=prev_post_id,json=prevPostId,proto3" json:"prev_post_id,omitempty"` // contains filtered or unexported fields }
func (*PostList) Descriptor
deprecated
func (*PostList) GetNextPostID ¶
func (*PostList) GetPrevPostID ¶
func (*PostList) ProtoMessage ¶
func (*PostList) ProtoMessage()
func (*PostList) ProtoReflect ¶
func (x *PostList) ProtoReflect() protoreflect.Message
type Team ¶
type Team struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"` UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty"` DeleteAt int64 `protobuf:"varint,4,opt,name=delete_at,json=deleteAt,proto3" json:"delete_at,omitempty"` DisplayName string `protobuf:"bytes,5,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty"` AllowOpenInvite bool `protobuf:"varint,13,opt,name=allow_open_invite,json=allowOpenInvite,proto3" json:"allow_open_invite,omitempty"` // contains filtered or unexported fields }
func (*Team) Descriptor
deprecated
func (*Team) GetAllowOpenInvite ¶
func (*Team) GetCreateAt ¶
func (*Team) GetDeleteAt ¶
func (*Team) GetDisplayName ¶
func (*Team) GetUpdateAt ¶
func (*Team) ProtoMessage ¶
func (*Team) ProtoMessage()
func (*Team) ProtoReflect ¶
func (x *Team) ProtoReflect() protoreflect.Message
type TeamPatch ¶
type TeamPatch struct { DisplayName string `protobuf:"bytes,1,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` CompanyName string `protobuf:"bytes,3,opt,name=company_name,json=companyName,proto3" json:"company_name,omitempty"` AllowedDomains string `protobuf:"bytes,4,opt,name=allowed_domains,json=allowedDomains,proto3" json:"allowed_domains,omitempty"` AllowOpenInvite bool `protobuf:"varint,5,opt,name=allow_open_invite,json=allowOpenInvite,proto3" json:"allow_open_invite,omitempty"` GroupConstrained bool `protobuf:"varint,6,opt,name=group_constrained,json=groupConstrained,proto3" json:"group_constrained,omitempty"` // contains filtered or unexported fields }
func (*TeamPatch) Descriptor
deprecated
func (*TeamPatch) GetAllowOpenInvite ¶
func (*TeamPatch) GetAllowedDomains ¶
func (*TeamPatch) GetCompanyName ¶
func (*TeamPatch) GetDescription ¶
func (*TeamPatch) GetDisplayName ¶
func (*TeamPatch) GetGroupConstrained ¶
func (*TeamPatch) ProtoMessage ¶
func (*TeamPatch) ProtoMessage()
func (*TeamPatch) ProtoReflect ¶
func (x *TeamPatch) ProtoReflect() protoreflect.Message
type TeamsForUserRequest ¶
type TeamsForUserRequest struct { UserID string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*TeamsForUserRequest) Descriptor
deprecated
func (*TeamsForUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use TeamsForUserRequest.ProtoReflect.Descriptor instead.
func (*TeamsForUserRequest) GetUserID ¶
func (x *TeamsForUserRequest) GetUserID() string
func (*TeamsForUserRequest) ProtoMessage ¶
func (*TeamsForUserRequest) ProtoMessage()
func (*TeamsForUserRequest) ProtoReflect ¶
func (x *TeamsForUserRequest) ProtoReflect() protoreflect.Message
func (*TeamsForUserRequest) Reset ¶
func (x *TeamsForUserRequest) Reset()
func (*TeamsForUserRequest) String ¶
func (x *TeamsForUserRequest) String() string
type TeamsForUserResponse ¶
type TeamsForUserResponse struct { Teams []*Team `protobuf:"bytes,1,rep,name=teams,proto3" json:"teams,omitempty"` // contains filtered or unexported fields }
func (*TeamsForUserResponse) Descriptor
deprecated
func (*TeamsForUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use TeamsForUserResponse.ProtoReflect.Descriptor instead.
func (*TeamsForUserResponse) GetTeams ¶
func (x *TeamsForUserResponse) GetTeams() []*Team
func (*TeamsForUserResponse) ProtoMessage ¶
func (*TeamsForUserResponse) ProtoMessage()
func (*TeamsForUserResponse) ProtoReflect ¶
func (x *TeamsForUserResponse) ProtoReflect() protoreflect.Message
func (*TeamsForUserResponse) Reset ¶
func (x *TeamsForUserResponse) Reset()
func (*TeamsForUserResponse) String ¶
func (x *TeamsForUserResponse) String() string
type UnimplementedMatterServer ¶
type UnimplementedMatterServer struct { }
UnimplementedMatterServer must be embedded to have forward compatible implementations.
func (*UnimplementedMatterServer) ChannelsForUser ¶
func (*UnimplementedMatterServer) ChannelsForUser(context.Context, *ChannelsForUserRequest) (*ChannelsForUserResponse, error)
func (*UnimplementedMatterServer) CreateChannel ¶
func (*UnimplementedMatterServer) CreateChannel(context.Context, *CreateChannelRequest) (*CreateChannelResponse, error)
func (*UnimplementedMatterServer) Listen ¶
func (*UnimplementedMatterServer) Listen(Matter_ListenServer) error
func (*UnimplementedMatterServer) Login ¶
func (*UnimplementedMatterServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
func (*UnimplementedMatterServer) TeamsForUser ¶
func (*UnimplementedMatterServer) TeamsForUser(context.Context, *TeamsForUserRequest) (*TeamsForUserResponse, error)
type User ¶
type User struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CreateAt int64 `protobuf:"varint,2,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"` UpdateAt int64 `protobuf:"varint,3,opt,name=update_at,json=updateAt,proto3" json:"update_at,omitempty"` DeleteAt int64 `protobuf:"varint,4,opt,name=delete_at,json=deleteAt,proto3" json:"delete_at,omitempty"` Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` Email string `protobuf:"bytes,9,opt,name=email,proto3" json:"email,omitempty"` EmailVerified bool `protobuf:"varint,10,opt,name=email_verified,json=emailVerified,proto3" json:"email_verified,omitempty"` Nickname string `protobuf:"bytes,11,opt,name=nickname,proto3" json:"nickname,omitempty"` FirstName string `protobuf:"bytes,12,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` LastName string `protobuf:"bytes,13,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` Position string `protobuf:"bytes,14,opt,name=position,proto3" json:"position,omitempty"` Roles string `protobuf:"bytes,15,opt,name=roles,proto3" json:"roles,omitempty"` // contains filtered or unexported fields }
User ...
func (*User) Descriptor
deprecated
func (*User) GetCreateAt ¶
func (*User) GetDeleteAt ¶
func (*User) GetEmailVerified ¶
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetNickname ¶
func (*User) GetPassword ¶
func (*User) GetPosition ¶
func (*User) GetUpdateAt ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type WebSocketClient ¶
type WebSocketClient struct { URL string // The location of the server like "ws://localhost:8065" APIURL string // The API location of the server like "ws://localhost:8065/api/v3" ConnectURL string // The WebSocket URL to connect to like "ws://localhost:8065/api/v3/path/to/websocket" Conn *websocket.Conn // The WebSocket connection AuthToken string // The token used to open the WebSocket connection Sequence int64 // The ever-incrementing sequence attached to each WebSocket action PingTimeoutChannel chan bool // The channel used to signal ping timeouts EventChannel chan *WebSocketEvent // The channel used to receive various events pushed from the server. For example: typing, posted ResponseChannel chan *WebSocketResponse // The channel used to receive responses for requests made to the server ListenError error // A field that is set if there was an abnormal closure of the WebSocket connection // contains filtered or unexported fields }
WebSocketClient stores the necessary information required to communicate with a WebSocket endpoint. A client must read from PingTimeoutChannel, EventChannel and ResponseChannel to prevent deadlocks from occuring in the program.
func NewWebSocketClient ¶
func NewWebSocketClient(url, authToken string) (*WebSocketClient, error)
NewWebSocketClient constructs a new WebSocket client with convenience methods for talking to the server.
func NewWebSocketClientWithDialer ¶
func NewWebSocketClientWithDialer(dialer *websocket.Dialer, url, authToken string) (*WebSocketClient, error)
NewWebSocketClientWithDialer constructs a new WebSocket client with convenience methods for talking to the server using a custom dialer.
func (*WebSocketClient) Close ¶
func (wsc *WebSocketClient) Close()
Close closes the websocket client. It is recommended that a closed client should not be reused again. Rather a new client should be created anew.
func (*WebSocketClient) Connect ¶
func (wsc *WebSocketClient) Connect() error
Connect creates a websocket connection with the given ConnectUrl. This is racy and error-prone should not be used. Use any of the New* functions to create a websocket.
func (*WebSocketClient) ConnectWithDialer ¶
func (wsc *WebSocketClient) ConnectWithDialer(dialer *websocket.Dialer) error
ConnectWithDialer creates a websocket connection with the given ConnectUrl using the dialer. This is racy and error-prone and should not be used. Use any of the New* functions to create a websocket.
func (*WebSocketClient) GetStatuses ¶
func (wsc *WebSocketClient) GetStatuses()
GetStatuses will return a map of string statuses using user id as the key
func (*WebSocketClient) GetStatusesByIds ¶
func (wsc *WebSocketClient) GetStatusesByIds(userIds []string)
GetStatusesByIds will fetch certain user statuses based on ids and return a map of string statuses using user id as the key
func (*WebSocketClient) Listen ¶
func (wsc *WebSocketClient) Listen()
Listen starts the read loop of the websocket client.
func (*WebSocketClient) SendMessage ¶
func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface{})
SendMessage sens a message.
func (*WebSocketClient) UserTyping ¶
func (wsc *WebSocketClient) UserTyping(channelID, parentID string)
UserTyping will push a user_typing event out to all connected users who are in the specified channel
type WebSocketEvent ¶
type WebSocketEvent struct { Event string Data map[string]interface{} Broadcast *WebsocketBroadcast Sequence int64 // contains filtered or unexported fields }
WebSocketEvent ...
type WebSocketRequest ¶
type WebSocketRequest struct { // Client-provided fields Seq int64 `json:"seq"` // A counter which is incremented for every request made. Action string `json:"action"` // The action to perform for a request. For example: get_statuses, user_typing. Data map[string]interface{} `json:"data"` // The metadata for an action. }
WebSocketRequest represents a request made to the server through a websocket.
type WebSocketResponse ¶
type WebSocketResponse struct { Status string `json:"status"` // The status of the response. For example: OK, FAIL. SeqReply int64 `json:"seq_reply,omitempty"` // A counter which is incremented for every response sent. Data map[string]interface{} `json:"data,omitempty"` // The data contained in the response. Error error `json:"error,omitempty"` // A field that is set if any error has occurred. }
WebSocketResponse represents a response received through the WebSocket for a request made to the server. This is available through the ResponseChannel channel in WebSocketClient.
type WebsocketBroadcast ¶
type WebsocketBroadcast struct { OmitUsers map[string]bool `json:"omit_users"` // broadcast is omitted for users listed here UserID string `json:"user_id"` // broadcast only occurs for this user ChannelID string `json:"channel_id"` // broadcast only occurs for users in this channel TeamID string `json:"team_id"` // broadcast only occurs for users in this team }
WebsocketBroadcast ...