models

package
v0.0.0-...-a7107f1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDoesNotExist = NewError("entity does not exist")
	ErrAlreadyExist = NewError("entity already exist")
	ErrInvalid      = NewError("entity is invalid")
	ErrConflict     = NewError("entity conflicts with other entity")
	ErrAccessDenied = NewError("access to entity denied")
	ErrValidation   = NewError("entity validation failed")
	ErrBadForeign   = NewError("entity have bad foreign relation")
)

Functions

func NewError

func NewError(message string) error

Types

type Error

type Error struct {
	Message string `json:"message"`
}

func (Error) Error

func (err Error) Error() string

func (Error) MarshalEasyJSON

func (v Error) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Error) MarshalJSON

func (v Error) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Error) UnmarshalEasyJSON

func (v *Error) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Error) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Errors

type Errors []Error

func (Errors) MarshalEasyJSON

func (v Errors) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Errors) MarshalJSON

func (v Errors) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Errors) UnmarshalEasyJSON

func (v *Errors) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Errors) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Forum

type Forum struct {
	ID      int64  `json:"-"`
	Slug    string `json:"slug"`
	Title   string `json:"title"`
	User    string `json:"user"`
	Posts   int64  `json:"posts,omitempty"`
	Threads int64  `json:"threads,omitempty"`
}

func (Forum) MarshalEasyJSON

func (v Forum) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Forum) MarshalJSON

func (v Forum) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Forum) UnmarshalEasyJSON

func (v *Forum) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Forum) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (Forum) Validate

func (forum Forum) Validate() error

type Forums

type Forums []Forum

func (Forums) MarshalEasyJSON

func (v Forums) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Forums) MarshalJSON

func (v Forums) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Forums) UnmarshalEasyJSON

func (v *Forums) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Forums) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Post

type Post struct {
	Author   string    `json:"author"`
	Message  string    `json:"message"`
	Created  time.Time `json:"created,omitempty"`
	Forum    string    `json:"forum,omitempty"`
	ID       int64     `json:"id,omitempty"`
	IsEdited bool      `json:"isEdited,omitempty"`
	Parent   int64     `json:"parent,omitempty"`
	Thread   int32     `json:"thread,omitempty"`
}

func (Post) MarshalEasyJSON

func (v Post) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Post) MarshalJSON

func (v Post) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Post) UnmarshalEasyJSON

func (v *Post) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Post) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (Post) Validate

func (post Post) Validate() error

type PostFullInfo

type PostFullInfo struct {
	Author *User   `json:"author,omitempty"`
	Forum  *Forum  `json:"forum,omitempty"`
	Post   *Post   `json:"post,omitempty"`
	Thread *Thread `json:"thread,omitempty"`
}

func (PostFullInfo) MarshalEasyJSON

func (v PostFullInfo) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PostFullInfo) MarshalJSON

func (v PostFullInfo) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PostFullInfo) UnmarshalEasyJSON

func (v *PostFullInfo) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PostFullInfo) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type PostUpdate

type PostUpdate struct {
	Description string `json:"description,omitempty"`
	Message     string `json:"message,omitempty"`
}

func (PostUpdate) MarshalEasyJSON

func (v PostUpdate) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PostUpdate) MarshalJSON

func (v PostUpdate) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PostUpdate) UnmarshalEasyJSON

func (v *PostUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PostUpdate) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type PostUpdates

type PostUpdates []PostUpdate

func (PostUpdates) MarshalEasyJSON

func (v PostUpdates) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PostUpdates) MarshalJSON

func (v PostUpdates) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PostUpdates) UnmarshalEasyJSON

func (v *PostUpdates) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PostUpdates) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Posts

type Posts []Post

func (Posts) MarshalEasyJSON

func (v Posts) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Posts) MarshalJSON

func (v Posts) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Posts) UnmarshalEasyJSON

func (v *Posts) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Posts) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type PostsFulls

type PostsFulls []PostFullInfo

func (PostsFulls) MarshalEasyJSON

func (v PostsFulls) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PostsFulls) MarshalJSON

func (v PostsFulls) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PostsFulls) UnmarshalEasyJSON

func (v *PostsFulls) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PostsFulls) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Thread

type Thread struct {
	Author  string    `json:"author"`
	Title   string    `json:"title"`
	Message string    `json:"message"`
	ID      int32     `json:"id,omitempty"`
	Forum   string    `json:"forum,omitempty"`
	Created time.Time `json:"created,omitempty"`
	Slug    string    `json:"slug,omitempty"`
	Votes   int32     `json:"votes,omitempty"`
}

func (Thread) MarshalEasyJSON

func (v Thread) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Thread) MarshalJSON

func (v Thread) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Thread) UnmarshalEasyJSON

func (v *Thread) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Thread) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (Thread) Validate

func (thread Thread) Validate() error

type Threads

type Threads []Thread

func (Threads) MarshalEasyJSON

func (v Threads) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Threads) MarshalJSON

func (v Threads) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Threads) UnmarshalEasyJSON

func (v *Threads) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Threads) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type User

type User struct {
	Email    string `json:"email"`
	Fullname string `json:"fullname"`
	Nickname string `json:"nickname,omitempty"`
	About    string `json:"about,omitempty"`
}

func (User) MarshalEasyJSON

func (v User) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (User) MarshalJSON

func (v User) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*User) UnmarshalEasyJSON

func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*User) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (User) Validate

func (user User) Validate() error

type UserUpdate

type UserUpdate struct {
	About    string `json:"about,omitempty"`
	Email    string `json:"email,omitempty"`
	Fullname string `json:"fullname,omitempty"`
}

func (UserUpdate) MarshalEasyJSON

func (v UserUpdate) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserUpdate) MarshalJSON

func (v UserUpdate) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserUpdate) UnmarshalEasyJSON

func (v *UserUpdate) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserUpdate) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (UserUpdate) Validate

func (userUpdate UserUpdate) Validate() error

type UserUpdates

type UserUpdates []UserUpdate

func (UserUpdates) MarshalEasyJSON

func (v UserUpdates) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserUpdates) MarshalJSON

func (v UserUpdates) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserUpdates) UnmarshalEasyJSON

func (v *UserUpdates) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserUpdates) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Users

type Users []User

func (Users) MarshalEasyJSON

func (v Users) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Users) MarshalJSON

func (v Users) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Users) UnmarshalEasyJSON

func (v *Users) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Users) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Vote

type Vote struct {
	Nickname string `json:"nickname"`
	Voice    int16  `json:"voice"`
}

func (Vote) MarshalEasyJSON

func (v Vote) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Vote) MarshalJSON

func (v Vote) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Vote) UnmarshalEasyJSON

func (v *Vote) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Vote) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

type Votes

type Votes []Vote

func (Votes) MarshalEasyJSON

func (v Votes) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Votes) MarshalJSON

func (v Votes) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Votes) UnmarshalEasyJSON

func (v *Votes) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Votes) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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