models

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

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

Go to latest
Published: May 7, 2024 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 Comment

type Comment struct {
	Id          int       `json:"id,omitempty"`
	Author      string    `json:"author"`
	CommentText string    `json:"comment_text"`
	NewsId      int       `json:"news_id"`
	ParentId    NullInt64 `json:"parent_id,omitempty"`
	Level       int       `json:"level,omitempty"`
}

type Comments

type Comments []Comment

type NewComment

type NewComment struct {
	Author      string `json:"author"`
	CommentText string `json:"comment_text"`
	NewsId      int    `json:"news_id"`
	ParentId    int    `json:"parent_id,omitempty"`
}

type News

type News struct {
	Id          int
	Title       string
	Description string
	Link        string
	PubDate     int
	Author      string
	Guid        string
}

type NewsDetailed

type NewsDetailed struct {
	News     News
	Comments Comments
}

type NullInt64

type NullInt64 struct {
	sql.NullInt64
}

func (*NullInt64) MarshalJSON

func (ni *NullInt64) MarshalJSON() ([]byte, error)

MarshalJSON for NullInt64

func (*NullInt64) UnmarshalJSON

func (v *NullInt64) UnmarshalJSON(data []byte) error

Unmarshalling into a pointer will let us detect null

type Pages

type Pages struct {
	Total   int
	Current int
}

type Response

type Response struct {
	News  []ShortNews
	Pages Pages
}

type RoutineComments

type RoutineComments struct {
	Comments Comments
	Err      error
}

type RoutineNews

type RoutineNews struct {
	News News
	Err  error
}

type ShortNews

type ShortNews struct {
	Id          int
	Title       string
	Description string
	PubDate     int64
}

Jump to

Keyboard shortcuts

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