model

package
v0.0.0-...-6fbf478 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	// the id for this book
	// required: false
	// swagger:ignore
	ID primitive.ObjectID `json:"id" bson:"_id"`

	// the name of the book
	// required: true
	// min length: 3
	// example: Moondust
	// unique: true
	Name string `json:"name" bson:"name"`

	// the book author's name
	// required: true
	// min length: 3
	// example: Andrew Smith
	Author string `json:"author" bson:"author"`

	// The publisher's name
	// required: true
	// min length: 3
	// example: Bloomsbury Publishing PLC
	Publisher string `json:"publisher" bson:"publisher"`

	// The date the book was published
	// required: true
	PublishedAt PublishedDate `json:"published_at" bson:"publishedAt"`

	// the associated tags with this book
	// example: ["space exploration", "astronauts", "nasa"]
	Tags []string `json:"tags" bson:"tags"`

	// the image path for this book cover
	// example: "/assets/images/book_cover.jpg"
	ImagePath string `json:"image_path" bson:"image_path"`

	// Score review
	// required: true
	// min: 0
	// max: 5
	// example: 4.6
	Review float32 `json:"review" bson:"review"`

	//The day the book was added
	SubmissionDate time.Time `json:"submission_date" bson:"submissionDate"`
}

Book represents a book

swagger:model

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

type JWTOutput

type JWTOutput struct {
	// the JWT token
	// required: true
	Token string `json:"token"`
	// Token's time-to-live (TTL)
	// required: true
	Expires time.Time `json:"expires"`
}

JWTOutput Represents the response after a successful attempt. swagger:model

type PublishedDate

type PublishedDate struct {
	// the month of the year
	// required: true
	// length: 2
	// example: July
	Month string `json:"month" bson:"month"`

	// the month of the year
	// required: true
	// min length: 1
	// example: 2009
	Year string `json:"year" bson:"year"`
}

PublishedDate Represents the month and year of when the book was published

swagger:model

type User

type User struct {
	// the username
	// required: true
	// example: admin
	Username string `json:"username" bson:"username"`

	// the password
	// required: true
	// example: password
	Password string `json:"password" bson:"password"`
}

User represents the credentials of an actor trying to log in.

swagger:model

Jump to

Keyboard shortcuts

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