model

package
v0.0.0-...-09a68ad Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const EqualSignReplacer = "(^.!#*]"

Variables

This section is empty.

Functions

This section is empty.

Types

type ByTimestamp

type ByTimestamp []*Message

func (ByTimestamp) Len

func (m ByTimestamp) Len() int

func (ByTimestamp) Less

func (m ByTimestamp) Less(i, j int) bool

func (ByTimestamp) Swap

func (m ByTimestamp) Swap(i, j int)

type Message

type Message struct {
	ID             string      `bson:"_id"`
	Timestamp      time.Time   `bson:"timestamp" json:"timestamp"`
	Type           MessageType `json:"type" bson:"type"`
	MessageID      string      `json:"message_id" bson:"message_id"`
	UserID         string      `json:"user_id" bson:"user_id"`
	Username       string      `json:"username" bson:"username"`
	GroupID        string      `json:"group_id" bson:"group_id"`
	Text           string      `json:"text" bson:"text"`
	ExpirationDate time.Time   `json:"expiration_date" bson:"expiration_date"`
}

type MessageType

type MessageType string
const (
	MessageTypeUser  MessageType = "user"
	MessageTypeGroup MessageType = "group"
)

type Schedule

type Schedule struct {
	Id        bson.ObjectId `json:"_" bson:"_id"`
	Name      string        `json:"name" bson:"name"`
	Cron      string        `json:"cron" bson:"cron"`
	Message   string        `json:"message" bson:"message"`
	ReplyTo   string        `json:"reply_to" bson:"reply_to"`
	IsDone    bool          `json:"is_done" bson:"is_done"`
	CreatedAt time.Time     `json:"created_at" bson:"created_at"`
	LastRun   time.Time     `json:"last_run" bson:"last_run"`
}

func (*Schedule) ShortString

func (s *Schedule) ShortString() string

func (*Schedule) String

func (s *Schedule) String() string

type User

type User struct {
	ID            string `json:"id" bson:"_id"`
	Name          string `json:"name" bson:"name"`
	PictureURL    string `json:"picture_url" bson:"picture_url"`
	StatusMessage string `json:"status_message" bson:"status_message"`
}

Jump to

Keyboard shortcuts

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