Documentation
¶
Index ¶
- Constants
- func EncodeSessionList(sessions []SessionInfo) []byte
- type Client
- func (c *Client) Close() error
- func (c *Client) GetSession() (SessionInfo, error)
- func (c *Client) ListSessions() ([]SessionInfo, error)
- func (c *Client) Lock() error
- func (c *Client) Logout() error
- func (c *Client) OnSessionEnded(fn func())
- func (c *Client) OnSessionListChanged(fn func([]SessionInfo))
- func (c *Client) OnSessionStarted(fn func(SessionInfo))
- func (c *Client) Raw() *sutra.Client
- func (c *Client) SwitchUser() error
- type SessionInfo
Constants ¶
View Source
const ( ServiceName = "dev.avyos.login" RequestLogout uint16 = 0x0201 RequestLock uint16 = 0x0202 RequestGetSession uint16 = 0x0203 RequestListSessions uint16 = 0x0204 RequestSwitchUser uint16 = 0x0205 EventSessionStarted uint16 = 0x0301 EventSessionEnded uint16 = 0x0302 EventSessionListChanged uint16 = 0x0303 )
Variables ¶
This section is empty.
Functions ¶
func EncodeSessionList ¶
func EncodeSessionList(sessions []SessionInfo) []byte
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a typed API to the login/session manager service.
func (*Client) GetSession ¶
func (c *Client) GetSession() (SessionInfo, error)
func (*Client) ListSessions ¶
func (c *Client) ListSessions() ([]SessionInfo, error)
func (*Client) OnSessionEnded ¶
func (c *Client) OnSessionEnded(fn func())
func (*Client) OnSessionListChanged ¶
func (c *Client) OnSessionListChanged(fn func([]SessionInfo))
func (*Client) OnSessionStarted ¶
func (c *Client) OnSessionStarted(fn func(SessionInfo))
func (*Client) SwitchUser ¶
type SessionInfo ¶
func DecodeSessionInfo ¶
func DecodeSessionInfo(data []byte) SessionInfo
func DecodeSessionList ¶
func DecodeSessionList(data []byte) []SessionInfo
func (*SessionInfo) Encode ¶
func (s *SessionInfo) Encode() []byte
Click to show internal directories.
Click to hide internal directories.