matterclient

package
v0.11.0-beta2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2017 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Login         string
	Team          string
	Pass          string
	Server        string
	NoTLS         bool
	SkipTLSVerify bool
}

type MMClient

type MMClient struct {
	sync.RWMutex
	*Credentials
	Team        *Team
	OtherTeams  []*Team
	Client      *model.Client
	User        *model.User
	Users       map[string]*model.User
	MessageChan chan *Message

	WsClient    *websocket.Conn
	WsQuit      bool
	WsAway      bool
	WsConnected bool
	WsSequence  int64
	WsPingChan  chan *model.WebSocketResponse
	// contains filtered or unexported fields
}

func New

func New(login, pass, team, server string) *MMClient

func (*MMClient) GetChannelHeader

func (m *MMClient) GetChannelHeader(channelId string) string

func (*MMClient) GetChannelId

func (m *MMClient) GetChannelId(name string, teamId string) string

func (*MMClient) GetChannelName

func (m *MMClient) GetChannelName(channelId string) string

func (*MMClient) GetChannels

func (m *MMClient) GetChannels() []*model.Channel

GetChannels returns all channels we're members off

func (*MMClient) GetLastViewedAt

func (m *MMClient) GetLastViewedAt(channelId string) int64

func (*MMClient) GetMoreChannels

func (m *MMClient) GetMoreChannels() []*model.Channel

GetMoreChannels returns existing channels where we're not a member off.

func (*MMClient) GetPosts

func (m *MMClient) GetPosts(channelId string, limit int) *model.PostList

func (*MMClient) GetPostsSince

func (m *MMClient) GetPostsSince(channelId string, time int64) *model.PostList
func (m *MMClient) GetPublicLink(filename string) string
func (m *MMClient) GetPublicLinks(filenames []string) []string

func (*MMClient) GetStatus added in v0.6.1

func (m *MMClient) GetStatus(userId string) string

func (*MMClient) GetStatuses added in v0.9.1

func (m *MMClient) GetStatuses() map[string]string

func (*MMClient) GetTeamFromChannel

func (m *MMClient) GetTeamFromChannel(channelId string) string

GetTeamFromChannel returns teamId belonging to channel (DM channels have no teamId).

func (*MMClient) GetTeamId added in v0.7.0

func (m *MMClient) GetTeamId() string

func (*MMClient) GetTeamName

func (m *MMClient) GetTeamName(teamId string) string

GetTeamName returns the name of the specified teamId

func (*MMClient) GetUser

func (m *MMClient) GetUser(userId string) *model.User

func (*MMClient) GetUsers

func (m *MMClient) GetUsers() map[string]*model.User

func (*MMClient) JoinChannel

func (m *MMClient) JoinChannel(channelId string) error

func (*MMClient) Login

func (m *MMClient) Login() error

func (*MMClient) Logout

func (m *MMClient) Logout() error

func (*MMClient) PostMessage

func (m *MMClient) PostMessage(channelId string, text string)

func (*MMClient) SearchPosts

func (m *MMClient) SearchPosts(query string) *model.PostList

func (*MMClient) SendDirectMessage

func (m *MMClient) SendDirectMessage(toUserId string, msg string)

SendDirectMessage sends a direct message to specified user

func (*MMClient) SetLogLevel

func (m *MMClient) SetLogLevel(level string)

func (*MMClient) StatusLoop added in v0.6.1

func (m *MMClient) StatusLoop()

func (*MMClient) UpdateChannelHeader

func (m *MMClient) UpdateChannelHeader(channelId string, header string)

func (*MMClient) UpdateChannels

func (m *MMClient) UpdateChannels() error

func (*MMClient) UpdateLastViewed

func (m *MMClient) UpdateLastViewed(channelId string)

func (*MMClient) UpdateUsers

func (m *MMClient) UpdateUsers() error

func (*MMClient) UsernamesInChannel

func (m *MMClient) UsernamesInChannel(channelId string) []string

func (*MMClient) WsReceiver

func (m *MMClient) WsReceiver()

type Message

type Message struct {
	Raw      *model.WebSocketEvent
	Post     *model.Post
	Team     string
	Channel  string
	Username string
	Text     string
}

type Team

type Team struct {
	Team         *model.Team
	Id           string
	Channels     *model.ChannelList
	MoreChannels *model.ChannelList
	Users        map[string]*model.User
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL