models

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MainValidator = &CustomValidator{validator: validator.New()}

MainValidator .. CustomValidator Function

Functions

This section is empty.

Types

type CustomValidator

type CustomValidator struct {
	// contains filtered or unexported fields
}

CustomValidator ... Validate the paste with validator v10

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

Validate ... function using CustomValidator

type LanguageRow

type LanguageRow struct {
	Language string
	Name     string
}

LanguageRow ... Model for Language HTTP response

type PasteReqBody

type PasteReqBody struct {
	Title     string      `json:"title" validate:"required"`
	Text      string      `json:"text" validate:"required"`
	ExpiresAt null.String `json:"expires_at,omitempty" validate:"omitempty"`
	Language  string      `json:"language" validate:"required"`
}

PasteReqBody ... Model for the HTTP POST Request Body for Creating a Paste

type PasteResBody

type PasteResBody struct {
	ID                  int
	Text                string
	Title               string
	CreatedAt           null.Time
	Language            string
	LanguageDisplayName string
}

PasteResBody ... Model for Paste HTTP response body when fetching a Paste

Jump to

Keyboard shortcuts

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