monketype

package module
v0.0.0-...-51eac0e Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: AGPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ban

type Ban struct {
	ID      string `json:"id" db:"id"`
	Banner  string `json:"banner" db:"banner"`
	Banned  string `json:"banned" db:"banned"`
	Reason  string `json:"reason" db:"reason"`
	Created int64  `json:"created" db:"created"`
	Expires int64  `json:"expires" db:"expires"`
	Forever bool   `json:"forever" db:"forever"`
}

func NewBan

func NewBan(banner, banned, reason string, duration int64, forever bool) (ban Ban)

func (*Ban) FromMap

func (it *Ban) FromMap(data map[string]interface{}) (err error)

func (Ban) JSON

func (ban Ban) JSON() (data []byte, err error)

func (Ban) Map

func (ban Ban) Map() (data map[string]interface{})

type Content

type Content struct {
	ID           string   `json:"id" db:"id"`
	FileURL      string   `json:"file_url" db:"file_url"`
	Author       string   `json:"author" db:"author"`
	Mime         string   `json:"mime" db:"mime"`
	Tags         []string `json:"tags" db:"tags"`
	LikeCount    int      `json:"like_count" db:"like_count"`
	DislikeCount int      `json:"dislike_count" db:"dislike_count"`
	RepubCount   int      `json:"repub_count" db:"repub_count"`
	ViewCount    int      `json:"view_count" db:"view_count"`
	CommentCount int      `json:"comment_count" db:"comment_count"`
	Created      int64    `json:"created" db:"created"`
	Featured     bool     `json:"featured" db:"featured"`
	Featurable   bool     `json:"featurable" db:"featurable"`
	Removed      bool     `json:"removed" db:"removed"`
	NSFW         bool     `json:"nsfw" db:"nsfw"`
}

func ContentFromMap

func ContentFromMap(data map[string]interface{}) (it Content, err error)

func NewContent

func NewContent(file_url, author, mime string, tags []string, featurable, nsfw bool) (created Content)

func (*Content) FromMap

func (it *Content) FromMap(data map[string]interface{}) (err error)

func (Content) JSON

func (content Content) JSON() (data []byte, err error)

func (Content) Map

func (content Content) Map() (data map[string]interface{})

type MonkeType

type MonkeType interface {
	Map() map[string]interface{}
	JSON() ([]byte, error)
}

type Report

type Report struct {
	ID         string `json:"id" db:"id"`
	Reporter   string `json:"reporter" db:"reporter"`
	Reported   string `json:"reported" db:"reported"`
	Type       string `json:"type" db:"type"`
	Reason     string `json:"reason" db:"reason"`
	Created    int64  `json:"created" db:"created"`
	Resolved   bool   `json:"resolved" db:"resolved"`
	Resolution string `json:"resolution" db:"resolution"`
}

func NewReport

func NewReport(reporter, reported, report_type, reason string) (report Report)

func (*Report) FromMap

func (it *Report) FromMap(data map[string]interface{}) (err error)

func (Report) JSON

func (report Report) JSON() (data []byte, err error)

func (Report) Map

func (report Report) Map() (data map[string]interface{})

type User

type User struct {
	ID                string `json:"id" db:"id"`
	Email             string `json:"email" db:"email"`
	Nick              string `json:"nick" db:"nick"`
	Bio               string `json:"bio" db:"bio"`
	SubscriberCount   int    `json:"subscriber_count" db:"subscriber_count"`
	SubscriptionCount int    `json:"subscription_count" db:"subscription_count"`
	PostCount         int    `json:"post_count" db:"post_count"`
	Created           int64  `json:"created" db:"created"`
	Moderator         bool   `json:"moderator" db:"moderator"`
	Admin             bool   `json:"admin" db:"admin"`
}

func NewUser

func NewUser(nick, bio, email string) (made User)

func UserFromMap

func UserFromMap(data map[string]interface{}) (it User, err error)

func (*User) FromMap

func (it *User) FromMap(data map[string]interface{}) (err error)

func (User) JSON

func (user User) JSON() (data []byte, err error)

func (User) Map

func (user User) Map() (data map[string]interface{})

func (User) PublicMap

func (user User) PublicMap() (data map[string]interface{})

Jump to

Keyboard shortcuts

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