memory

package
v0.0.0-...-3c61d03 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(hostname string) *Backend

func (*Backend) GetEventByID

func (backend *Backend) GetEventByID(id string) events.Event

func (*Backend) GetEventsSince

func (backend *Backend) GetEventsSince(user internal.User, sinceToken string, limit int) []events.Event

func (*Backend) GetRoomByAlias

func (backend *Backend) GetRoomByAlias(alias string) internal.Room

func (*Backend) GetRoomByID

func (backend *Backend) GetRoomByID(id string) internal.Room

func (*Backend) GetUserByName

func (backend *Backend) GetUserByName(userName string) internal.User

func (*Backend) GetUserByToken

func (backend *Backend) GetUserByToken(token string) internal.User

func (*Backend) Login

func (backend *Backend) Login(username, password, device string) (user internal.User, token string, err models.ApiError)

func (*Backend) PublicRooms

func (backend *Backend) PublicRooms(filter string) []internal.Room

func (*Backend) PutEvent

func (backend *Backend) PutEvent(event events.Event) error

func (*Backend) Register

func (backend *Backend) Register(username, password, device string) (user internal.User, token string, err models.ApiError)

func (*Backend) ValidateUsernameFunc

func (backend *Backend) ValidateUsernameFunc() func(string) error

type BySize

type BySize []internal.Room

func (BySize) Len

func (a BySize) Len() int

func (BySize) Less

func (a BySize) Less(i, j int) bool

func (BySize) Swap

func (a BySize) Swap(i, j int)

type Room

type Room struct {
	// contains filtered or unexported fields
}

func (*Room) AliasName

func (room *Room) AliasName() string

func (*Room) Aliases

func (room *Room) Aliases() []string

func (*Room) AvatarURL

func (room *Room) AvatarURL() string

func (*Room) Creator

func (room *Room) Creator() internal.User

func (*Room) GuestCanJoin

func (room *Room) GuestCanJoin() bool

func (*Room) ID

func (room *Room) ID() string

func (*Room) Name

func (room *Room) Name() string

func (*Room) State

func (room *Room) State() createroom.Preset

func (*Room) Topic

func (room *Room) Topic() string

func (*Room) Users

func (room *Room) Users() []internal.User

func (*Room) Visibility

func (room *Room) Visibility() createroom.VisibilityType

func (*Room) WorldReadable

func (room *Room) WorldReadable() bool

type Token

type Token struct {
	Device string
}

type User

type User struct {
	Tokens map[string]Token
	// contains filtered or unexported fields
}

func (*User) AddFilter

func (user *User) AddFilter(filterID string, filter common.Filter)

func (*User) AddRoomAlias

func (user *User) AddRoomAlias(room internal.Room, alias string) models.ApiError

func (*User) ChangePassword

func (user *User) ChangePassword(newPassword string)

func (*User) CreateRoom

func (user *User) CreateRoom(request createroom.Request) (internal.Room, models.ApiError)

func (*User) DeleteRoomAlias

func (user *User) DeleteRoomAlias(alias string) models.ApiError

func (*User) Devices

func (user *User) Devices() []devices.Device

func (*User) GetFilterByID

func (user *User) GetFilterByID(filterID string) *common.Filter

func (*User) ID

func (user *User) ID() string

func (*User) Invite

func (user *User) Invite(room internal.Room, invitee internal.User) models.ApiError

func (*User) JoinRoom

func (user *User) JoinRoom(room internal.Room) models.ApiError

func (*User) JoinedRooms

func (user *User) JoinedRooms() []internal.Room

func (*User) LeaveRoom

func (user *User) LeaveRoom(room internal.Room) models.ApiError

func (*User) Logout

func (user *User) Logout(token string)

func (*User) LogoutAll

func (user *User) LogoutAll()

func (*User) Name

func (user *User) Name() string

func (*User) Password

func (user *User) Password() string

func (*User) SendMessage

func (user *User) SendMessage(room internal.Room, text string) models.ApiError

func (*User) SetRoomVisibility

func (user *User) SetRoomVisibility(room internal.Room, visibilityType createroom.VisibilityType) models.ApiError

func (*User) SetTopic

func (user *User) SetTopic(room internal.Room, topic string) models.ApiError

func (*User) Sync

func (user *User) Sync(token string, request mSync.SyncRequest) (response *mSync.SyncReply, err models.ApiError)

Jump to

Keyboard shortcuts

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