models

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ActivityModel = &models.Model{
	IModel:            &Activity{},
	MongodbConnection: MongodbConnection,
	DatabaseName:      DatabaseName,
}
View Source
var DatabaseName = "api_test"
View Source
var MongodbConnection = "mongodb://localhost:27017"
View Source
var UserModel = &models.Model{
	IModel:            &User{},
	MongodbConnection: MongodbConnection,
	DatabaseName:      DatabaseName,
}

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Image    string   `bson:"image" json:"image" xml:"image"`
	Images   []string `bson:"images" json:"images" xml:"images"`
	Title    string   `bson:"title" json:"title" xml:"title"`
	Titles   string   `bson:"titles" json:"titles" xml:"titles"`
	Content  string   `bson:"content" json:"content" xml:"content"`
	Distance string   `bson:"distance" json:"distance" xml:"distance"`
}

func (*Activity) CheckRequired added in v0.6.0

func (activity *Activity) CheckRequired(data map[string]interface{}) error

func (*Activity) GetCollectionName added in v0.6.0

func (*Activity) GetCollectionName() string

func (*Activity) GetUnique added in v0.6.0

func (*Activity) GetUnique() string

func (*Activity) Validate added in v0.6.0

func (*Activity) Validate(data map[string]any) error

type User

type User struct {
	Name string `bson:"name" json:"name" xml:"name"`
	Age  int    `bson:"age" json:"age" xml:"age"`
}

func (*User) CheckRequired added in v0.6.0

func (*User) CheckRequired(data map[string]interface{}) error

func (*User) GetCollectionName added in v0.6.0

func (*User) GetCollectionName() string

func (*User) GetUnique added in v0.6.0

func (*User) GetUnique() string

func (*User) Validate added in v0.6.0

func (*User) Validate(data map[string]any) error

Jump to

Keyboard shortcuts

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