Documentation ¶
Index ¶
- Variables
- type InMemoryStorage
- func (s *InMemoryStorage) DeleteMessage(sessionID, participantID string) error
- func (s *InMemoryStorage) DeleteSession(sessionID string) error
- func (s *InMemoryStorage) GetMessage(sessionID, participantID string) ([]model.Message, error)
- func (s *InMemoryStorage) GetSession(sessionID string) ([]string, error)
- func (s *InMemoryStorage) SetMessage(sessionID, participantID string, message model.Message) error
- func (s *InMemoryStorage) SetSession(sessionID string, participants []string) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type InMemoryStorage ¶
type InMemoryStorage struct {
// contains filtered or unexported fields
}
func NewInMemoryStorage ¶
func NewInMemoryStorage() *InMemoryStorage
NewInMemoryStorage returns a new in-memory storage.
func (*InMemoryStorage) DeleteMessage ¶
func (s *InMemoryStorage) DeleteMessage(sessionID, participantID string) error
DeleteMessage deletes a message from a session and a participant.
func (*InMemoryStorage) DeleteSession ¶
func (s *InMemoryStorage) DeleteSession(sessionID string) error
DeleteSession deletes a session.
func (*InMemoryStorage) GetMessage ¶
func (s *InMemoryStorage) GetMessage(sessionID, participantID string) ([]model.Message, error)
GetMessage gets a message from a session and a participant.
func (*InMemoryStorage) GetSession ¶
func (s *InMemoryStorage) GetSession(sessionID string) ([]string, error)
GetSession gets a session with a list of participants.
func (*InMemoryStorage) SetMessage ¶
func (s *InMemoryStorage) SetMessage(sessionID, participantID string, message model.Message) error
SetMessage sets a message to a session and a participant.
func (*InMemoryStorage) SetSession ¶
func (s *InMemoryStorage) SetSession(sessionID string, participants []string) error
SetSession sets a session with a list of participants.
type Storage ¶
type Storage interface { SetSession(sessionID string, participants []string) error GetSession(sessionID string) ([]string, error) DeleteSession(sessionID string) error GetMessage(sessionID, participantID string) ([]model.Message, error) SetMessage(sessionID, participantID string, message model.Message) error DeleteMessage(sessionID, participantID string) error }
Storage is an interface that defines the methods to be implemented by a storage.
Click to show internal directories.
Click to hide internal directories.