rediscli

package
v0.0.0-...-ccdab22 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelPubSub

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

func (*ChannelPubSub) Channel

func (channel *ChannelPubSub) Channel() <-chan *redis.Message

func (*ChannelPubSub) Close

func (channel *ChannelPubSub) Close() <-chan struct{}

func (*ChannelPubSub) Closed

func (channel *ChannelPubSub) Closed() <-chan struct{}

type Message

type Message struct {
	UUID          string    `json:"UUID"`
	SenderUUID    string    `json:"SenderUUID"`
	Sender        *User     `json:"Sender,omitempty"`
	RecipientUUID string    `json:"RecipientUUID"`
	Recipient     *User     `json:"Recipient,omitempty"`
	Message       string    `json:"Message"`
	CreatedAt     time.Time `json:"CreatedAt"`
}

type Redis

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

func NewRedis

func NewRedis(addr, passwd string) *Redis

func (*Redis) AddConnection

func (r *Redis) AddConnection(userSessionUUID string) error

func (*Redis) ChannelJoin

func (r *Redis) ChannelJoin(senderUUID, recipientUUID string) (*ChannelPubSub, string, error)

func (*Redis) ChannelLeave

func (r *Redis) ChannelLeave(senderUUID, recipientUUID string) (string, error)

func (*Redis) ChannelMessage

func (r *Redis) ChannelMessage(message *Message) (string, error)

func (*Redis) ChannelMessages

func (r *Redis) ChannelMessages(channelUUID string, offset, limit int64) ([]*Message, error)

func (*Redis) ChannelMessagesCount

func (r *Redis) ChannelMessagesCount(channelUUID string) (int64, error)

func (*Redis) ChannelUsers

func (r *Redis) ChannelUsers(channelUUID string) ([]*User, error)

func (*Redis) DelConnection

func (r *Redis) DelConnection(userSessionUUID string) error

func (*Redis) UserAll

func (r *Redis) UserAll() ([]*User, error)

func (*Redis) UserAuthorize

func (r *Redis) UserAuthorize(username, password string) (*User, error)

func (*Redis) UserCreate

func (r *Redis) UserCreate(username, password string) (*User, error)

func (*Redis) UserDeleteAccessKey

func (r *Redis) UserDeleteAccessKey(userUUID string)

func (*Redis) UserGet

func (r *Redis) UserGet(userUUID string) (*User, error)

func (*Redis) UserIsOnline

func (r *Redis) UserIsOnline(userUUID string) bool

func (*Redis) UserSetOffline

func (r *Redis) UserSetOffline(userUUID string)

func (*Redis) UserSetOnline

func (r *Redis) UserSetOnline(userUUID string) error

func (*Redis) UserSignOut

func (r *Redis) UserSignOut(userUUID string)

func (*Redis) UserUpdateAccessKey

func (r *Redis) UserUpdateAccessKey(userUUID string) (string, error)

type User

type User struct {
	UUID        string `json:"UUID"`
	Username    string `json:"Username"`
	Password    string `json:"Password,omitempty"`
	AccessKey   string `json:"AccessKey,omitempty"`
	OnLine      bool   `json:"OnLine"`
	SessionUUID string `json:"-"`
}

Jump to

Keyboard shortcuts

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