model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "messages"

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ID        primitive.ObjectID `bson:"_id,omitempty" validate:"-"`
	Type      string             `bson:"type" validate:"required"`
	Msg       string             `bson:"msg" validate:"required"`
	Status    bool               `bson:"status" validate:"required"`
	CreatedAt time.Time          `bson:"createdAt" validate:"required"`
	UpdatedAt time.Time          `bson:"updatedAt" validate:"required"`
}

func NewMessage

func NewMessage(msgType string, msgTxt string) (*Message, error)

func (*Message) EnsureIndexes

func (*Message) EnsureIndexes(db mongo.Database)

func (*Message) GetValue

func (message *Message) GetValue() *Message

func (*Message) Validate

func (message *Message) Validate() error

Jump to

Keyboard shortcuts

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