utils

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// default number of message to cache at any given time
	DefaultNumOfMsgToCache int = 50
)

Variables

View Source
var (
	// ErrItemNotFound item not found
	ErrItemNotFound = errors.New("item not found")
)

Functions

func ReplaceIndexes

func ReplaceIndexes(str string) string

Types

type Author

type Author struct {
	ID    string
	Name  string
	Email string
}

MessageCache

type Message

type Message struct {
	ID     string
	Text   string
	Author Author
}

type MessageCache

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

func NewMessageCache

func NewMessageCache() *MessageCache

func (*MessageCache) Find

func (mc *MessageCache) Find(msgId string) (*Message, error)

func (*MessageCache) Push

func (mc *MessageCache) Push(msgId, text, userId, name, email string) error

Jump to

Keyboard shortcuts

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