models

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewID

func NewID() string

Types

type Categories added in v0.4.0

type Categories []*Category

type Category added in v0.4.0

type Category struct {
	Name  string `json:"name"  dynamodbav:"name"  validate:"required"`
	Count int    `json:"count" dynamodbav:"count" validate:"required"`
	Lang  string `json:"-"     dynamodbav:"lang"`
}

type Image

type Image struct {
	Title string `json:"title" validate:"required"`
	URL   string `json:"url"   validate:"required"`
}

type Images

type Images []*Image

type LGTM

type LGTM struct {
	ID        string     `json:"id" dynamodbav:"id"         validate:"required"`
	Status    LGTMStatus `json:"-"  dynamodbav:"status"                        `
	CreatedAt time.Time  `json:"-"  dynamodbav:"created_at"                    `
}

func (*LGTM) URL

func (l *LGTM) URL(base string) (string, error)

type LGTMStatus

type LGTMStatus string
const (
	LGTMStatusOK      LGTMStatus = "ok"
	LGTMStatusPending LGTMStatus = "pending"
)

type LGTMs

type LGTMs []*LGTM

type News

type News struct {
	Date    string `json:"date"`
	Title   string `json:"title"`
	Content string `json:"content"`
}

type NewsList

type NewsList []*News

type Rate

type Rate struct {
	IP      string    `json:"ip"       dynamodbav:"ip"`
	Tier    string    `json:"tier"     dynamodbav:"tier"`
	Count   int       `json:"count"    dynamodbav:"count"`
	ResetAt time.Time `json:"reset_at" dynamodbav:"reset_at"`
}

func (*Rate) Expired

func (r *Rate) Expired() bool

func (*Rate) LimitReached

func (r *Rate) LimitReached(limit int) bool

type Report

type Report struct {
	ID        string     `json:"id"         dynamodbav:"id"`
	LGTMID    string     `json:"lgtm_id"    dynamodbav:"lgtm_id"`
	Type      ReportType `json:"type"       dynamodbav:"type"`
	Text      string     `json:"text"       dynamodbav:"text"`
	CreatedAt time.Time  `json:"created_at" dynamodbav:"created_at"`
}

type ReportType

type ReportType string
const (
	ReportTypeIllegal       ReportType = "illegal"
	ReportTypeInappropriate ReportType = "inappropriate"
	ReportTypeOther         ReportType = "other"
)

func (ReportType) Valid

func (t ReportType) Valid() bool

Jump to

Keyboard shortcuts

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