model

package
v0.0.0-...-7c2803f Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// The general error message
	//
	// required: true
	// example: Unauthorized
	Error string `json:"error"`
	// The http error code.
	//
	// required: true
	// example: 401
	ErrorCode int `json:"errorCode"`
	// The http error code.
	//
	// required: true
	// example: you need to provide a valid access token or user credentials to access this api
	ErrorDescription string `json:"errorDescription"`
}

Error Model

The Error contains error relevant information.

swagger:model Error

type Paging

type Paging struct {
	Skip      *int64
	Limit     *int64
	SortKey   string
	SortVal   int
	Condition interface{}
}

Paging Model

type Post

type Post struct {
	ID     primitive.ObjectID `bson:"_id" json:"id"`
	UserID primitive.ObjectID `bson:"userId" json:"userId"`
	Title  string             `bson:"title" json:"title"`
	Body   string             `bson:"body" json:"body"`
}

The Post holds

func (*Post) New

func (p *Post) New() *Post

New is an instance

type User

type User struct {
	ID       primitive.ObjectID `bson:"_id" json:"id"`
	Name     string             `bson:"name" json:"name"`
	UserName string             `bson:"username" json:"username"`
	Email    string             `bson:"email" json:"email"`
	Address  UserAddress        `bson:"address" json:"address"`
	Phone    string             `bson:"phone" json:"phone"`
	Website  string             `bson:"website" json:"website"`
	Company  UserCompany        `bson:"company" json:"company"`
	Created  time.Time          `bson:"created" json:"created"`
	Updated  time.Time          `bson:"updated" json:"updated"`
}

The User holds

func (*User) New

func (u *User) New() *User

New is

type UserAddress

type UserAddress struct {
	Street  string         `bson:"street" json:"street"`
	Suite   string         `bson:"suite" json:"suite"`
	City    string         `bson:"city" json:"city"`
	Zipcode string         `bson:"zipcode" json:"zipcode"`
	Geo     UserAddressGeo `bson:"geo" json:"geo"`
}

The UserAddress holds

type UserAddressGeo

type UserAddressGeo struct {
	Lat string `bson:"lat" json:"lat"`
	Lng string `bson:"lng" json:"lng"`
}

The UserAddressGeo holds

type UserCompany

type UserCompany struct {
	Name        string `bson:"name" json:"name"`
	CatchPhrase string `bson:"catchPhrase" json:"catchPhrase"`
	BS          string `bson:"bs" json:"bs"`
}

The UserCompany holds

type VersionInfo

type VersionInfo struct {
	// The current version.
	//
	// required: true
	// example: 5.2.6
	Version string `json:"version"`
	// The git commit hash on which this binary was built.
	//
	// required: true
	// example: ae9512b6b6feea56a110d59a3353ea3b9c293864
	Commit string `json:"commit"`
	// The date on which this binary was built.
	//
	// required: true
	// example: 2018-02-27T19:36:10.5045044+01:00
	BuildDate string `json:"buildDate"`
}

VersionInfo Model

swagger:model VersionInfo

Jump to

Keyboard shortcuts

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